Area with shorthest route passing through given point

I have the following problem: I want to find the area from where the shortest route to point A goes through point B. As a constraint we can add e.g. radius from point B.

Any ideas how and if at all possible to do it in GraphHopper?

What is your definition of this area? Do you have an example of what you are trying to achieve?

So the example. I search the city C in distance max 300km from the city B such that the shortest route from the city C to city A goes through city B. The area will be cities satisfying this condition. This will be area because every city C1 that is on the route form C to A also satisfies the condition. So every point on the route satisfies the condition. In practice it will be the whole area of points C fullfiling the condition. Similar to area of isochrones.

My gut feeling is that the area will be a funnel with borders being two roads joining in the city B (assuming there is a junction in city B which assumption is OK).

Sorry, but I don’t think I understand your example. Can you read it again and make it more clear?

I want to find all cities in France from which shortest route to Paris goes through Orleans.

Bordeaux and Clermond-Ferrand are such cities.
Le Mans and Lyon are not.

Ok. There is no direct support for this sort of query in GraphHopper. But naively thinking you could just calculate the shortest route from all cities to Paris and for each one check if it goes through Orleans?!

OK. I thought there is a smarter way than brute force :slight_smile:

There probably is, but it isn’t implemented in GraphHopper :smiley: But a simple thing you could do to speed it up (besides using CH for fast routing of course) would be calculating the beeline distance first. If Orleans is further away than Paris (according to the beeline distance) Orleans won’t be on the shortest path to Paris. If the beeline distance Start-Orleans-Paris is much larger than the distance Start-Paris then Orleans is likely not on the shortest path to Paris either (you could use some threshold here to filter out even more cities).

1 Like