Our technology
Open Source Software
We give a detailed account of where we got the map material and the other data from. A project like this would have been impossible without open source software components. Those deserve credit too. And perhaps you are also curious how we built this. So here is a brief software architecture document. We know that with unlimited resources a much nicer architecture is possible. Still, we are proud of what we have set up with very limited resources.
The Database
We use a slightly modified variant of the Switch to OSM example project. The main difference is that, to keep the installation maintainable, we run the processes in Docker containers. The maintenance of the database and the tile server each run in a separate container. This keeps the OpenStreetMap specific dependencies inside the containers, and the whole can run on a bare server. The other software components run in Docker containers as well, by the way. The PostgreSQL 15 database engine runs on the Docker host, which acts as the database server. That is because it is much cheaper than using a separate database server.
The database is an ordinary osm2pgsql database of Europe. Because it must also deliver the tiles for the website, the coordinates are in the WebMercator projection. In addition to the standard osm2pgsql tables, we keep track of the properties of the relations and their bounding boxes. (With an SQL script that we run after the OpenStreetMap updates.) We need that information to show the (hiking) routes. To search better by name, we put standard Postgres trigram indexes on the name columns of the osm2pgsql database. That makes updating the database somewhat slower, but searching much faster.
Tile Server
For the website we run an ordinary OpenStreetMap tile server. (Apache, mod_tile, renderd, mapnik.) Because of the speed (slowness) of the updates by renderd, we limited the deepest zoom level to 13. The Tile Server runs in a Docker container behind an Apache reverse proxy.
Feature Server
For searching on the website we developed a Feature Server. Functionally it is somewhat related to a WFS server, but all the details are different. The query language is based on CSS selectors. That is because an earlier version was inspired by the Overpass server. The queries are run on the osm2pgsql database, and the answers are always a FeatureCollection in GeoJSON format. This is an ad-hoc Java software component based on Spring Boot, JAX-RS, Java Topology Suite (JTS), a little GeoTools, plain JDBC, PostGIS and PostgreSQL. (Standard persistence frameworks are not very suitable for ad-hoc geographic queries.) To write GeoJSON we developed a Jackson module that is neatly picked up through the Service Provider Interface. The Feature Server runs in a Docker container behind an Apache reverse proxy.
Map Server
We draw the maps with a Map Server developed especially for that purpose. Unlike a WMS server, it does not produce tiles for the web browser, but whole maps in PDF or SVG format. To make a map, the Map Server combines the route data from the OpenStreetMap database with a background map it draws itself. The Map Server is an ad-hoc Java software component based on Spring Boot 4, JAX-RS, Java Topology Suite (JTS), GeoTools, OpenHtmlToPDF, PDFBox, PDFBoxGraphics2D and our own Feature Server. We derive contour lines, spot heights and hill shading directly from the Sonny's LiDAR Digital Terrain Models of Europe data. The Map Server runs in a Docker container behind an Apache reverse proxy.
Orders
The Orders component is a dull administrative ad-hoc Java software component with a Back-End based on Spring Boot 4, JAX-RS, Thymeleaf, OpenHtmlToPDF, PDFBox, MyBatis, PostgreSQL, Java Mail and the Mollie payments Java API. The Orders component handles the orders, and has the Map Server make a PDF map that can be downloaded. The customer receives an email with an invoice and download links to the PDF map and the invoice. The Orders component runs in a Docker container behind an Apache reverse proxy.
The Front-End of the orders component is part of the Angular Front-End Web Application.
Web Application
The Web Application is a Single Page web application based on Angular 22, Bootstrap 5, OpenLayers, GeoJSON and proj4js. All communication of the Web Application passes through an Apache web server, which also serves as a reverse proxy for the other components.
Web Server
We run an Apache web server in a Docker container. All HTTP(S) traffic ends up there. This is to feel safer: someone who manages to break into the web server breaks into a cage. To reach the rest of the world, they must also break out of the container to the host. The Web Server gives access to the static Angular application and the file downloads. Furthermore, as a reverse proxy, it passes all calls on to the other components. The HTTPS certificate is managed with Let's Encrypt. The standard Let's Encrypt certbot distribution comes as a snap. Those don't work well in containers. So we use the basic version.
Setup
The whole runs on Debian Linux 12 (bookworm) on a sizeable VPS. (16 cores, 48GB RAM, 1.5TB SSD). The Docker container images are based on debian:bookworm-slim. That could be more economical. We chose Debian because the OpenStreetMap components are included in it as standard. And it also feels safe to run the same OS in all containers. Performance is satisfactory, but it could be better. That is mainly because the SSD is somewhat slow for the database. To finish drawing the OpenStreetMap tiles for the web application in time, we limited the zoom level to 13.
The whole is a systemd service that does little more than call docker-compose to start the various (stateless) containers. Updating the osm2pgsql database and redrawing the tiles is started on the host by a cron job. The processes themselves run in the database and tile server Docker containers.