Giter Site home page Giter Site logo

azavea / tilertwo Goto Github PK

View Code? Open in Web Editor NEW
5.0 13.0 1.0 182 KB

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

License: Apache License 2.0

Dockerfile 12.04% Python 87.96%
tippecanoe vector-tiles mb-util docker geojson mvt mbtiles export-tiles

tilertwo's Introduction

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.

tilertwo's People

Contributors

cloudniner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cuulee

tilertwo's Issues

Add AWS S3 copy command to README

Users who have generated a local XYZ tileset might want to just publish their local tileset to S3 without rerunning Tippecanoe or mbutil.

We should include either the command to run in the README or add a new option that allows users to skip Tippecanoe+mbutil.

Its easy to miss required magiks on the S3 copy command and end up with an unusable tileset in S3. The command is:

aws s3 cp \
  ./path/to/local/tile/dir \
  s3://bucket/key/prefix/ \
  --recursive \
  --acl public-read \
  --content-encoding gzip

Support generating multiple vector tile sets in one pass

Sometimes we have multiple geojson files and want to generate multiple mbtiles with different tippecanoe options, concatenate them with tile-join and then export tiles with mb-util.

For now, users can just start a container and run all of their commands manually within the container while a data volume is mounted, but this doesn't really help reuse or work for automated pipelines.

Develop a proposal for how to handle this use case and integrate it into the tilertwo.py script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.