atorger / nvdb2osm

The Unlicense
9 stars 2 forks source link

Coordinate simplification #9

Closed NKAmapper closed 3 years ago

NKAmapper commented 3 years ago

Just an observation about the simplification of ways. The example file you provided some time ago for Gothenburg has a lower quality topology for ways than the original NVDB data, i.e. it is using fewer nodes. Would it not be better to provide the best quality possible? I agree some simplification is needed, but the question is how radical it needs to be. Also, why is there a need to have weaker topology for some road classes compared to others?

Current manual mapping is perhaps not a guideline, I think, as it tends to be quicker and could be based on low quality satellite imagery. Doing an import is a big effort, never to be done again for that area, so it would be helpful to use high quality data the first time.

Consensus in the Norwegian import is a simplification corresponding to a factor of 0.2 in the JOSM simplify function. In a few municipalities, the quality in NVDB has been too weak for 0.2 but that can be fixed with the simplify function in JOSM after manual inspection.

atorger commented 3 years ago

The purpose of simplification is to put in adequate detail for OSM, but not clutter it with more data than required.

In the community, both the Swedish and international, I've seen some irritation of overly detailed imported geometry (making later hand-editing of imported geometry more cumbersome, and causing hand-made vs imported geometry to not blend well), so I've been careful to not include too many waypoints. I've since the first example increased the detail slightly, and may make further adjustments. I'm using douglas-peucker algorithm now and there could be a better way looking at angles in the waypoints as well as deviation in meters. Douglas-peucker only looks at deviation, not "smoothness".

The difference in detail level is to mimic how it usually looks, but with a better simplification algorithm I would probably do away with that. I'm not 100% satisified with that distinction, so it will likely go away.

Even recent manual mapping using the NVDB raster map as background layer generally uses lower amount of mapping points even than the simplified version, so I think it's not just old roads. Recent manually made roads are quite consistent in their detail level, people map to follow the detail in the photo, but don't go in to smoothen out curves just for the sake of smoothening.

I don't have a strong opinion on this and if people wants it I'll increase the detail level, but I think something around the level the script uses now is what is most acceptable in the Swedish community. I'll raise the question again and see what people think.

Regarding importing only once, I think that once the map has a good accuracy and coverage, it will be possible to make automated or near-automated imports in the future. This first time over is a cumbersome 100% manual process due to pretty bad offset errors that are in there, and that NVDB lacks some information that OSM has/needs (for example figuring out which ways that should be highway=service). Once that is in and aligned, further updates from NVDB or other databases will be much easier.

atorger commented 3 years ago

Ha! It sparked quite some discussion, and it seems people overall indeed want more detail level as you do. I'll do some sort of update on this.

atorger commented 3 years ago

I tested the value of 0.2 (JOSM simplify is the same algorithm, Douglas-Peucker), and people seemed fine with that, so I have committed a patch with that, so we can close this issue now.

NKAmapper commented 3 years ago

That was quick :) I think we agree on the general principles. The 0.2 factor seems to me to be a good compromise between getting acceptable curves and avoiding clutter.

atorger commented 3 years ago

Heh yeah, I had misjudged what people was thinking (the "too much detail" discussion actually came from when I was mapping nature, and it kind of stuck in back of my head).

I thought of making a more advanced simplification algorithm that looks at angle errors as that would look at smoothness and could then allow for more than 20 cm deviation in some situations to reduce node count without sacrificing smoothness. But, after doing some test runs on actual NVDB geometry I concluded that it's overkill and the plain 0.2 meter Ramer-Douglas-Peucker is just fine, and as you guys have been doing this for quite long it was an easy decision.