valhalla icon indicating copy to clipboard operation
valhalla copied to clipboard

Indoor Navigation

Open dmenneck opened this issue 3 years ago • 23 comments

I am currently facing the use case of navigating in buildings. Unfortunately I couldn’t find any examples so far and wanted to ask if some of you have already made experience with it and/or can estimate if indoor navigation with Valhalla is possible.

The underlying OSM data will be tagged with schemas like IndoorOSM or Simple Indoor Tagging.

dmenneck avatar Jun 07 '22 13:06 dmenneck

@dmenneck it is possible. in #3519 we added some basic support for this. i'm neither familiar with "IndoorOSM" nor "Simple Indoor Tagging" but if it uses the osm data model and the tags are ones that our processing cares about it should somewhat work. you can always give it a try and see how far it goes and what shortcomings you find. it would be great to cataloge a list of that here so we can address it as more of a larger project.

kevinkreiser avatar Jun 07 '22 13:06 kevinkreiser

Thank you @kevinkreiser !

Is there any documentation somewhere where I can find the tags that Valhalla expects for Indoor Navigation? Which OSM tags should I use for mapping a building and making Valhalla able to navigate over the graph?

dmenneck avatar Jul 10 '22 14:07 dmenneck

You can look at the graph lua file in this PR which added the indoor stuff to the graph: https://github.com/valhalla/valhalla/pull/3509/files, which is fairly straight forward to derive from.

nilsnolde avatar Jul 10 '22 15:07 nilsnolde

You‘re right @nilsnolde, it’s actually straight forward, thanks!

Since Valhalla can handle stairs/elevators/escalators it’s obviously possible to navigate from one floor to another. I’m curious how a request would be structured to navigate eg from the first floor to the fourth.

Do you have an example for that?

dmenneck avatar Jul 15 '22 15:07 dmenneck

@dmenneck the unit tests in the pr linked above does some test requests but at the present time we dont have a way to select what floor you are on if you want to set a destination on a certain floor. we had some discussion about it before but its very similar to the "level" parameter we would use to select a road when multiple roads are on top of one another. if your question is focused on this problem the answer at the moment is we've not yet implemented the ability to select the "level" or "floor" but if the destination or origin that you pick is clearly on top of one walk way vs another it will pick that one regardless of the floor its on. for ambiguous cases where they are on top of each other it will depend on the ordering of the data (ie random) unfortunately.

kevinkreiser avatar Jul 15 '22 15:07 kevinkreiser

Okay, so did i understand it correctly that you can route from room A to room B on the same floor, but not yet from eg room C on floor 1 via stairs/elevators to room D on floor 3?

dmenneck avatar Jul 15 '22 16:07 dmenneck

both should work already but the problem is when hallways on two different floors are on top of each other, in that ambiguous case there is no way to tell the router which floor you meant

kevinkreiser avatar Jul 15 '22 16:07 kevinkreiser

oh and we also dont support "area routing" which is that if there isnt a mapped walking path/hallway/stairway ie a linear feature then we cannot route on it.

kevinkreiser avatar Jul 15 '22 16:07 kevinkreiser

both should work already but the problem is when hallways on two different floors are on top of each other, in that ambiguous case there is no way to tell the router which floor you meant

would giving an offset to a hallway solve this issue?

I am facing the use case of outdoor/indoor navigation on a university campus where the user should be able to select a room in a building and navigate to another room in that same building.

dmenneck avatar Jul 15 '22 16:07 dmenneck

would giving an offset to a hallway solve this issue?

jep, that'd do it. not really a universal solution for OSM but if you're assembling your own data then no problem. the way which is closest to the input coordinate will be selected for routing. so you really have to control the input to valhalla very tightly, a user can't just click on a room if you can't control which way it really snaps to, the room a user wants might on the third floor, but the closest way to the input point could be in the basement.

nilsnolde avatar Jul 15 '22 17:07 nilsnolde

so, if we'd like to expose controlling which level a waypoint snaps to, wouldn't it be enough (at the very least as a workaround) to

  1. add level/layer to EdgeInfo
  2. add a /route API parameter to choose edge IDs for a waypoint to snap to (which would be helpful in a few other scenarios, e.g. https://github.com/valhalla/valhalla/issues/3412#issue-1054962484)

then a user can call /locate to filter the right edge(s) (tunnel/bridge/house floor) and plug it into the /route?

while level is pretty predictable what they represent, ie discrete floors in a building, layer tags hardly have any meaning without context of all other layers below/above.

nilsnolde avatar Jul 18 '22 08:07 nilsnolde

Wouldn't level/layer be more appropriate on each node? An edge can traverse levels (e.g. stairs, elevator).

dnesbitt61 avatar Jul 18 '22 13:07 dnesbitt61