{"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":"http://registry-npm.ywwl.com/polygonize/download/polygonize-1.0.1.tgz","integrity":"sha512-vVkeF4ju+QEuutzMwnt4t1oGt8CbbfyszSU2t+UTzupfsOFH3IWTINHuY2+Lwz4D+SufwlLIJwHd5XdxMO9XDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1xcTTgEXsOyk2B2KH4kvgXxsj1dFqV2DxE9CsktIL1AiBgONHboAsdlvsXsivgt914qlT39TodG1IA/5z+N6HDRg=="}],"size":32708,"noattachment":false,"key":"/polygonize/-/polygonize-1.0.1.tgz"},"maintainers":[{"name":"nickcis","email":"ncis20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polygonize-1.0.1.tgz_1496257546834_0.5544098301324993"},"directories":{},"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","publish_time":1496257546941,"_cnpm_publish_time":1496257546941,"dist-tags":{"latest":"1.0.4"}}