a-b-street / osm2lanes

A common library and set of test cases for transforming OSM tags to lane specifications
https://a-b-street.github.io/osm2lanes/
Apache License 2.0
34 stars 2 forks source link

`oneway=-1` not understood #166

Open westnordost opened 2 years ago

westnordost commented 2 years ago

oneway=-1 means that the road is a oneway to the opposite direction in which the way is drawn. E.g. if the road is drawn for North to South, it would be a oneway from South to North.

droogmic commented 2 years ago

indeed, but the error should be reported accurately.

Conversion Error: unimplemented: 'oneway=-1' - osm2lanes/src/transform/tags_to_lanes/unsupported.rs:74:20

I am not sure what the best way to approach this would be, because oneway logic is used throughout the code. Perhaps we should pretend the way is in the other direction, including flipping *:left and *:right tags, proceed as normal, and then flip everything back at the end?

Or we add branches everywhere for the ternary value of Oneway (yes, no, reverse).

InsertUser commented 2 years ago

Perhaps we should pretend the way is in the other direction, including flipping :left and :right tags, proceed as normal, and then flip everything back at the end?

I think in some cases derivatives of oneway=-1 are used to describe specific lanes that go backwards in a street that is otherwise oneway in the normal 'forward' direction? Would this complicate this logic?

droogmic commented 2 years ago

Simple roads we can handle easily. I am worried about more complex situations. Does anyone have an example of oneway=-1 with bus or cycle lanes?

hungerburg commented 2 years ago

Cycle lanes already support "cycleway:left:oneway=-1", correctly too. A bit of overpass turbo did not yield any usage of "oneway=-1" on anything but small footways or residential roads. The tag accounts for 0.15% of oneways https://taginfo.openstreetmap.org/keys/oneway#values -- The recommended practice is to swap direction of the osm way.

droogmic commented 2 years ago

that doesn't seem like enough usage to warrant worrying about this yet. I made https://github.com/a-b-street/osm2lanes/issues/175 to help prioritize the tags to work on