logo separator

[mkgmap-dev] Overview map: tiny patch/review series

From Thilo Hannemann thannema at gmx.de on Tue Jun 16 06:58:24 BST 2009

Hi Elrond,

there seem to be some problems with the simplification right now. But  
instead of simply de-activating the simplification I think we should  
debug the code. Of course it's fine to de-activate it for debugging :)

The problem of distorted polygons does not only appear in the overview  
map, it appears at all zoom levels. One problem I could identify is  
that the Douglas-Peucker code does remove the "closing" node of a  
polygon, but doesn't put it back after simplification. This might be  
ok for filled polygons, but for contour lines it is a problem. I've  
attached the patch that I use to solve that problem.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: decrease_douglas_peucker_error.patch
Type: application/octet-stream
Size: 1922 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090616/a34d83ef/attachment.obj 
-------------- next part --------------



That patch also sets the error distance for the Douglas-Peucker  
algorithm to 1/8th of the resolution instead of one half. In my  
opinion this gives much nicer results. The question here is why it is  
so, because you shouldn't be able to see such small errors. From  
looking at the Douglas-Peucker code I can not put my finger on any  
bug. What I do not understand is the distance calculation. Anybody  
with insight cares to have a look at it (or explain how it works?).  
I'd assume that a distance calculation on a spherical surface would  
involve lots of trigonometric functions - which the formula in the  
code doesn't.

Take care
Thilo



More information about the mkgmap-dev mailing list