azavea / tilertwo

Publish static vector tile sets to S3 from GeoJSON with a single command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tiler Two

This repository contains a Docker image that can be used to take a GeoJson file or directory of line-delimited GeoJson and generate a static vector tile set from it, using almost any combination of available Tippecanoe options.

If you're not sure about which of the extensive Tippecanoe options to try first, a good default for most datasets is:

--drop-densest-as-needed -zg --hilbert

First, ensure Docker and Docker Compose 3.0+ are installed. Then build the container with:

docker-compose build

For complete documentation, run docker-compose run --rm tiler-two --help

Examples

Only generate an mbtiles file using relative paths

The mbtiles file will be placed in the root of the mounted data volume.

docker-compose run --rm -v $(pwd)/sample-data:/data tiler-two \
    file:///data/ne_110m_admin_0_countries.geojson \
    file:///data/tiles/ne_110m_admin_0_countries \
    --no-clean \
    --skip-export \
    --tmp /data \
    --tippecanoe-opts "-l ne_110m_admin0 --drop-densest-as-needed -z14"

Export tiles to S3 from a local geojson file

AWS_PROFILE='<profile>' docker-compose run --rm \
    -v $(pwd)/sample-data:/data tiler-two \
    file:///data/ne_110m_admin_0_countries.geojson \
    s3://bucket/path/to/tiles/ne_110m_admin_0_countries \
    --tippecanoe-opts "--drop-densest-as-needed -zg --coalesce --reorder --hilbert"

Environment Variables

AWS_PROFILE

If you're exporting tiles to S3, set this and mount your ~/.aws directory to /home/tilertwo/.aws in the container.

If you run the container with the included docker-compose script, the aws directory mount is handled for you.

TIPPECANOE_VERSION

Defaults to 1.34.3. Update this and rebuild the image if you'd prefer to install a different version of Tippecanoe.

About

Publish static vector tile sets to S3 from GeoJSON with a single command

License:Apache License 2.0


Languages

Language:Python 88.0%Language:Dockerfile 12.0%