1

I have just been introduced to GIS and GraphHopper. I am trying to create a route plan for indoors which I can feed to GraphHopper. I am trying to figure out how GraphHopper selects the best route for a point if that point is not on the route. It seems to me (I tried it out on a map I created) it selects the path nearest to the point. What happens if the nearest path is not reachable (say there is a ditch between the point and the path)? In general is there a way to specify that only certain paths may be chosen for a point. In my case, say I am trying to find the shortest path from any point within a room to another room. There are two exits from the room. Any path has to use those two. But the nearest path from the selected point is the one passing near the room just on the other side of the wall. GraphHopper seems to always choose that one because I have not told it about the wall. Is there a way to model this either in GraphHopper? If not, how do I handle it at application level. The way I can think of is to create a layer with all my enclosed areas and their exits and for any point first figure out which area it is in and draw the rout from the exit point of that area. Is that feasible?

Update: Adding a picture (a very badly made map of an office floor) to illustrate the problem. From both marked positions 1 and 2, GH will choose the lines marked in green as they are nearer but the correct paths are the ones marked in blue. enter image description here

2

it selects the path nearest to the point

yes

What happens if the nearest path is not reachable

It will still snap to the nearest path but with some code changes you can avoid this

But the nearest path from the selected point is the one passing near the room just on the other side of the wall.

Would you enter an image of you example. Not sure what you mean. I partly guess what you mean and think you would need to model the rooms differently e.g. not just the way through it but also the boundaries of the room so that the points snaps to those better boundaries instead. Or even better implement area routing

for any point first figure out which area it is in and draw the rout from the exit point of that area.

Yes, good idea. You could also teach the LocationIndexTree to only return points within the room boundaries of the query point.

Also have a look into this issue: https://github.com/graphhopper/graphhopper/issues/646

  • Thanks @Karussell. I have added an image to illustrate the problem. I am studying GH code to try and understand what you suggested. Concurrently, also looking for a routing scheme which could solve the problem. Will keep thread updated. – 341008 Mar 8 '16 at 11:20
  • 1
    Karussell, I have just started a new topic on the discussion forum. Hoping for your feedback there: discuss.graphhopper.com/t/… – 341008 Mar 10 '16 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.