3.0.1 • Published 9 years ago

tile-cover v3.0.1

Weekly downloads
757
License
MIT
Repository
github
Last release
9 years ago

tile-cover

Build Status

generate the minimum number of tiles to cover a geojson geometry

Install

npm install tile-cover

Usage

var poly = JSON.parse(fs.readFileSync('./poly.geojson'));
var limits = {
  	min_zoom: 4,
  	max_zoom: 9
  }

cover.geojson(poly.geom, limits);
cover.tiles(poly.geom, limits);
cover.indexes(poly.geom, limits);

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 geometry
  • limits (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 geometry
  • limits (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 geometry
  • limits (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 test

Benchmarks

node bench.js

Examples

Polygons:

img

Lines:

img

Points:

img

3.0.1

9 years ago

3.0.0

9 years ago

2.4.1

9 years ago

2.4.0

9 years ago

2.3.1

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.6.4

10 years ago

0.6.3

10 years ago

0.6.2

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago