Menu

Why I Built My Own OpenStreetMap Routing Engine — and How I Use It in a Real Application
📰

Why I Built My Own OpenStreetMap Routing Engine — and How I Use It in a Real Application

DEV Community: typescript·Daniel Sá·1 day ago
#VItrurj8
#devtotypescript#devto#dev#routing#router
Reading 0:00
15s threshold

Building roadgraph-router-v2: from a practical mapping problem to a lightweight, browser-based routing engine.

Sometimes, the best way to understand a technology is to build something that depends on it.

That's how roadgraph-router-v2 started.

I was developing Energy&Fuel , a web application for exploring electric vehicle charging stations and fuel stations across Portugal.

The idea was relatively straightforward: bring together information about EV charging infrastructure, fuel prices, and station locations in one interactive map.

But as the project evolved, I wanted to go beyond displaying markers.

I wanted users to calculate actual road routes, compare alternatives, and understand how to reach a particular station.

That led me to an interesting problem:

Could I implement routing directly in the browser without relying on an external routing API?

The result was roadgraph-router-v2 , an open-source TypeScript routing engine built around OpenStreetMap data, compact road graphs, and A*…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.