Boost logo

Geometry :

Subject: [ggl] Difference / xor for multi polygons
From: Javier Gonzalez (xaviergonz)
Date: 2011-03-06 22:15:35


Nice! that change actually solved some artifacts I was getting (compared to
the clipper and GPC versions).

Unfortunately, here's another faulty case

UNION of:

POLYGON((-2 2, 1842 2, 1842 -2362, -2 -2362, -2 2), (0 0, 0 -2360, 1840
-2360, 1840 0, 0 0))

with:

POLYGON((-0.01 -1960, 0 -1960, 0 -1880, 80.01 -1960, -0.01 -1960))

gives
POLYGON((-2 2, 1842 2, 1842 -2362, -2 -2362, -2 2))

should give (at least using clipper)
POLYGON((-1.999999 -2362, -1.999999 1.999999, 1842 1.999999, 1842 -2362,
-1.999999 -2362), (0 -2360, 1840 -2360, 1840 0, 0 0, 0 -1880, 80.01 -1960, 0
-1960, 0 -2360))

On Sun, Mar 6, 2011 at 10:35 PM, Barend Gehrels <barend_at_[hidden]> wrote:

> Hi Javier,
>
> OK, should be solved now. A little complex to explain, but it was a
> robustness problem in coordinate intersection, by which a wrong intersection
> point was generated. I didn't touch that file for a long time so I'm glad
> this is solved now - I've to study it for possibly similar cases. Your case
> is added to the testsuite to prevent happening again, thanks for it.
>
> So what I told earlier is wrong, for float it was OK because not exactly
> triggered by the problem above, for ttmath these kind of things should not
> occur, and for double this one is solved now.
>
> Hoping you can continue now, but in case of more problems, reports are
> welcome, I appreciate your tests.
>
> Regards, Barend
>
>
>
>
> On 6-3-2011 18:17, Barend Gehrels wrote:
>
>> Hi Javier,
>>
>> Right, now I get the same. The error occurs only for double. For float it
>> is OK (but that is by chance), for ttmath it is also OK (that is as
>> intended). The differences in coordinates are so small that for double they
>> probably cannot be represented, but this is my preliminary conclusion. I
>> will check if I can get extra information, and if there are even possible
>> solutions. This can take me a while.
>>
>> For checking coordinates like this, I would advice to use ttmath.
>>
>> Interesting tests.
>>
>> Regards, Barend
>>
>>
>>
>
> --
> Barend Gehrels
> http://about.me/barendgehrels
>
> _______________________________________________
> ggl mailing list
> ggl_at_[hidden]
> http://lists.osgeo.org/mailman/listinfo/ggl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20110307/c548a1dd/attachment.html


Geometry list run by mateusz at loskot.net