Routing from area to area

Hey guys,
I appreciate working with openrouteservice and got it finally running on my linux. Now I found myself with an unusual question: Is there a way to route vehicles between two areas? For example: You have two bigger cities. Both have multiple highways attached (say, one western and one eastern highway each). People living in the west of the city would take another route than people living in the east. Is there an efficient way to find all likely routes between those cities?

Since I want to do this with hundreds of cities, some kind of point grid covering the city areas would be huge overload I guess.

Hi @now-fred,

could you go into a bit more detail of your setup? Especially what you mean with areas…
Do you have multiple ors instances running?
Are you using a normal OSM file?

If everyting is running in one instance, there are already speedup mechanisms in place which create shortcuts for fastest routes between different central nodes.

But yes, please elaborate a bit on what you are trying to do, and maybe also add requests you are making and what you expect vs what you got.

Best regards

Hi @amandus, thanks for replying. My setup is running smoothely, I am facing more of an algorithmic problem: The classical routing connects the edges between two points. Nevertheless, I want to find the routes between two areas/polygons. A possibly inaccurate example: For all inhabitants of the extended catchment area of Heidelberg, one would search all (fastest) routes to Frankenthal. The southern inhabitants would take a different route than the Heidelberger in the north.

It may feel like one is pouring water into an area and take all roads to the other area. So, my first idea was to take the center of each polygon and return all possible alternative routes. However, this reaches its limits for very elongated polygons. Also routing between points on the intersection between roads and polygons is limited or expensive.

I hope I was able to describe it better. Have you ever faced a similar problem?


what would you expect the return of such a query to be?

This is not something that exists in the openrouteservice and likely not something that will come soon.
What you’d be looking for is some sort of separated edge centrality calculation, a problem which is computationally expensive to solve once the “connecting polygon” including start- and end-area and everything in between gets big (read: bigger than Heidelberg).

For your problem, since you have a given set of areas, you can probably “intelligently” sample points in your start-and goal-areas and run route calculations for the cartesian product of start- and endpoints.

Best regards

Yes, I assumed already that it’s not part of openrouteservice. I was hoping for some effect similar to pour water into an area and get the most likely routes to the sink.

The solution for me was “disaggregating” the routes from the OD Matrix into smaller subzones, that worked fine. FYI, I also utilized the most recent paper by Prof Lovelace: Jittering: A Computationally Efficient Method for Generating Realistic Route Networks from Origin-Destination Data

Thanks for your response and giving the the right hints, @jschnell

1 Like