百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

tippecanoe

> 编程语言
开源

从大型 GeoJSON 特征集中构建向量图像集。

3.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

从大型 GeoJSON 特征集中构建向量图像集。

tippecanoe

Note: there is an active fork of this project over at https://github.com/felt/tippecanoe

Builds vector tilesets from large (or small) collections of GeoJSON, Geobuf, or CSV features, like these.

:zap: Mapbox has a new service for creating vector tilesets! :zap:

Mapbox Tiling Service (MTS) is a hosted, data processing service that allows you to integrate custom datasets of any scale into your maps faster, cheaper, and with more flexibility and control than previously possible.

MTS is the same service we use internally to create our global, daily updating basemap product Mapbox Streets, which serves over 650 million monthly active users and customers such as Facebook, Snap, the Weather Channel, Tableau, and Shopify.

MTS creates and updates data using distributed and parallelized processing, meaning data is processed much more quickly than is possible with a standard, single server setup with comparable tools. For example, a global basemap at 30cm precision (max zoom of 16) can be processed in under 2 hours with MTS, whereas a comparable workload would take multiple days to process on a single server.

Customers like AllTrails, Plume Labs, and Ookla have noted that MTS helps them:

  • build applications faster by focusing more on app development, not infrastructure
  • build more compelling user experiences that drive better user engagement
  • get updated data to their users faster—in some cases up to 90% faster than previous tools

Learn more about MTS.

Intent

The goal of Tippecanoe is to enable making a scale-independent view of your data, so that at any level from the entire world to a single building, you can see the density and texture of the data rather than a simplification from dropping supposedly unimportant features or clustering or aggregating them.

If you give it all of OpenStreetMap and zoom out, it should give you back something that looks like "All Streets" rather than something that looks like an Interstate road atlas.

If you give it all the building footprints in Los Angeles and zoom out far enough that most individual buildings are no longer discernable, you should still be able to see the extent and variety of development in every neighborhood, not just the largest downtown buildings.

If you give it a collection of years of tweet locations, you should be able to see the shape and relative popularity of every point of interest and every significant travel corridor.

Installation

The easiest way to install tippecanoe on OSX is with Homebrew:

bash
$ brew install tippecanoe

On Ubuntu it will usually be easiest to build from the source repository:

bash
$ git clone https://github.com/mapbox/tippecanoe.git
$ cd tippecanoe
$ make -j
$ make install

See Development below for how to upgrade your C++ compiler or install prerequisite packages if you get compiler errors.

Usage

bash
$ tippecanoe -o file.mbtiles [options] [file.json file.json.gz file.geobuf ...]

If no files are specified, it reads GeoJSON from the standard input. If multiple files are specified, each is placed in its own layer.

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.

Try this first

If you aren't sure what options to use, try this:

bash
$ tippecanoe -zg -o out.mbtiles --drop-densest-as-needed in.geojson

The -zg option will make Tippecanoe choose a maximum zoom level that should be high enough to reflect the precision of the original data. (If it turns out still not to be as detailed as you want, use -z manually with a higher number.)

If the tiles come out too big, the --drop-densest-as-needed option will make Tippecanoe try dropping what should be the least visible features at each zoom level. (If it drops too many features, use -x to leave out some feature attributes that you didn't really need.)

Examples

Create a tileset of TIGER roads for Alameda County, to zoom level 13, with a custom layer name and description:

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

Create a tileset of all TIGER roads, at only zoom level 12, but with higher detail than normal, with a custom layer name and description, and leaving out the LINEARID and RTTYP attributes:

$ 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

Cookbook

Linear features (world railroads), visible at all zoom levels

bash
curl -L -O https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_railroads.zip
unzip ne_10m_railroads.zip
ogr2ogr -f GeoJSON ne_10m_railroads.geojson ne_10m_railroads.shp

tippecanoe -zg -o ne_10m_railroads.mbtiles --drop-densest-as-needed --extend-zooms-if-still-dropping ne_10m_railroads.geojson
  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • --drop-densest-as-needed: If the tiles are too big at low zoom levels, drop the least-visible features to allow tiles to be created with those features that remain
  • --extend-zooms-if-still-dropping: If even the tiles at high zoom levels are too big, keep adding zoom levels until one is reached that can represent all the features

Discontinuous polygon features (buildings of Rhode Island), visible at all zoom levels

bash
curl -L -O https://usbuildingdata.blob.core.windows.net/usbuildings-v1-1/RhodeIsland.zip
unzip RhodeIsland.zip

tippecanoe -zg -o RhodeIsland.mbtiles --drop-densest-as-needed --extend-zooms-if-still-dropping RhodeIsland.geojson
  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • --drop-densest-as-needed: If the tiles are too big at low or medium zoom levels, drop the least-visible features to allow tiles to be created with those features that remain
  • --extend-zooms-if-still-dropping: If even the tiles at high zoom levels are too big, keep adding zoom levels until one is reached that can represent all the features

Continuous polygon features (states and provinces), visible at all zoom levels

bash
curl -L -O https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip
unzip -o ne_10m_admin_1_states_provinces.zip
ogr2ogr -f GeoJSON ne_10m_admin_1_states_provinces.geojson ne_10m_admin_1_states_provinces.shp

tippecanoe -zg -o ne_10m_admin_1_states_provinces.mbtiles --coalesce-densest-as-needed --extend-zooms-if-still-dropping ne_10m_admin_1_states_provinces.geojson
  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • --coalesce-densest-as-needed: If the tiles are too big at low or medium zoom levels, merge as many features together as are necessary to allow tiles to be created with those features that are still distinguished
  • --extend-zooms-if-still-dropping: If even the tiles at high zoom levels are too big, keep adding zoom levels until one is reached that can represent all the features

Large point dataset (GPS bus locations), for visualization at all zoom levels

bash
curl -L -O ftp://avl-data.sfmta.com/avl_data/avl_raw/sfmtaAVLRawData01012013.csv
sed 's/PREDICTABLE.*/PREDICTABLE/' sfmtaAVLRawData01012013.csv > sfmta.csv
tippecanoe -zg -o sfmta.mbtiles --drop-densest-as-needed --extend-zooms-if-still-dropping sfmta.csv

(The sed line is to clean the corrupt CSV header, which contains the wrong number of fields.)

  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • --drop-densest-as-needed: If the tiles are too big at low or medium zoom levels, drop the least-visible features to allow tiles to be created with those features that remain
  • --extend-zooms-if-still-dropping: If even the tiles at high zoom levels are too big, keep adding zoom levels until one is reached that can represent all the features

Clustered points (world cities), summing the clustered population, visible at all zoom levels

bash
curl -L -O https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip
unzip -o ne_10m_populated_places.zip
ogr2ogr -f GeoJSON ne_10m_populated_places.geojson ne_10m_populated_places.shp

tippecanoe -zg -o ne_10m_populated_places.mbtiles -r1 --cluster-distance=10 --accumulate-attribute=POP_MAX:sum ne_10m_populated_places.geojson
  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • -r1: Do not automatically drop a fraction of points at low zoom levels, since clustering will be used instead
  • --cluster-distance=10: Cluster together features that are closer than about 10 pixels from each other
  • --accumulate-attribute=POP_MAX:sum: Sum the POP_MAX (population) attribute in features that are clustered together. Other attributes will be arbitrarily taken from the first feature in the cluster.

Show countries at low zoom levels but states at higher zoom levels

…

Countries:

  • -z3: Only generate zoom levels 0 through 3
  • --coalesce-densest-as-needed: If the tiles are too big at low or medium zoom levels, merge as many features together as are necessary to allow tiles to be created with those features that are still distinguished

States and Provinces:

  • -Z4: Only generate zoom levels 4 and beyond
  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • --coalesce-densest-as-needed: If the tiles are too big at low or medium zoom levels, merge as many features together as are necessary to allow tiles to be created with those features that are still distinguished
  • --extend-zooms-if-still-dropping: If even the tiles at high zoom levels are too big, keep adding zoom levels until one is reached that can represent all the features

Represent multiple sources (Illinois and Indiana counties) as separate layers

bash
curl -L -O https://www2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/tl_2010_17_county10.zip
unzip tl_2010_17_county10.zip
ogr2ogr -f GeoJSON tl_2010_17_county10.geojson tl_2010_17_county10.shp

curl -L -O https://www2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/tl_2010_18_county10.zip
unzip tl_2010_18_county10.zip
ogr2ogr -f GeoJSON tl_2010_18_county10.geojson tl_2010_18_county10.shp

tippecanoe -zg -o counties-separate.mbtiles --coalesce-densest-as-needed --extend-zooms-if-still-dropping tl_2010_17_county10.geojson tl_2010_18_county10.geojson
  • -zg: Automatically choose a maxzoom that should be sufficient to clearly distinguish the features and the detail within each feature
  • --coalesce-densest-as-needed: If the tiles are too big at low or medium zoom levels, merge as many features together as are necessary to allow tiles to be created with those features that are still distinguished
  • --extend-zooms-if-still-dropping: If even the tiles at high zoom levels are too big, keep adding zoom levels until one is reached that can represent all the features

Merge multiple sources (Illinois and Indiana counties) into the same layer

bash
curl -

Issues· 217 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++c-plus-plusgeojsonvector-tiles

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言