Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Install Mapshaper
npm install -g mapshaper
# Install Tippecanoe
brew install tippecanoe
# Make a directory for your geojson files and convert all the shapefiles in a directory to geojson
mkdir ../geojson
for f in *.shp;
mapshaper $f -o format=geojson ../geojson/`basename $f .shp`.json;
# Convert the geojson files into MBTiles vector tiles
cd ../
tippecanoe -o vector.mbtiles -zg --drop-densest-as-needed geojson/*
# Provision a one-click Docker server instance on Digital Ocean and SSH into it
# Copy your MBTiles file to the root directory
# Start the tile server with
docker run --rm -it -v $(pwd):/data -p 80:80 klokantech/tileserver-gl vector.mbtiles --verbose
# All done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment