Boost logo

Geometry :

Subject: Re: [geometry] difference algorithm produces invalid polygon?
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-02-22 13:43:33


Hi Volker,

On 22-2-2012 12:27, Volker Schöch wrote:
>
> Here we go again... It may be the same root problem as with my last report, but the polygons are of a different kind (manhattan-like) so I just submit it to your data base to offer one more test case:
>
> A1: MULTIPOLYGON(((2083 1071,3693 1071,3693 2868,2083 2868)))
> B1: MULTIPOLYGON(((2079 1968,2301 1968,2301 1968,2079 1968)))
> A1-B1: MULTIPOLYGON(((2083 1968,2083 1071,3693 1071,3693 2868,2083 2868,2083 1968,2301 1968)))

This one is different. B1 repeats "2301 1968,2301 1968 " which makes it
a polygon of basically only two distinct points, which is always invalid.

So this is truly invalid input. The output is therefore also expected to
be invalid.

> A2: A1-B1
> B2: MULTIPOLYGON(((2079 1968,2301 1968,2301 1968,2079 1968)))

B2 does have the same problem as B1 (or better stated: it is the same
polygon).

> I am still using boost 1.48.0, my polygon type is oriented counter-clockwise and not closed, my point type is based on int.
>
> Again, while you may need some time to come up with a fix for the root cause (and boost 1.50 is many months away), any suggestions to hot-fix or work-around this issue in the meantime would be very welcome.
>

Sure, as soon there is a fix, it will be applied to Trunk.

But this one will not be fixed - we might enhance the error messages.

Regards, Barend


Geometry list run by mateusz at loskot.net