logo separator

[mkgmap-dev] shapes with holes

From GerdP gpetermann_muenchen at hotmail.com on Sat Jan 19 09:00:08 GMT 2013

Hi WanMil,

WanMil wrote
> 1. RoundCoordsFilter creates an invalid polygon with hole
> 2. PolygonSplitterFilter might split the polygon because it is too 

> large. It converts the polygon to a java.awt.geom.Area object, splits it 
> into two halves and converts it back in the method 
> PolygonSplitterBase.areaToShapes(..) method. This method does not check 
> the orientation of the returned polygons and therefore converts the hole 
> to same type the polygon has - in other words the hole is removed.

I thought about this again and I think it might be the solution for the
mp-cut 
problem:
We don't have to cut out inner polygons, instead we can connect each inner 
polygon with the outer one. We have to find two points:
p1, a point on the outer way that is close to a point of the inner polygon,
which
is then called p2.
Now, we have to split the outer way at p1, draw a line to p2, add the points
of 
the inner polygon, and draw a way back from p2 to p1.
It works (QLandkarte shows the polygon with a hole), but only when 
none of the filters destroys the added ways between p1 and p2.

I don't know yet how multiple nested polygons look like, but I think it is a
promising approach.

Gerd




--
View this message in context: http://gis.19327.n5.nabble.com/shapes-with-holes-tp5745424.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.


More information about the mkgmap-dev mailing list