logo separator

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

From Thilo Hannemann thannema at gmx.de on Fri Jan 8 15:02:18 GMT 2010

The problem with the roads is that the SizeFilter is called for lines as well as for polygons. But the call to the filter is in two different places in mkgmap/build/MapBuilder.java. So if you make the MIN_SIZE a parameter and use different values for lines and polygons you won't have any holes in the roads at all and can set MIN_SIZE to a bigger value for the polygons.

Regards
Thilo

Am 08.01.2010 um 15:52 schrieb Felix Hartmann:

> 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...
>> 
> 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