Boost logo

Geometry :

Subject: [geometry] "Overlay invalid input exception" in boost::geometry::difference
From: Volker Schöch (vschoech_at_[hidden])
Date: 2012-04-20 07:55:41


Hi Barend!
Something went wrong again:

A1: MULTIPOLYGON(((807 152,3958 152,3958 288,807 288)))
B1: MULTIPOLYGON(((804 210,804 150,2382 174,3954 210,3954 258,2382 252)))

boost::geometry::difference(A1, B1):
MULTIPOLYGON(((807 210,2382 252,3954 258,3954 210,2382 174,935 152,3958 152,3958 288,807 288)))

A2: Result from (1)
B2: MULTIPOLYGON(((804 288,804 210,2382 252,3954 258,3954 287)))

boost::geometry::difference(A2, B2):
MULTIPOLYGON(((3441 235,3958 276)),((1863 361,2391 571,2913 361,3441 319,3958 277,3958 576,807 576,807 152,1856 152,1341 235,813 235,813 277,1341 319)),((2391 403,1865 152,3958 152,3958 235,3441 235,2913 235)))

A3: Result from (2)
B3: MULTIPOLYGON(((2391 571,1863 571,1341 319,1863 361)),((2391 571,2913 361,3441 319,2913 571)))

boost::geometry::difference(A3, B3)
-> Boost.Geometry Overlay invalid input exception

As always, I am using boost 1.48.0, my polygon type is oriented counter-clockwise and not closed, my point type is based on int.
Regards,
   Volker

--
Volker Schöch | vschoech_at_[hidden]
Senior Software Engineer
think-cell Software GmbH | Chausseestr. 8/E | 10115 Berlin | Germany
http://www.think-cell.com | phone +49 30 666473-10 | US phone +1 800 891 8091
Amtsgericht Berlin-Charlottenburg, HRB 85229 | European Union VAT Id DE813474306
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl

Geometry list run by mateusz at loskot.net