Show all cycling paths on former railway lines on map.
Currently hosted at https://www.railtrailsmap.net
The map is composed of 2 layers:
- As base layer the standard OpenSteetMap map, served directly from OpenStreetmap
- As overlay a semi-transparent layer highlighting the rail trails.
The overlay map is served from static images.
This allows to:
- keep hosting costs down
- have less software running on the server, reducing complexity and attack surface
- run an immutable server
Because the RailTrail layer consists of mostly empty tiles, we can apply some optimizations:
We are rendering meta tiles, but serving plain PNG files.
Each meta tile is processed to determine whether its contained tiles are fully transparent or contain content. Only tiles with content are extracted and uploaded to the server.
The web server is configured to return a fully transparent default tile for any requested tile that is not available on the file system.
For zoom levels up to level 9, all meta tiles for the whole planet will be rendered. For zoom levels above that, only those tiles will be rendered where the corresponding tile on the lower zoom level was non-empty.
Build the container:
cd docker
docker build -t railtrails/railtrails
Check the instructions at the base docker container.
The style files are integrated into the container, they don't need to be passed at runtime.
To pregenerate the tiles, use the new generate parameter:
docker run --shm-size=512m -v osm-data:/data/database/ railtrails/railtrails generate
Tile generation is done by a docker container based on https://github.com/Overv/openstreetmap-tile-server