Share your code.
This package has been deprecated
Author message:
This module has moved: please install @mapbox/tile-cover insteadtile-cover
tile-cover
generate the minimum number of tiles to cover a geojson geometry
Install
npm install tile-coverUsage
var poly = JSON;var limits = min_zoom: 4 max_zoom: 9 cover;cover;cover;API
geojson(geom, limits)
Given a geometry, create cells and return them in a format easily readable by any software that reads GeoJSON.
geom(Object): GeoJSON geometrylimits(Object): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.
Returns Object, FeatureCollection of cells formatted as GeoJSON Features
tiles(geom, limits)
Given a geometry, create cells and return them in their raw form, as an array of cell identifiers.
geom(Object): GeoJSON geometrylimits(Object): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.
Returns Array.<Array.<number>>, An array of tiles given as [x, y, z] arrays
indexes(geom, limits)
Given a geometry, create cells and return them as quadkey indexes.
geom(Object): GeoJSON geometrylimits(Object): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.
Returns Array.<String>, An array of tiles given as quadkeys.
Tests
npm testBenchmarks
node bench.jsExamples
Polygons:

Lines:

Points:
