Create a gist now

Instantly share code, notes, and snippets.

Embed
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;
do
mapshaper $f -o format=geojson ../geojson/`basename $f .shp`.json;
done
# 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