valhalla icon indicating copy to clipboard operation
valhalla copied to clipboard

Bus route relation OSM tags available in bicycle edge costing?

Open saranrapjs opened this issue 4 years ago • 1 comments

Hi, I'm working in a fork where I'm playing around with tweaking the logic for bicycle costing. One of the things I'd like to try out is to see whether it's possible to penalize directed edges that are part of a busway (whether via built-in costing, or via a dynamic costing input). It appears that in NYC, when OSM ways overlap with a bus route, that bus route is expressed as a relation containing that way — and I'm taking this note to mean that relation -> way tags post-processing may not squarely exist.

If I wanted to try to poke around at this, is there any precedent for post-processing relation-bound way information like this? I wasn't able to find where that shielding/highway info lives currently (I'm new to C++!), and am not sure if this is the right way to think about exposing relation information in the context of bicyclecost.cc. I've thus far had success with querying other salient features (weighting the oneway-ed-ness of a street, for example) in bicycle costing, so am hopeful about this idea as well. Thanks for any pointers you can share about how these types of OSM tags might be expected to work in a Valhalla context!

saranrapjs avatar Dec 06 '21 03:12 saranrapjs

This could be tricky as you would need to add a flag in DirectedEdge if you want to use this within costing. I think you would need to find a spare bit within the structure and add access methods. You would also need to add support within lua, add a flag to OSMWay, and propagate this flag to the directed edge during graph building. You might want to look at how truck_route flags are set as I think they come from relations.

Are there a significant number of bus routes that have bicycle access? If so this seems like a worthwhile addition.

dnesbitt61 avatar Dec 06 '21 14:12 dnesbitt61