[geos-devel] Bug in GEOS polygonizer
strk at keybit.net
Fri Mar 7 10:57:20 PST 2014
On Fri, Mar 07, 2014 at 08:46:49PM +0200, Mika Heiskanen wrote:
> On 03/07/2014 07:58 PM, Sandro Santilli wrote:
> >The polygonizer function will return a polygon with an hole
> >and the polygon filling the hole. It's the expected behavior.
> I see now that you are right:
> I was not aware that getting the same polygon twice in
> the output was a common requirement in GIS.
You don't get the polygon twice, you get the _ring_ twice,
once with the role of a shell (outer ring) and one with the
role of an hole (inner ring).
> However, that is not convenient when converting the output
> to SVG. Looks like I'll have to discard any polygon with
> even parity. I'll try to find out how that can be done.
> A quick grep does not reveal anything though, any tips on how to
> accomplish dropping the extra polygons as far as SVG is concerned
> would be appreciated. Seems like the feature mentioned in
> the above link has not been implemented, at least not in GEOS.
You may see if Martin Davis ever added that support to the JTS
side of things. If so, it would be nice to port over.
In PostGIS you can find a function that does what you need,
it's called "BuidArea". It was also recently improved:
() ASCII ribbon campaign -- Keep it simple !
More information about the geos-devel