GSoC 2026: Closure-Aware Routing is Live
Posted by Venetis Charalampidis on 21 July 2026 in English.A quick update on where things stand after the first half of the coding period.
In my first post I mentioned three goals for the summer. The first one, adding a Valhalla-powered routing endpoint that genuinely avoids closed roads, is now done.
What I built
The platform already had road closure data in the database. What it was missing was any connection between that data and actual routing. The frontend was calling valhalla1.openstreetmap.de directly, with no awareness of the closures sitting in our own database.
I set up a self-hosted Valhalla instance (3.5.1) running in the project’s Docker stack, loaded with Switzerland OSM data. Then I built a backend endpoint, POST /api/v1/routing/closure-aware, that sits in front of Valhalla and does the work the frontend couldn’t do on its own:
- Fetches currently-active closures from the database that affect the requested transport mode (car, bicycle, or pedestrian)
- Buffers each closure geometry into an avoidance polygon. LineStrings get a 10m buffer, Points get 15m, Polygons are used as-is. The buffering uses per-centroid UTM reprojection so the radii are true metres anywhere
- Sends those polygons to Valhalla as
exclude_polygonsso the route detours around them - Returns the trip along with a count of how many closures were excluded
The frontend routing page now calls this endpoint instead of Valhalla directly, so closure avoidance happens server-side automatically.
Coverage
The self-hosted Valhalla currently covers Switzerland only. For routes outside Switzerland the frontend falls back to the public Valhalla instance without closure avoidance, which is fine for now since the platform is Swiss-focused.
Next up is the sidecar service that feeds active closures into Valhalla’s traffic tile system, the second item from my original list. More on that soon.
The code is on GitHub if you want to follow along.