Boost logo

Geometry :

Subject: Re: [geometry] "Overlay invalid input exception" inboost::geometry::difference (CORRECTION)
From: Volker Schöch (vschoech_at_[hidden])
Date: 2012-04-20 08:27:18


Hi again,
I apologize, I reported the wrong trace. Here is the correct trace:

-----------------------
A1: MULTIPOLYGON(((807 152,3958 152,3958 576,807 576)))
B1: MULTIPOLYGON(((813 277,813 235,1341 235)),((3963 277,3441 235,3963 235)))

boost::geometry::difference(A1, B1):
MULTIPOLYGON(((3958 276,3958 576,807 576,807 152,3958 152,3958 235,3441 235),(1341 235,813 235,813 277)))

-----------------------
A2: Result from (1)
B2: MULTIPOLYGON(((3963 277,3441 319,2913 235,3441 235)),((2391 403,1863 235,1341 319,813 277,1341 235,1863 151)))

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

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

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

-----------------------
A4: Result from (3)
B4: MULTIPOLYGON(((2913 361,2391 571,1863 361,2391 403)))

boost::geometry::difference(A4, B4)
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)))

-----------------------
A5: MULTIPOLYGON(((813 277,1341 319,1863 361,2391 571,2913 361,3441 319,3963 277,3963 32767,813 32767)))
B5: MULTIPOLYGON(((813 277,1341 319,1863 571,2391 571,2913 571,3441 319,3963 277,3963 32767,813 32767)))

boost::geometry::sym_difference(A5, B5): // SYM_DIFF!
MULTIPOLYGON(((2391 571,1863 571,1341 319,1863 361)),((2391 571,2913 361,3441 319,2913 571)))

-----------------------
A6: Result from (4)
B6: Result from (5)

boost::geometry::difference(A6, B6)
-> 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