OpenStreetMap logo OpenStreetMap

Midterm Update: Temporary Road Closures Database and API - GSOC 2025

Posted by Archit Rathod on 1 August 2025 in English. Last updated on 14 August 2025.

GSoC 2025 Midterm Update: Temporary Road Closures Database and API

Project Overview

I’m excited to share the midterm progress on my Google Summer of Code 2025 project: Temporary Road Closures Database and API for OpenStreetMap. This project aims to create a centralized platform where users can submit and retrieve real-time information about temporary road closures, enabling OSM-based navigation apps to provide better routing around construction, accidents, and other events.

  • Mentor: Simon Poole and Ian Wagner
  • Organization: OpenStreetMap
  • Project Duration: 12 weeks (175 hours)

🎉 Midterm Evaluation Status: PASSED

I’m thrilled to announce that I’ve successfully passed the midterm evaluation! The project is progressing well and is currently on schedule with several components ahead of the original timeline.

Progress Summary

Completed Components (Weeks 1-8)

1. Geospatial Database & Core Infrastructure

  • PostgreSQL + PostGIS setup with Docker containerization
  • SQLAlchemy models for Users and Closures with spatial geometry support
  • Database initialization scripts and sample data loading
  • PostGIS spatial indexing for efficient geospatial queries

2. RESTful API Service (FastAPI)

  • Complete CRUD operations for road closures
  • Spatial query endpoints supporting bounding box and coordinate-based filtering
  • Authentication & Authorization with JWT tokens and OAuth2
  • Input validation and error handling
  • Swagger UI documentation with integrated authentication

3. OpenLR Integration

  • OpenLR encoding/decoding service integrated into the API
  • Location referencing endpoints for map-agnostic road segment encoding
  • Validation endpoints for OpenLR data integrity
  • Closure service enhancement with automatic OpenLR generation

4. DevOps & Infrastructure

  • Docker containerization for easy deployment
  • Environment configuration management
  • AGPL-3.0 licensing for open-source compliance
  • Comprehensive documentation and setup instructions

Currently In Progress (Weeks 9-10)

Web UI Development

  • Next.js frontend application setup and configuration
  • Interactive map component using Leaflet.js with OSM tiles
  • User authentication pages (login/register) with backend integration
  • Closure submission forms with step-by-step modal interface
  • Real-time closure visualization on the map
  • Responsive layout components and navigation

Technical Achievements

Backend Architecture

🏗️ FastAPI + PostgreSQL/PostGIS + OpenLR

├── 🔐 JWT Authentication & OAuth2

├── 🗺️ Spatial queries with PostGIS

├── 📍 OpenLR location referencing

├── 🐳 Docker containerization

└── 📚 Auto-generated API documentation

Key Features Implemented

  • Spatial Querying: Efficient bounding box and coordinate-based closure retrieval
  • OpenLR Compliance: Industry-standard location referencing for cross-platform compatibility
  • Security: JWT-based authentication with password hashing and token validation
  • Scalability: Dockerized deployment with proper database indexing
  • Documentation: Comprehensive API documentation with interactive Swagger UI

Frontend Progress

  • Modern Stack: Next.js + React + TypeScript + Tailwind CSS
  • Interactive Maps: Leaflet.js integration for closure visualization
  • User Experience: Intuitive forms and responsive design
  • State Management: React Context for closure and authentication state

Metrics & Performance

  • API Endpoints: 15+ fully functional endpoints
  • Database Schema: Optimized with spatial indexing
  • Test Coverage: Core business logic tested
  • Docker Build: < 30 seconds deployment time
  • API Response: Sub-100ms for spatial queries

Next Steps (Weeks 11-15)

Immediate Priorities

  1. Complete Web UI (Week 10)
    • Finalize closure submission workflow
    • Implement real-time closure updates
    • Add user dashboard and closure management
  2. OsmAnd / Valhalla Integration (Weeks 11-12)
    • Research Valhalla API plugin
    • Implement closure data consumption in Valhalla
    • Create prototype navigation with closure-aware routing
  3. Testing & Optimization (Weeks 13-14)
    • End-to-end testing and performance optimization
    • Documentation finalization
    • Community feedback integration

Challenges & Solutions

Challenge: OpenLR Integration Complexity

Solution: Successfully integrated the openlr-python library with custom validation logic for OSM data compatibility.

Challenge: Spatial Query Optimization

Solution: Implemented PostGIS spatial indexing and optimized SQL queries for sub-100ms response times.

Challenge: Authentication Architecture

Solution: Built a robust JWT-based system with refresh tokens and proper security middleware.

Community Engagement

  • Regular mentor sync-ups with Simon Poole (OpenStreetMap) and Ian Wagner (Stadia Maps)
  • Active GitHub development with 80+ commits
  • OSM community feedback on project direction
  • Documentation-first approach for future contributors

Repository & Demo

  • GitHub Repository: OSM Temporary Road Closures
  • API Documentation: Available via Swagger UI
  • Live Demo: Coming soon with frontend completion

Reflection

The first half of GSoC has been incredibly rewarding! I’ve successfully built a robust backend infrastructure that exceeds the initial requirements. The integration of OpenLR was particularly challenging but rewarding, as it ensures our platform can work seamlessly with any OSM-based navigation system.

The project is well-positioned for the second half, where I’ll focus on user experience through the web interface and real-world validation through OsmAnd or Valhalla integration. I’m excited to see this system help the OSM community navigate around road closures more effectively!

Special thanks to my mentors for their guidance and the OSM community for their support and feedback.

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Comment from Robot8A on 3 August 2025 at 08:06

Nice job! Can’t wait to see the demo!

Comment from RedAuburn on 10 August 2025 at 15:02

Awesome progress! We can’t wait to integrate this into CoMaps 😊

Comment from !i! on 14 August 2025 at 06:41

Hi Archit, not sure if you already have external information sources in scope? Here in Rostock we have a opendata channel also with georeference: https://www.opendata-hro.de/dataset/baustellen Needs to be handeled as limitations for pedestrians / cyclists are somewhat poorly present. Also its just what is planned, not nessesarly whats currently on the ground ;-)

Long time ago I had contact with https://www.ndr.de/verkehr but they also stated that its difficult to aggregate all the sources on the different ferderal levels. In theorie there is TMC and per state a single information exchange … AFAIK no institution has a automatic worklflow to push limitations.

Comment from Archit Rathod on 15 August 2025 at 00:26

Hello All,

Thank you for your comments!

Note: The GitHub link has been updated: https://github.com/Archit1706/temporary-road-closures

Reply to Yod4z: The openeventdatabase is a great project—thanks for sharing! However, it only supports point closures. The Temporary Road Closures project now supports LineStrings (road segments) with directional data, as well as point closures. It also includes infrastructure closures that affect only specific transportation modes such as cars, bicycles, or pedestrians.

Reply to !i!: Thanks for sharing the live data sources. I’ll explore how they can be integrated into the database. Until now, I’ve only had access to Swiss Hiking Data. I’m also working on detailed documentation so that anyone can report live closures more easily.

Thanks again for the support! —Archit

Log in to leave a comment