atorger / nvdb2osm

The Unlicense
9 stars 2 forks source link

Round road width to fewer values #29

Closed matthiasfeist closed 2 years ago

matthiasfeist commented 2 years ago

Hi.

It seems that some distributors in NVDB are providing veeeeery exact data about the width of a road. That led to small segments where a way changes from 5.3m to 5.5m and back to 5.4m to then change to 5.8m. I wonder if it would make sense to round this value somehow to either full meters without the decimal point or to at least .5 values?

What do you think? Matthias

atorger commented 2 years ago

We only keep width on tertiary and up. My experience so far is that it's not too bad so I haven't considered it to be a significant issue, but I could imagine that in some municipality it could be.

I have noted that maxspeed and width can change at just slightly different places, and then you get a short segment, sometimes I manually merge them to the same point (maxspeed taking precedence). There is already some merging if they are close enough if I remember correctly.

(Where I've been working lately, Höga Kusten, the existing OSM ways have mostly shorter segments than the tertiarys and up due to lots of routes.)

I'm not totally against the idea of rounding or in some other way reduce the number of changes in width (or even removing width alltogether, I think there is no existing end-user application that makes use of it), but so far I just haven't seen it as something that slows merging down significantly compared to all other stuff one needs to do.

matthiasfeist commented 2 years ago

I just had this scenario in some places in Nynäshamn and it was pretty annoying. But I'm also quite happy to leave the width tag out completely

atorger commented 2 years ago

I have made some test runs and variants for nynäshamn: No rounding (as before): 484 ways with width No width at all: reduced to 372 ways (-23%) Round widths to whole meters for width > 2 meters and not bridge or tunnel: 441 ways (-9%)

I currently have rounding checked in but the reduction is not that large, I'll probably look into it a bit more.

atorger commented 2 years ago

I have now added a more elaborate algorithm, which keeps an average/rounded value if it can be within 15% from the stated value. It doesn't come down to as having no width at all but much better than only rounding, so I think we'll do it like this for now.

matthiasfeist commented 2 years ago

cool