# Geometry :

Subject: [geometry] "Overlay invalid input exception", another example
From: Volker Schöch (vschoech_at_[hidden])
Date: 2012-05-08 06:24:00

Hi Barend,
here we go again. 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.

Please let me know if 1.49 has this fixed, and/or if it will be fixed in 1.50.

Regards,
Volker

Reproduction:

Step 1
A1 = MULTIPOLYGON(((966 2862,1704 3348,2442 3186,3180 2376,3912 1722,4650 1398,5388 1560,5388 32767,966 32767)))
B1 = MULTIPOLYGON(((966 2700,1704 3348,2442 3186,3180 2376,3912 1884,4650 1398,5388 1560,5388 32767,966 32767)))
boost::geometry::sym_difference( A1, B1 ) = MULTIPOLYGON(((4650 1398,3912 1884,3180 2376,3912 1722)),((966 2862,966 2700,1704 3348)))

Step 2
A2 = MULTIPOLYGON(((971 1402,5395 1402,5395 3353,971 3353)))
B2 = Result from Step 1
boost::geometry::difference( A2, B2 ) = MULTIPOLYGON(((971 2704,971 1402,4640 1402,3912 1722,3180 2376,3912 1884,4643 1402,5395 1402,5395 3353,971 3353,971 2865,1704 3348)))

Step 3
A3 = MULTIPOLYGON(((966 2700,1704 3348,2442 3186,3180 2376,3912 1884,4650 1398,5388 1560,5388 32767,966 32767)))
B3 = MULTIPOLYGON(((966 2700,1704 3024,2442 3186,3180 2376,3912 1884,4650 1722,5388 1560,5388 32767,966 32767)))
boost::geometry::sym_difference( A3, B3 ) = MULTIPOLYGON(((5388 1560,4650 1722,3912 1884,4650 1398)),((2442 3186,1704 3348,966 2700,1704 3024)))

Step 4
A4 = Result from Step 2
B4 = Result from Step 3
boost::geometry::difference( A4, B4 ) = MULTIPOLYGON(((1704 3348,2442 3186,1704 3024,971 2702,971 1402,4640 1402,3912 1722,3180 2376,3912 1884,4650 1722,5388 1560,4668 1402,5395 1402,5395 3353,971 3353,971 2865),(4643 1402,3912 1884)))

Step 5
A5 = MULTIPOLYGON(((966 2700,1704 3024,2442 3186,3180 2376,3912 1884,4650 1722,5388 1560,5388 32767,966 32767)))
B5 = MULTIPOLYGON(((966 2208,1704 3024,2442 3186,3180 2376,3912 2376,4650 1722,5388 1560,5388 32767,966 32767)))
boost::geometry::sym_difference( A5, B5 ) = MULTIPOLYGON(((3180 2376,3912 1884,4650 1722,3912 2376)),((966 2700,966 2208,1704 3024)))

Step 6
A6 = Result from Step 4
B6 = Result from Step 5
boost::geometry::difference( A6, B6 ): Boost.Geometry Overlay invalid input exception

```--
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