Last active
August 28, 2022 08:16
-
-
Save davidheyman/ce14f17caf2ab6add3c70a881f06b4ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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