Boost logo

Geometry :

Subject: [ggl] Quick question about bg::difference
From: V D (zedxz2)
Date: 2011-10-25 18:01:12


Hi Barend,

Just a follow-up on this issue.

Let's consider the case where MP and P are not disjoint.
bg::difference(MP, P) will lose any polygon in MP that is disjoint with P.

Example with images:

Say the MP is the 2 squares below and P is the blue-ish rectangle.

The output should be something similar to:

But the actual output will be:

I will provide WKT and code when I have a few minutes ;)
-v

On Oct 25, 2011, at 10:41 AM, Barend Gehrels wrote:

> Hi,
>
> On 24-10-2011 23:37, V D wrote:
>> Hum, after running more test cases here is what seems to happen:
>>
>> bg::difference(MultiPolygon, Polygon) and bg::difference(Polygon, MultiPolygon) will return always return the polygon if they are disjoint.
>> bg::difference(Polygon, Polygon) will always return the 1st polygon if they are disjoint.
>>
>
> Thanks. Yes, I could reproduce it and you are right. We have to fix this.
>
> If we support 8 geometry types, there are (theoretically) 64 possibilities for difference, and all other algorithms having two input arguments. We therefore try to limit this by automatically reversing arguments, so MultiPolygon/Polygon will be reversed to Polygon/MultiPolygon. I never realized or thought about it (blame me) that for difference this of course can never be done.
>
> So will fix this a.s.a.p. Thanks for the report.
>
> Regards, Barend
>
>
> _______________________________________________
> ggl mailing list
> ggl_at_[hidden]
> http://lists.osgeo.org/mailman/listinfo/ggl

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


Geometry list run by mateusz at loskot.net