logo separator

[mkgmap-dev] [PATCH v1] Optimize filters for shapes

From WanMil wmgcnfg at web.de on Sun Jan 13 17:22:25 GMT 2013

>  > >
>  > > please check: the patch ignores preserved points, so I think it
> could break
>  > > routing.
>  >
>  > You cannot route over polygons. So I don't expect that removing a point
>  > from a polygon can break routing?
>
> The filter is also used in MapBuilder.processLines()

You are right. I thought my patch checks if the element is a MapShape 
like it is done in the RemoveEmpty. But it doesn't. So this has to be 
added and/or be extended to check for preserved points.

>
>  >
>  > > I would assume that straight lines are filtered by
> DouglasPeuckerFilter ?
>  >
>  > Probably not. Otherwise the file size of the img files should have been
>  > the same.
>
> I don't understand. Your patch doesn't change the number of points
> on straigth lines, does it?

No, but it removes spikes from polygons. So the following polygon:
a-b-c-d-c-e-a
will become
a-b-c-e-a

I don't know if the DouglasPeuckerFilter does the same?

>
>
>  >
>  > > (at least now that I've committed the removeShortArcs patch)
>  > > I did already look for other algos, eg. the VW algo
>  > > http://www2.dcs.hull.ac.uk/CISRG/publications/DPs/DP10/DP10.html
>  > > sounds like a possible alternative to DouglasPeucker.
>  > > On the other hand, I assume that the input for the filters will change
>  > > with the intended mp_cut changes, so we may end up solving the same
> problem
>  > > at two different places.
>  >
>  > Yes and no. The mp_cut changes will only affect how polygons are cut
>  > when they are part of a multipolygon. But there are many polygons that
>  > are not.
>  > On the other hand I also use the algorithm of the RoundCoordsFilter in
>  > the mp_cut branch (not yet committed) and therefore observe exactly the
>  > same problems. So improving the RoundCoordsFilter algo will also solve
>  > problems in the mp_cut branch.
>
> OK. The RoundCoordsFilter really looks a bit brutal ;-)
>
> Gerd
>



More information about the mkgmap-dev mailing list