logo separator

[mkgmap-dev] Minimum resolution in polygons style

From Gerd Petermann GPetermann_muenchen at hotmail.com on Thu Dec 22 10:11:37 GMT 2016

Hi Ticker,

using --polygon-size-limits option sounds reasonable, but requires a lot more changes.

While thinking about it I wondered if the current implementation of the size filter makes any sense.
This is what happens now:
- for each element (point,line.shape) the style sets the values for minRes and maxRes and adds it to a list
- a lot of calculations are done to find out the needed sub divisions (MapSplitter). For lines and shapes the
calculation are based  on the (worst case) assumption that the shape will not be simplified or discarded by
any filter.
 -  finally for resolutions < 24 we use the filters (in this order):
 + RoundCoordsFilter makes sure that all points are on the raster for the given resolution. This may enlarge a line or polygon
if its points are located far from any raster points (one point may be moved to next left raster point, another to the next right.
Of course this may also shrink the object if points are rounded towards the center of the object.
 + SizeFilter checks this -- possibly enlarged -- object against the minimum value from --polygon-size-limits or --min-size-polygon option.

I think this is actually wrong. SizeFilter should use something like
size = Math.min(sizeAtRes24,sizeAtCurrentRes);
if (size < minSizeForRes)
 drop the element

If this is correct we can save a lot of calculations if we check the sizeAtRes24 much earlier.

Gerd









________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap at jagit.co.uk>
Gesendet: Mittwoch, 21. Dezember 2016 13:23:17
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Minimum resolution in polygons style

Seems like a good idea - It should use the --polygon-size-limits option
in an inverted sort of way.

Ticker

On Wed, 2016-12-21 at 07:48 +0000, Gerd Petermann wrote:
> Hi all,
>
> while debugging the problem reported by Arndt Röhrig
> http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2016q4/025471.html
>
> I noticed that his style adds all polygons with "min resolution 10"
> like this:
> landuse=basin [0x53 resolution 10]
>
> Up to now I thought this is just causing more CPU load :
> The polygon is processed for each (low) resolution  and after many
> calculations it is typically "thrown away" because it
> is reduced to a single point in the
>
> I think we can easily change mkgmap to calculate a proper "min res"
> value
> for shapes depending on the actual size at resolution 24.
> Probably that would also be useful for lines.
>
> Any thoughts?
>
> Gerd
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list