graphhopper / graphhopper

Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.

Home Page:https://www.graphhopper.com/open-source/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Routing to or from multipolygon, not only point->point

igor-suhorukov opened this issue · comments

Describe the bug
Current implementation of graphhopper-core support only point to point routing. But sometimes user attempt request shortest route to some place like park, beach or protected area. In this case route will be to centre not to one from the N entrance to this area.

To Reproduce

Any existing versions of GraphHopper

Expected behavior
GraphHopper accept multipolygon/polygon on input and calculate intersections with all roads/paths, after that calculate all routes and find best one from M routes

commented

Can you provide a real example where this would be useful?

@easbar Sure. As an example I am planning for vacation and want calculate distance from house to the beach "Playa de Torviscas" in GraphHopper.
In case Point->Point routing I should write program on some programming language to find all roads/path intersections with beach, calculate routes in loop and find best result from M routes.

The same story with route from house to Kensington Gardens
The house can also be located on some territory with several exits / gates or the building has many entrances ...

commented

Ok, thanks. There would be two problems to be solved here then:

One is routing from a point to one of multiple locations, or more generally routing between two sets of points and finding the ideal start/destination points. This can be done with a single search, without calculating all the single routes. It would also be useful to calculate the route to the nearest of multiple train stations for example.

The other is finding the 'entrance points' of an area-like feature like the beach/garden you mentioned.

The other is finding the 'entrance points' of an area-like feature like the beach/garden you mentioned.
@easbar much more easy find all multipolygon intersections with all 'highway'/'paths'/'footpath' as roads graph already in GraphHopper

It would also be useful to calculate the route to the nearest of multiple train stations for example.

There was even something like this in the repo a long time ago :)

@karussell do you remember, why it was removed?

Too specialized and never really used.