Boost logo

Geometry :

Subject: [ggl] Difference / xor for multi polygons
From: Barend Gehrels (barend)
Date: 2011-03-06 05:24:05

Hi Javier,

Thanks for testing again.

On 6-3-2011 0:53, Javier Gonzalez wrote:
> Ok, I have good news and bad news.
> The good news is that such test case now works properly :)


> The bad ones is that I found another faulty test case, this time with

I cannot reproduce this one (my testcode here: <> ) . I closed
the polygons manually but that makes no difference for me. It gives me
two rings, an outer ring and an inner ring. This is the output (not in

(green: p1, blue: p2, orange: output including inner ring)

area: 80456.5
POLYGON((-2 2,2002 2,2002 -2002,-2 -2002,-2 2) , (0 -182,0 -2000,2000
-2000,2000 0,104 0,440 -240,400.002 -279.998,400.01 -280,400 -280,359.99
-280,359.99 -280,0 -182))
> And once more using the multipolygon version of the union even though
> the inputs are single polygons (if that matters)

That should not differ. I tried single polygon input only.

> I hope I didn't make a typo, that's some amount of numbers...

If possible, please report me a WKT (see code from codepad) for errors,
that avoids typo's and is convenient to read and write.

One thing, I made an additional fix yesterday, after sending my mail. My
testprograms found something for counterclockwise direction. It might be
that this influences the behaviour of this case to. So please update
again from the Trunk...

I'm still working on a case in difference, having multiple
self-tangencies. I'm not announcing every commit to this list because
there are many per day.

Again, thanks for testing and I really appreciate this. I've hundreds of
tests, including 5 random tests, and with help of that I'm testing
millions of cases, but apparently there can still slip things through.
As far as I know union and intersection are completely running for all
combinations of rings,polygons,multipolygons and for self-tangencies,
open rings, closed rings, clockwise and counterclockwise, as requested
in the review report. I hope to solve the self-tangencies in difference

Regards, Barend

Barend Gehrels
-------------- next part --------------
Skipped content of type multipart/related

Geometry list run by mateusz at