logo separator

[mkgmap-dev] Douglas Peucker Filter and short lines

From Ticker Berkin rwb-mkgmap at jagit.co.uk on Mon May 24 11:18:14 BST 2021

Hi Gerd / anyone else

Attempting to improve filtering by considering their optimal order, I
got much worse results at very low resolutions. The excess was lots of
1-res-unit lines (these came from the coastlines of lots of small
islands)

These lines start off sufficiently large to make it through the
sizeFilter.

Running the DP filter next, if intermediate points are less than -
-reduce-point-density (default 2.6) res-units from the line between
first and last point, they are dropped. This can result in a single
point if the first and last points are equal, or a line shorter than at
least 2 of the sub-lines that no longer exist.

I'm not sure of the best approach to deal with this. I considered
inhibiting DP if the distance between start&end (either overall or for
the internal sub-processing) is less than the error distance, but this
is wrong for polygons or lines that loop back towards their starting
point. Maybe the DP error size must be less than sizeFilter size; For
lines this is MIN_LINE_SIZE = 1 and not configurable, For polygons it
is --min-size-polygon (default 8) or --polygon-size-limits.

Running RemoveObsoleteFilter before or after DP effects the final
result. Considering the functions of the filters, I think
RemoveObsolete should be before DP; DP shouldn't produce obsolete
points and there is no point in DP considering obsolete points.

Ticker



More information about the mkgmap-dev mailing list