westnordost / osm-legal-default-speeds

Infer default legal speed limits from OpenStreetMap tags
https://westnordost.github.io/osm-legal-default-speeds
BSD 3-Clause "New" or "Revised" License
21 stars 8 forks source link

maxspeed:advisory=130 although no motorway #10

Closed karussell closed 1 year ago

karussell commented 1 year ago

For

junction=roundabout
highway=tertiary
rural=yes

I get:

maxspeed:advisory=130
...

Is this a bug?

Please note that I do not get this tagging in the wild but I provide "rural=yes" in the replacerFn as (name, eval) -> eval.invoke() || "rural".equals(name)

westnordost commented 1 year ago

Ref:

https://westnordost.github.io/osm-legal-default-speeds/#tags=junction%3Droundabout%0Ahighway%3Dtertiary%0Arural%3Dyes&cc=DE

Indeed, this is a bug! But is it a bug in the source data or in the lib?

westnordost commented 1 year ago

There was a logic error on the wiki page:

https://wiki.openstreetmap.org/w/index.php?title=Default_speed_limits&type=revision&diff=2532180&oldid=2529537

A roundabout was interpreted as a oneway (correct) and a oneway in turn was interpreted as a dual carriageway unless dual_carriageway=no was set (incorrect). I changed it around, i.e. roundabouts are always interpreted as single carriageways and also moved the whole "if it is a oneway, it must be a dual carriageway" logic to the "fuzzy match".

karussell commented 1 year ago

Nice, thank you!