Build vector tilesets from large collections of GeoJSON features.
Go to file
2014-10-06 10:55:40 -07:00
clip.c Clip large LineString features down to the bounds of the tile 2014-09-26 17:07:52 -07:00
clip.h Clipping code from datamaps 2014-09-26 16:35:18 -07:00
geojson.c Improve error reporting 2014-10-06 10:55:40 -07:00
jsonpull.c Preserve the original string representation of numbers too. 2014-02-26 17:01:30 -08:00
jsonpull.h Clean up after errors and fix related bugs: 2014-02-08 09:31:49 -08:00
LICENSE.md Add license 2014-02-08 10:33:57 -08:00
Makefile Move mbtiles code to its own source file 2014-09-29 12:48:58 -07:00
mbtiles.c Fix more (small) memory leaks 2014-10-01 10:33:22 -07:00
mbtiles.h Move mbtiles code to its own source file 2014-09-29 12:48:58 -07:00
pool.c Fix more (small) memory leaks 2014-10-01 10:33:22 -07:00
pool.h Fix more (small) memory leaks 2014-10-01 10:33:22 -07:00
README.md Coalesce geometries of features with the same attributes 2014-09-29 15:33:14 -07:00
tile.cc Clip polygons to just outside the tile boundary 2014-10-03 16:33:22 -07:00
tile.h Give the constant pool its own source file 2014-09-29 12:17:35 -07:00
vector_tile.proto Add vector tile boilerplate 2014-09-22 10:45:34 -07:00

tippecanoe

Build vector tilesets from large collections of GeoJSON features.

Usage

tippecanoe -o file.mbtiles [file.json]

If the file is not specified, it reads GeoJSON from the standard input.

The GeoJSON features need not be wrapped in a FeatureCollection. You can concatenate multiple GeoJSON features or files together, and it will parse out the features and ignore whatever other objects it encounters.

Options

  • -l Layer name (default "file" if source is file.json)
  • -n Human-readable name (default file.json)
  • -z Base zoom level (default 14)
  • -Z Lowest zoom level (default 0)
  • -d Detail at base zoom level (default 12, for tile resolution of 4096)
  • -D Detail at lower zoom levels (default 10, for tile resolution of 1024)
  • -x Property (removes the named properties from all features)
  • -f Force: Delete existing mbtiles file if it already exists.

Example

tippecanoe -o alameda.mbtiles -l alameda -n "Alameda County from TIGER" -z13 tl_2014_06001_roads.json

cat tiger/tl_2014_*_roads.json | tippecanoe -o tiger.mbtiles -l roads -n "All TIGER roads, one zoom" -z12 -Z12 -d14 -x LINEARID -x RTTYP

Geometric simplifications

At every zoom level, line and polygon features are subjected to Douglas-Peucker simplification to the resolution of the tile.

For point features, it drops 1/2.5 of the dots for each zoom level above the base. I don't know why 2.5 is the appropriate number, but the densities of many different data sets fall off at about this same rate.

For line features, it drops any features that are too small to draw at all. This still leaves the lower zooms too dark (and too dense for the 500K tile limit, in some places), so I need to figure out an equitable way to throw features away.

It also throws away any polygons that are too small to draw. I'm not sure yet if it is appropriate to do more than that.

Features in the same tile that share the same type and attributes are coalesced together into a single geometry.

Development

Requires protoc (brew install protobuf or apt-get install libprotobuf-dev), and sqlite3 (apt-get install libsqlite3-dev). To build:

make

and perhaps

make install