{"_id":"polygonize","_rev":"8-605a025df7162227786ada5b208e4581","name":"polygonize","description":"Javascript implementation of GEOS's Polygonize function","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"polygonize","version":"1.0.0","description":"Javascript implementation of GEOS's Polygonize function","main":"dist/index.js","scripts":{"test":"npm run lint && npm run test-es5","test-es5":"npm run build && tape dist/*.test.js dist/test.js","test-es6":"tape src/*.test.js src/test.js","lint":"eslint .","build":"babel src --out-dir dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"keywords":["geojson","gis","polygonize","polygon","line","linestring"],"babel":{"presets":["es2015"]},"author":{"name":"Nicolas Cisco","email":"@nickcis"},"license":"MIT","bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"homepage":"https://github.com/nickcis/polygonize#readme","devDependencies":{"babel-cli":"^6.24.1","babel-preset-es2015":"^6.24.1","eslint":"^3.19.0","eslint-config-mourner":"^2.0.1","tape":"^4.6.3"},"dependencies":{"@turf/envelope":"^4.3.0","@turf/helpers":"^4.3.0","@turf/inside":"^4.3.0"},"gitHead":"f71dd42e76f5f8560ee334bef04f8035800ebe0e","_id":"polygonize@1.0.0","_shasum":"88342648c82da26f9132274f27a3c4b9fb33f33e","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.10.0","_npmUser":{"name":"nickcis","email":"ncis20@gmail.com"},"dist":{"shasum":"88342648c82da26f9132274f27a3c4b9fb33f33e","tarball":"https://registry.npmjs.org/polygonize/-/polygonize-1.0.0.tgz","integrity":"sha512-PmeLWHDmKzZX/X4grWW1SInxUM08HsHGnOf+7MIPAKMmdGzonRhTOlHLjvmoCGaF9spjPNEkPgJupGeks9NYOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAy9A7+M2iA7x4c3BfxyzgY3ezXQxQ8bu2Nyvo0d4ESKAiBRgXSS+bEsGCmEfaki9nf7rr2FXeiGB2ugdtDqqCJSYQ=="}]},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.0.0.tgz_1496007853950_0.9726293296553195"}},"1.0.1":{"name":"polygonize","version":"1.0.1","description":"Javascript implementation of GEOS's Polygonize function","main":"dist/index.js","scripts":{"test":"npm run lint && npm run test-es5 && npm run bench","test-es5":"npm run build && tape dist/*.test.js dist/test.js","test-es6":"tape src/*.test.js src/test.js","lint":"eslint .","build":"babel src --out-dir dist","prepublish":"npm run build","bench-es6":"node src/bench.js","bench":"node dist/bench.js"},"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"keywords":["geojson","gis","polygonize","polygon","line","linestring"],"babel":{"presets":["es2015"]},"author":{"name":"Nicolas Cisco","email":"@nickcis"},"license":"MIT","bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"homepage":"https://github.com/nickcis/polygonize#readme","devDependencies":{"babel-cli":"^6.24.1","babel-preset-es2015":"^6.24.1","benchmark":"^2.1.4","eslint":"^3.19.0","eslint-config-mourner":"^2.0.1","load-json-file":"^2.0.0","tape":"^4.6.3","write-json-file":"^2.2.0"},"dependencies":{"@turf/envelope":"^4.3.0","@turf/helpers":"^4.3.0","@turf/inside":"^4.3.0","@turf/invariant":"^4.3.0","@turf/meta":"^4.3.0"},"gitHead":"b35f78ecfe43ac3c88eb07bfc408d6383a1d689f","_id":"polygonize@1.0.1","_shasum":"51fb7040914be0fbc43b0bd54d421d75fc2ae7a6","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.10.0","_npmUser":{"name":"nickcis","email":"ncis20@gmail.com"},"dist":{"shasum":"51fb7040914be0fbc43b0bd54d421d75fc2ae7a6","tarball":"https://registry.npmjs.org/polygonize/-/polygonize-1.0.1.tgz","integrity":"sha512-vVkeF4ju+QEuutzMwnt4t1oGt8CbbfyszSU2t+UTzupfsOFH3IWTINHuY2+Lwz4D+SufwlLIJwHd5XdxMO9XDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1xcTTgEXsOyk2B2KH4kvgXxsj1dFqV2DxE9CsktIL1AiBgONHboAsdlvsXsivgt914qlT39TodG1IA/5z+N6HDRg=="}]},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.0.1.tgz_1496257546834_0.5544098301324993"}},"1.0.2":{"name":"polygonize","version":"1.0.2","description":"Javascript implementation of GEOS's Polygonize function","main":"dist/index.js","scripts":{"test":"npm run lint && npm run test-es5 && npm run bench","test-es5":"npm run build && tape dist/*.test.js dist/test.js","test-es6":"tape src/*.test.js src/test.js","lint":"eslint .","build":"babel src --out-dir dist","prepublish":"npm run build","bench-es6":"node src/bench.js","bench":"node dist/bench.js"},"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"keywords":["geojson","gis","polygonize","polygon","line","linestring"],"author":{"name":"Nicolas Cisco","email":"@nickcis"},"license":"MIT","bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"homepage":"https://github.com/nickcis/polygonize#readme","devDependencies":{"babel-cli":"^6.24.1","babel-preset-es2015":"^6.24.1","benchmark":"^2.1.4","eslint":"^3.19.0","eslint-config-mourner":"^2.0.1","load-json-file":"^2.0.0","tape":"^4.6.3","write-json-file":"^2.2.0"},"dependencies":{"@turf/envelope":"^4.3.0","@turf/helpers":"^4.3.0","@turf/inside":"^4.3.0","@turf/invariant":"^4.3.0","@turf/meta":"^4.3.0"},"gitHead":"e9d965af21ba5577deacb02893d35e4c533029f7","_id":"polygonize@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"nickcis","email":"ncis20@gmail.com"},"dist":{"integrity":"sha512-UZwKpriwMSj5tZkhs3T+tEU5UZMTvkIA/4p5rB3jv5x2tH2Ag3pVG6l6NgFBE0P7yZzBWZFkc3ea+0umo/x68w==","shasum":"bf92c0f52edd2191563e22b101727286e1453984","tarball":"https://registry.npmjs.org/polygonize/-/polygonize-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEtvJRWEgRFeLaYIant/ZHgkZ136ZUWPJzcqUrkllmixAiAsnxz+s2FplYegD8ulhIPilT5ySzc4NEIkhL59dos4OQ=="}]},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.0.2.tgz_1502728392555_0.6778606101870537"}},"1.0.3":{"name":"polygonize","version":"1.0.3","description":"Javascript implementation of GEOS's Polygonize function","main":"dist/index.js","scripts":{"test":"npm run lint && npm run test-es5 && npm run bench","test-es5":"npm run build && tape dist/*.test.js dist/test.js","test-es6":"tape src/*.test.js src/test.js","lint":"eslint .","build":"babel src --out-dir dist","prepublishOnly":"npm run build","bench-es6":"node src/bench.js","bench":"node dist/bench.js"},"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"keywords":["geojson","gis","polygonize","polygon","line","linestring"],"author":{"name":"Nicolas Cisco","email":"@nickcis"},"license":"MIT","bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"homepage":"https://github.com/nickcis/polygonize#readme","devDependencies":{"babel-cli":"^6.24.1","babel-preset-es2015":"^6.24.1","benchmark":"^2.1.4","eslint":"^3.19.0","eslint-config-mourner":"^2.0.1","load-json-file":"^2.0.0","tape":"^4.6.3","write-json-file":"^2.2.0"},"dependencies":{"@turf/envelope":"^4.3.0","@turf/helpers":"^4.3.0","@turf/inside":"^4.3.0","@turf/invariant":"^4.3.0","@turf/meta":"^4.3.0"},"gitHead":"27fb0b0ca0ac0f8bedc2ffc7fe35cb4116d4e8dc","_id":"polygonize@1.0.3","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"nickcis","email":"ncis20@gmail.com"},"dist":{"integrity":"sha512-dwGljV/tiHD818stpNVHSLH3sYJuyqivSZXINLMspCkTpUq9BAgmO0h0i/OpBAqfo1dxFcAOW3jQ9VJ40piwzA==","shasum":"26994d4789ac1d9ca0c0a4b0aedba89268330e8f","tarball":"https://registry.npmjs.org/polygonize/-/polygonize-1.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCG22TuyNpG6HVIgFNp1GqjcUU5AjUMo+OvqFXYqwrr9gIgTvtPqBM9qx91TztxwAGCsHbEKLOxhRBKrlJPgMPgDKw="}]},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.0.3.tgz_1503592211206_0.2071554441936314"}},"1.1.0":{"name":"polygonize","version":"1.1.0","description":"Javascript implementation of GEOS's Polygonize function","main":"cjs/index.js","module":"src/index.js","scripts":{"test":"npm run lint && npm run test-src && npm run bench","test-cjs":"npm run build-cjs && tape cjs/*.test.js cjs/test.js","test-src":"tape -r @std/esm src/*.test.js src/test.js","lint":"eslint .","prebuild":"rimraf cjs","build-cjs":"babel src --out-dir cjs","build":"npm run build-cjs","prepublishOnly":"npm run build","bench-src":"node -r @std/esm src/bench.js","bench-cjs":"node cjs/bench.js","bench":"npm run bench-src"},"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"keywords":["geojson","gis","polygonize","polygon","line","linestring"],"author":{"name":"Nicolas Cisco","email":"@nickcis"},"license":"MIT","bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"homepage":"https://github.com/nickcis/polygonize#readme","devDependencies":{"@std/esm":"^0.11.3","babel-cli":"^6.26.0","babel-plugin-add-module-exports":"^0.2.1","babel-preset-env":"^1.6.1","benchmark":"^2.1.4","eslint":"^3.19.0","eslint-config-mourner":"^2.0.1","load-json-file":"^2.0.0","rimraf":"^2.6.2","tape":"^4.6.3","write-json-file":"^2.2.0"},"dependencies":{"@turf/envelope":"*","@turf/helpers":"*","@turf/inside":"*","@turf/invariant":"*","@turf/meta":"*"},"@std/esm":{"esm":"js","cjs":true},"gitHead":"810b0f26464f1fef5af06e236633ca82d1be8b34","_id":"polygonize@1.1.0","_shasum":"a342e18f57351307c6c46f8c58997664333cc2da","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"nickcis","email":"ncis20@gmail.com"},"dist":{"shasum":"a342e18f57351307c6c46f8c58997664333cc2da","tarball":"https://registry.npmjs.org/polygonize/-/polygonize-1.1.0.tgz","integrity":"sha512-ArjPKg+acqgNPY6dR7ToF0cL88pc9+j5ljYVZ+E7mJzs9+vhHGpVGb2dI9eDvi/zAM55RADiEJy35WnUwxqd2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2dRUkSvULRRd6sPiZzDyKTNmtWVh4dGFZHwB1nSGI+AIgGkFO3mQPb3+AkyZkXqxhINAz+1rilhNv2xheQHrJYOw="}]},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.1.0.tgz_1508333508268_0.42909898748621345"}},"1.0.4":{"name":"polygonize","version":"1.0.4","description":"Javascript implementation of GEOS's Polygonize function","main":"cjs/index.js","module":"src/index.js","scripts":{"test":"npm run lint && npm run test-src && npm run bench","test-cjs":"npm run build-cjs && tape cjs/*.test.js cjs/test.js","test-src":"tape -r @std/esm src/*.test.js src/test.js","lint":"eslint .","prebuild":"rimraf cjs","build-cjs":"babel src --out-dir cjs","build":"npm run build-cjs","prepublishOnly":"npm run build","bench-src":"node -r @std/esm src/bench.js","bench-cjs":"node cjs/bench.js","bench":"npm run bench-src"},"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"keywords":["geojson","gis","polygonize","polygon","line","linestring"],"author":{"name":"Nicolas Cisco","email":"@nickcis"},"license":"MIT","bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"homepage":"https://github.com/nickcis/polygonize#readme","devDependencies":{"@std/esm":"^0.11.3","babel-cli":"^6.26.0","babel-plugin-add-module-exports":"^0.2.1","babel-preset-env":"^1.6.1","benchmark":"^2.1.4","eslint":"^3.19.0","eslint-config-mourner":"^2.0.1","load-json-file":"^2.0.0","rimraf":"^2.6.2","tape":"^4.6.3","write-json-file":"^2.2.0"},"dependencies":{"@turf/envelope":"*","@turf/helpers":"*","@turf/boolean-point-in-polygon":"*","@turf/invariant":"*","@turf/meta":"*"},"@std/esm":{"esm":"js","cjs":true},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2017 Nickcis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"polygonize@1.0.4","dist":{"shasum":"c553d4821c6bd37250acf9051998dc3bd2c41fad","tarball":"https://registry.npmjs.org/polygonize/-/polygonize-1.0.4.tgz","integrity":"sha512-4OO8b0P8++Jii+jqca+WVdqa/EMEOLKWqkDuMgHtpQ6X52SFJiyX4/Zv4jobGGsjlV78w3DokoPO3kma5522rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGfIBhbRC0RyE+4ElRyW1uH7//tsYlmOC/08MyGDqcLXAiBtUi7ZYxQT7TEtpvVsFThTZyja4wwlQZG1orKh4U57Fg=="}]},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmUser":{"name":"nickcis","email":"ncis20@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.0.4.tgz_1511488677529_0.5064589271787554"}}},"readme":"# Polygonize\n\n[![Build Status](https://travis-ci.org/NickCis/polygonize.svg?branch=master)](https://travis-ci.org/NickCis/polygonize)\n\nPolygonizes a set of Geometrys which contain linework that represents the edges of a planar graph. It's basically an implementation of [GEOS's Polygonizer](https://github.com/echoz/xlibspatialite/blob/master/geos/include/geos/operation/polygonize/Polygonizer.h).\n\nAlthough, the algorithm is the same as GEOS, it isn't a literal transcription of the C++ source code. It was rewriten in order to get a more javascript like code.\n\n## JSDoc\n\n```javascript\n/**\n * Polygonizes {@link LineString|(Multi)LineString(s)} into {@link Polygons}.\n *\n * Implementation of GEOSPolygonize function (`geos::operation::polygonize::Polygonizer`).\n *\n * Polygonizes a set of lines that represents edges in a planar graph. Edges must be correctly\n * noded, i.e., they must only meet at their endpoints.\n *\n * The implementation correctly handles:\n *\n * - Dangles: edges which have one or both ends which are not incident on another edge endpoint.\n * - Cut Edges (bridges): edges that are connected at both ends but which do not form part of a polygon.\n *\n * @name polygonize\n * @param {FeatureCollection|Geometry|Feature<LineString|MultiLineString>} geoJson Lines in order to polygonize\n * @returns {FeatureCollection<Polygon>} Polygons created\n * @throws {Error} if geoJson is invalid.\n */\n```\n\n## Example\n\nThis example is the test found in [`test/in/complex.geojson`](https://github.com/NickCis/polygonize/blob/master/test/in/complex.geojson).\n\n\n```javascript\nconst polygonize = require('polygonize'),\n    fs = require('fs'),\n    input = JSON.parse(fs.readFileSync('./test/in/complex.geojson'));\n\nconsole.log(JSON.stringify(polygonize(input)));\n```\n\nThe [input](https://github.com/NickCis/polygonize/blob/master/test/in/complex.geojson) as GeoJson LineString:\n\n![](https://cloud.githubusercontent.com/assets/174561/26525683/c30957de-4335-11e7-8eb9-bf72f268efb8.png)\n\nTurned into [polygons](https://github.com/NickCis/polygonize/blob/master/test/out/complex.geojson):\n\n![](https://cloud.githubusercontent.com/assets/174561/26525695/24f5270c-4336-11e7-9b62-60db8c0c9a28.png)\n\n\n## Documentation\n\nPolygonizes [(Multi)LineString(s)](http://geojson.org/geojson-spec.html#linestring) into [Polygons](Polygons).\n\nImplementation of GEOSPolygonize function (`geos::operation::polygonize::Polygonizer`).\n\nPolygonizes a set of lines that represents edges in a planar graph. Edges must be correctly noded, i.e., they must only meet at their endpoints.\n\nThe implementation correctly handles:\n\n-   Dangles: edges which have one or both ends which are not incident on another edge endpoint.\n-   Cut Edges (bridges): edges that are connected at both ends but which do not form part of a polygon.\n\n**Parameters**\n\n-   `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \\| [Geometry](http://geojson.org/geojson-spec.html#geometry) \\| [Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;([LineString](http://geojson.org/geojson-spec.html#linestring) \\| [MultiLineString](http://geojson.org/geojson-spec.html#multilinestring))>)** Lines in order to polygonize\n\n\n-   Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if geoJson is invalid.\n\nReturns **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)&lt;[Polygon](http://geojson.org/geojson-spec.html#polygon)>** Polygons created\n\n### Installation\n\nInstall this module individually:\n\n```sh\n$ npm install polygonize\n```\n","maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"time":{"modified":"2022-06-24T07:02:49.563Z","created":"2017-05-28T21:44:14.106Z","1.0.0":"2017-05-28T21:44:14.106Z","1.0.1":"2017-05-31T19:05:46.941Z","1.0.2":"2017-08-14T16:33:12.719Z","1.0.3":"2017-08-24T16:30:11.368Z","1.1.0":"2017-10-18T13:31:48.546Z","1.0.4":"2017-11-24T01:57:57.638Z"},"homepage":"https://github.com/nickcis/polygonize#readme","keywords":["geojson","gis","polygonize","polygon","line","linestring"],"repository":{"type":"git","url":"git://github.com/nickcis/polygonize.git"},"author":{"name":"Nicolas Cisco","email":"@nickcis"},"bugs":{"url":"https://github.com/nickcis/polygonize/issues"},"license":"MIT","readmeFilename":"README.md"}