logo separator

[mkgmap-dev] Suggestion - Make Douglas Peucker Algorithm more Configurable

From Felix Hartmann extremecarver at googlemail.com on Fri Jan 8 14:52:02 GMT 2010


On 07.01.2010 23:13, Thilo Hannemann wrote:
> The Douglas Peucker Algorithm might not be the best way to tackle the problem of too small polygons. Right now polygons will be dropped if they have a maximum extension of less than one map unit at the current resolution. The code is in mkgmap/filters/SizeFilter.java if you want to try it, just set MIN_SIZE to a value greater than one should do it.
>
> The "proper" solution would be to merge polygons if they overlap at the current resolution. Otherwise we might get "holes" in forests if they are mapped in small pieces. But I have no idea how to implement that...
>
> Regards
> Thilo
>
>    
I just set it to 8 to see the effects.

a) it also removes many road pieces on low resolutions - so there are 
pretty big holes in roads.
b) it is much much faster both in Mapsource as on my vista hcx.

So concluding from that little try, yes having some algorithm joings 
roads and polygons (and dropping very small polygons) would mean a huge 
speed increase (and joining should not care for "name" or "ref" on 
resolution 18 or below).
Actually already setting MIN_SIZE to 2 makes a noticeable speed 
improvement and only a very few holes do appear. I will leave it at "2".



More information about the mkgmap-dev mailing list