logo separator

[mkgmap-dev] [PATCH v1] preserve edges introduced by clipping and splitting

From Mark Burton markb at ordern.com on Sun Jan 17 17:35:23 GMT 2010

Hello Johann,

> I have not tested this patch. I expect it to work, but I think it is a 
> suboptimal solution.

I make no claims that it is optimal. Merely, that it's "cheap and
cheerful". It achieves the desired aim with very little computational
overhead.
 
> You set the preserve bit on all lines which are exactly horizontal or 
> vertical.
> Wouldn't it be cleaner way, to set the preserved bit at the place, where 
> the new nodes are generated, i.e. in the clipping code?

Yes, that can be done when clipping and my first attempt at
writing this patch did exactly that. Unfortunately, that doesn't work
for split polygons because in the splitter, you don't know which
points are on the boundary and which are not (although that probably
could be determined at some cost).
 
> This bit may be set in the multipolygon code too at the newly introduced 
> cuts. (which are not vertical btw.)
> 

I believe they are vertical/horizontal in the new MP code but that's
irrelevant anyway as the preserve bit could easily be set on the points
by the MP engine.

> This may be a little more work, but a clean design will always pay out.

Cleanliness is in the eye of the beholder.

Mark



More information about the mkgmap-dev mailing list