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

busway on under-tagged roads #264

Open dabreegster opened 2 years ago

dabreegster commented 2 years ago

https://www.openstreetmap.org/way/997453943 it'd be more reasonable to put 2 lanes in one direction or the other

https://www.openstreetmap.org/way/228767989 no lanes tagged, but since it doesn't suggest general traffic is restricted, we should assume 4 lanes

Also just mis-tagged cases like https://www.openstreetmap.org/way/46729604. lanes isn't 2

dabreegster commented 2 years ago

https://www.openstreetmap.org/way/39597033 uses multiple schemes

BudgieInWA commented 1 year ago

I had a thought about how to understand the busway tag in the absence of proper lane count tags. I am fairly confident that we should be trying to understand lanes:* (the lane count for different types) and *:lanes (access restrictions, specified per lane) first, and laying busway tags on top of that. The first two schemes are precicely defined with clear defaults, whereas the busway scheme only tells us about the presence of a busway on one or both sides, and leaves a lot of details unspecified.

Anyway, the idea: When the lane counts are not tagged, instead of guessing lanes=2, we actually want to guess lanes:car=2 (not a real tag, but counts the number of "normal" lanes). We normally guess lanes:bus=0, unless we see a busway tag which implies lanes:bus=2 (or 1 or whatever). Then, if we don't have a lanes tag, we get guess the total lanes to be lanes:bus plus lanes:car. If we have lanes and busway then we guess lanes:car to be lanes - lanes:bus. The guessed lanes:car value - as distinct from lanes - is a way to distinguish between the cases where we need to add lanes for a busway, vs convert existing lanes to bus lanes.