Skip to content

ValHaris/RailTrailsMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Idea

Show all cycling paths on former railway lines on map.

Currently hosted at https://www.railtrailsmap.net

Concept

The map is composed of 2 layers:

  1. As base layer the standard OpenSteetMap map, served directly from OpenStreetmap
  2. 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:

Serving 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.

Rendering optimizations

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.

Usage

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

Implementation

Tile generation is done by a docker container based on https://github.com/Overv/openstreetmap-tile-server

References:

About

An OpenStreetMap based map showing rail trails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published