{"name":"@mapbox/tile-cover","version":"3.0.1","description":"generate the minimum number of tiles to cover a geojson geometry","main":"index.js","directories":{"test":"test"},"scripts":{"test":"eslint index.js && tape test/*.js","doc":"dox < index.js | doxme"},"repository":{"type":"git","url":"git+https://github.com/mapbox/tile-cover.git"},"keywords":["tile","cover","geojson","index"],"author":{"name":"morganherlocker"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/tile-cover/issues"},"homepage":"https://github.com/mapbox/tile-cover","devDependencies":{"benchmark":"^1.0.0","dox":"^0.8.0","doxme":"^1.8.2","eslint":"^1.3.1","tape":"^4.2.0","turf-area":"^1.1.1","turf-erase":"^1.3.2","turf-intersect":"1.4.2","turf-merge":"1.0.2"},"dependencies":{"tilebelt":"^1.0.1"},"gitHead":"42dc57ceac08c3eb8d7f4d6b0dd249de66d05335","_id":"@mapbox/tile-cover@3.0.1","_shasum":"ad0dbe69d02e4e9ff74bf228b3ee8fa533034210","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"aaronlidman","email":"aaronlidman@gmail.com"},"dist":{"shasum":"ad0dbe69d02e4e9ff74bf228b3ee8fa533034210","tarball":"http://registry-npm.ywwl.com/@mapbox/tile-cover/download/@mapbox/tile-cover-3.0.1.tgz","integrity":"sha512-R8aoFY/87HWBOL9E2eBqzOY2lpfWYXCcTNgBpIxAv67rqQeD4IfnHD0iPXg/Z1cqXrklegEYZCp/7ZR/RsWqBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2ALs7dY6dpeFbDxw/J1iDB1fHc1ux0qkgQHmCasPLUgIgLaBQIKS5tpw7GUBLRGBMs/ylcpmwaedPELqNs4lCXUA="}],"size":4772,"noattachment":false,"key":"/@mapbox/tile-cover/-/@mapbox/tile-cover-3.0.1.tgz"},"maintainers":[{"name":"aaronlidman","email":"aaronlidman@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tile-cover-3.0.1.tgz_1486435558475_0.1992731005884707"},"readme":"tile-cover\n==========\n\n[![Build Status](https://travis-ci.org/mapbox/tile-cover.svg?branch=master)](https://travis-ci.org/mapbox/tile-cover)\n\nGenerate the minimum number of tiles to cover a [GeoJSON Geometry](http://geojson.org/geojson-spec.html#geometry-objects).\n\n### Install\n\n```bash\nnpm install @mapbox/tile-cover\n```\n\n### Usage\n\n```js\nvar cover = require('@mapbox/tile-cover');\nvar poly = JSON.parse(fs.readFileSync('./poly.geojson'));\nvar limits = {\n  \tmin_zoom: 4,\n  \tmax_zoom: 9\n};\n\ncover.geojson(poly.geom, limits);\ncover.tiles(poly.geom, limits);\ncover.indexes(poly.geom, limits);\n```\n\n# API\n\n## geojson(geom, limits)\n\nGiven a [geometry](http://geojson.org/geojson-spec.html#geometry-objects), create cells and return them in a format easily readable by any software that reads GeoJSON.\n\n* `geom` (`Object`): GeoJSON geometry\n* `limits` (`Object`): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.\n\n**Returns** `Object`, FeatureCollection of cells formatted as GeoJSON Features\n## tiles(geom, limits)\n\nGiven a [geometry](http://geojson.org/geojson-spec.html#geometry-objects), create cells and return them in their raw form, as an array of cell identifiers.\n\n* `geom` (`Object`): GeoJSON geometry\n* `limits` (`Object`): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.\n\n**Returns** `Array.<Array.<number>>`, An array of tiles given as [x, y, z] arrays\n## indexes(geom, limits)\n\nGiven a [geometry](http://geojson.org/geojson-spec.html#geometry-objects), create cells and return them as quadkey indexes.\n\n* `geom` (`Object`): GeoJSON geometry\n* `limits` (`Object`): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.\n\n**Returns** `Array.<String>`, An array of tiles given as quadkeys.\n\n### Tests\n\n```bash\nnpm test\n```\n\n### Benchmarks\n\n```bash\nnode bench.js\n```\n\n### Examples\n\n##### Polygons:\n\n![img](https://dl.dropbox.com/s/48cj16fvt8nyh3o/Screenshot%202014-08-06%2013.34.12.png)\n\n##### Lines:\n\n![img](https://dl.dropbox.com/s/u32bq56adqwhpyy/Screenshot%202014-08-06%2013.30.31.png)\n\n##### Points:\n\n![img](https://dl.dropbox.com/s/7kkmmm8owg1ezb0/Screenshot%202014-08-06%2014.02.01.png)\n","publish_time":1486435560394,"_cnpm_publish_time":1486435560394,"dist-tags":{"latest":"3.0.2"}}