Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@davidheyman
Last active August 28, 2022 08:16
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidheyman/ce14f17caf2ab6add3c70a881f06b4ae to your computer and use it in GitHub Desktop.
Save davidheyman/ce14f17caf2ab6add3c70a881f06b4ae to your computer and use it in GitHub Desktop.
# 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