tippecanoe/README.md

77 lines
3.0 KiB
Markdown
Raw Normal View History

tippecanoe
==========
2014-02-08 00:25:54 +00:00
Build vector tilesets from large collections of GeoJSON features.
2014-02-08 00:25:54 +00:00
Usage
2014-02-08 00:25:54 +00:00
-----
tippecanoe -o file.mbtiles [file.json]
2014-02-08 02:11:36 +00:00
If the file is not specified, it reads GeoJSON from the standard input.
2014-02-08 02:11:36 +00:00
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
2014-02-08 17:57:55 +00:00
-------
* -l <i>name</i>: Layer name (default "file" if source is file.json)
* -n <i>name</i>: Human-readable name (default file.json)
* -z <i>zoom</i>: Base zoom level (default 14)
* -Z <i>zoom</i>: Lowest zoom level (default 0)
* -d <i>detail</i>: Detail at base zoom level (default 12, for tile resolution of 4096)
* -D <i>detail</i>: Detail at lower zoom levels (default 10, for tile resolution of 1024)
2014-10-10 00:26:16 +00:00
* -x <i>name</i>: Exclude the named properties from all features
* -X: Exclude all properties and encode only geometries
* -f: Delete the mbtiles file if it already exists instead of giving an error
* -r <i>rate</i>: Rate at which dots are dropped at lower zoom levels (default 2.5)
* -b <i>pixels</i>: Buffer size where features are duplicated from adjacent tiles (default 5)
2014-02-08 17:57:55 +00:00
Example
-------
2014-02-08 02:11:36 +00:00
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
2014-02-08 18:45:25 +00:00
Geometric simplifications
-------------------------
2014-02-08 18:45:25 +00:00
2014-09-26 22:27:20 +00:00
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.
2014-09-26 22:20:08 +00:00
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. You can use -r to specify a different rate.
2014-02-08 18:45:25 +00:00
For line features, it drops any features that are too small to draw at all.
2014-09-26 22:36:41 +00:00
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.
2014-02-08 18:45:25 +00:00
Any polygons that are smaller than a minimum area (currently 9 square subpixels) will
have their probability diffused, so that some of them will be drawn as a square of
this minimum size and others will not be drawn at all, preserving the total area that
all of them should have had together.
2014-09-26 21:51:19 +00:00
Features in the same tile that share the same type and attributes are coalesced
together into a single geometry. You are strongly encouraged to use -x to exclude
any unnecessary properties to reduce wasted file size.
If a tile is larger than 500K, it will try encoding that tile at progressively
lower resolutions before failing if it still doesn't fit.
2014-09-26 21:51:19 +00:00
Development
-----------
Requires protoc (brew install protobuf or apt-get install libprotobuf-dev),
and sqlite3 (apt-get install libsqlite3-dev). To build:
2014-09-26 21:51:19 +00:00
make
2014-09-26 22:20:08 +00:00
and perhaps
make install