Skip to content

Instantly share code, notes, and snippets.

@aaronpdennis
Last active August 29, 2015 14:26
Show Gist options
  • Save aaronpdennis/4e6464e56a3355a23eb8 to your computer and use it in GitHub Desktop.
Save aaronpdennis/4e6464e56a3355a23eb8 to your computer and use it in GitHub Desktop.

To generate an MBTiles file with PNG image map tiles from the Humanitarian Data Model style, follow this steps (on Mac OS X).

Part 1:

Use this workflow to generate a vector tile based map in Mapbox Studio from an osm.pbf file. https://gist.github.com/aaronpdennis/a53f9afb8ef24d499e96

Part 2:

Install tl.

npm install tl mbtiles tilelive-http tilelive tilejson

Generate a MBTiles file using the hdm-style.tm2 from Part 1. Adjust your bounding box -b (WSEN), min zoom -z, and max zoom -Z to your area.

tl copy 
  -z 6 -Z 8 -b "-124.4096 32.5343 -114.1308 42.0095" \
  tmstyle://./hdm-style.tm2/ mbtiles://./tiles.mbtiles

This will output an MBTiles file that contains static PNG map tiles. You can upload this MBTiles file to Mapbox's hosting services at https://www.mapbox.com/uploads/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment