
Geometry : 
Subject: Re: [geometry] difference algorithm produces invalid polygon?
From: Volker Schöch (vschoech_at_[hidden])
Date: 20120222 06:27:53
Hi Barend,
> Thanks for all your reports!
Here we go again... It may be the same root problem as with my last report, but the polygons are of a different kind (manhattanlike) 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)))
A1B1: MULTIPOLYGON(((2083 1968,2083 1071,3693 1071,3693 2868,2083 2868,2083 1968,2301 1968)))
A2: A1B1
B2: MULTIPOLYGON(((2079 1968,2301 1968,2301 1968,2079 1968)))
A2B2: Boost.Geometry Overlay invalid input exception
The problem cannot be fixed by applying boost::geometry::correct on the output from boost::geometry::difference. Actually, in the data above, "AB" is the result of applying "difference" to A and B and applying "correct" to the result.
I am still using boost 1.48.0, my polygon type is oriented counterclockwise 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 hotfix or workaround this issue in the meantime would be very welcome.
Regards,
Volker
 Volker Schöch  vschoech_at_[hidden] Senior Software Engineer thinkcell Software GmbH  Chausseestr. 8/E  10115 Berlin  Germany http://www.thinkcell.com  phone +49 30 66647310  US phone +1 800 891 8091 Amtsgericht BerlinCharlottenburg, HRB 85229  European Union VAT Id DE813474306 Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl
Geometry list run by mateusz at loskot.net