The goal of this project is to render geojson and json meta data from S57 nautical chart files suitable for input to tippecanoe which transforms the data into MVT / MBTiles.
We will then serve the data with tileserver-gl and work on styling the chart with maputnik.
Note: This project is still very much a WORK IN PROGRESS.
# Process and convert s57 ENC data locally or in a docker container
cargo run -- mbtiles -i $(pwd)/data/charts/US5WA22M/US5WA22M.000 -o $(pwd)/data -n LNDARE,DEPARE,SEAARE,SLCONS,PONTON,HULKES,SOUNDG,BOYSPP
cargo run -- config -o $(pwd)/data -s localhost:8080,127.0.0.1:8080
cargo run -- style -o $(pwd)/data/styles -s 127.0.0.1:8080
# OR
docker build -t s57t .
docker run --rm -v $(pwd)/data:/data s57t s57tiler mbtiles -i /data/charts/US5WA22M/US5WA22M.000 -o /data -n LNDARE,DEPARE,SEAARE,SLCONS,PONTON,HULKES,SOUNDG,BOYSPP
docker run --rm -v $(pwd)/data:/data s57t s57tiler config -s localhost:8080,127.0.0.1:8080 -o /data
docker run --rm -v $(pwd)/data/styles:/styles s57t s57tiler style -s 127.0.0.1:8080 -o /styles
# Serve up the rendered marine chart / map
docker run --rm -v $(pwd)/data:/data -p 8080:8080 maptiler/tileserver-gl
# Optionally fire up maputnik to work on styling
docker run -it --rm -p 8888:8888 maputnik/editor
US5WA22M rendered with tileserver-gl
You can find a live demo here: https://s57dev.mxmariner.com/styles/day_bright_style/#14/47.27888/-122.41757
Un-styled | Styled (WIP) |
---|---|
In order to run this locally you'll need system gdal installed as well as tippecanoe. And of course since this is rust you'll need to follow the rustup guide.
MacOS
brew install gdal tippecanoe
Linux
apt install -y libgdal-dev
git clone https://github.com/mapbox/tippecanoe.git && \
cd tippecanoe && \
make
sudo cp /tippecanoe/tippecanoe /usr/local/bin/tippecanoe
sudo cp /tippecanoe/tile-join /usr/local/bin/tile-join
sudo cp /tippecanoe/tippecanoe-decode /usr/local/bin/tippecanoe-decode
sudo cp /tippecanoe/tippecanoe-enumerate /usr/local/bin/tippecanoe-enumerate
sudo cp /tippecanoe/tippecanoe-json-tool /usr/local/bin/tippecanoe-json-tool