Hi all,

I've noticed that the line simplification in JOSM works different to the one in 
mkgmap. Both implement a Douglas-Peucker algo, so I wondered why.
It turned out that JOSM calculates the distance of point `px` to the line 
through(!) end-points `p1` and `p2`, while mkgmap calculates the distance to 
the segment between(1) those points. So, they get the same distance when the 
perpendicular is on the segment, but very different values when not.

This page helps to see the difference:  https://karthaus.nl/rdp/

It would be a bit faster to use distToLineSegment() (like JOSM) instead of 
shortestDistToLineSegment() but I am not sure which result is better.

Any thouhts?

Gerd

_______________________________________________
mkgmap-dev mailing list
[email protected]
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to