# Geometry :

Subject: Re: [geometry] "Overlay invalid input exception", another example
From: Volker Schöch (vschoech_at_[hidden])
Date: 2012-05-18 14:56:18

Hi Barend,
here is another instance of presumably the same problem. Just in case you'd like some more data for testing. 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

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Reproduction:

Step 1
A1 = MULTIPOLYGON(((528 3314,1734 2054,2934 1670,4140 1754,5340 2072,5340 32767,528 32767)))
B1 = (((528 3218,1734 1784,2934 1400,4140 2582,5340 1832,5340 32767,528 32767)))
boost::geometry::sym_difference( A1, B1 ) = MULTIPOLYGON(((3230 1690,4140 1754,5070 2000,4140 2582)),((528 3314,528 3218,1734 1784,2934 1400,3230 1690,2934 1670,1734 2054)),((5340 2072,5070 2000,5340 1832)))

Step 2
A2 = MULTIPOLYGON(((529 998,5337 998,5337 3475,529 3475)))
B2 = Result from Step 1
boost::geometry::difference( A2, B2 ) = (((529 3216,529 998,5337 998,5337 1833,5070 2000,5337 2071,5337 3475,529 3475,529 3312,1734 2054,2934 1670,3230 1690,2934 1400,1734 1784),(4140 2582,5070 2000,4140 1754,3230 1690)))

Step 3
A3 = MULTIPOLYGON(((528 3218,1734 1784,2934 1400,4140 2582,5340 1832,5340 32767,528 32767)))
B3 = MULTIPOLYGON(((528 2498,1734 1406,2934 1574,4140 3002,5340 1178,5340 32767,528 32767)))
boost::geometry::sym_difference( A3, B3 ) = MULTIPOLYGON(((4609 2288,4140 3002,2934 1574,2555 1521,2934 1400,4140 2582)),((528 3218,528 2498,1734 1406,2555 1521,1734 1784)),((5340 1832,4609 2288,5340 1178)))

Step 4
A4 = Result from Step 2
B4 = Result from Step 3
boost::geometry::difference( A4, B4 ) = MULTIPOLYGON(((2555 1521,1734 1784,2555 1521,1734 1406,529 2497,529 998,5337 998,5337 1182,4838 1938,4140 1754,3230 1690,4140 2582,3229 1689,3230 1690,2934 1400)),((3019 1675,4140 3002,4608 2288,4856 2133,5070 2000,5337 2071,5337 3475,529 3475,529 3312,1734 2054,2934 1670)))

Step 5
A5 = MULTIPOLYGON(((528 2498,1734 1406,2934 1574,4140 3002,5340 1178,5340 32767,528 32767)))
B5 = MULTIPOLYGON(((528 2420,1734 2186,2934 2378,4140 2750,5340 1250,5340 32767,528 32767)))
boost::geometry::sym_difference( A5, B5 ) = MULTIPOLYGON(((5340 1250,5073 1583,5340 1178)),((3852 2661,2934 2378,1734 2186,637 2398,1734 1406,2934 1574)),((528 2498,528 2420,637 2398)),((5073 1583,4140 3002,3852 2661,4140 2750)))

Step 6
A4 = Result from Step 4
B4 = Result from Step 5
boost::geometry::difference( A6, B6 ) = MULTIPOLYGON(((2555 1520,1734 1406,637 2398,638 2397,535 2490,637 2398,529 2419,529 998,5337 998,5337 1182,5069 1587,4797 1927,4140 1754,3230 1690,4140 2582,3229 1689,3230 1690,2934 1400)),((1578 2215,1734 2186,2934 2378,3851 2660,4140 3002,4610 2286,4856 2133,5070 2000,5337 2071,5337 3475,529 3475,529 3312)))

Step 7
A5 = MULTIPOLYGON(((528 2420,1734 2186,2934 2378,4140 2750,5340 1250,5340 32767,528 32767)))
B5 = MULTIPOLYGON(((528 1724,1734 2552,2934 1640,4140 2396,5340 1460,5340 32767,528 32767)))
boost::geometry::sym_difference( A7, B7 ) = MULTIPOLYGON(((5340 1460,4893 1808,5340 1250)),((2131 2249,1734 2552,1318 2266,1734 2186)),((528 2420,528 1724,1318 2266)),((4893 1808,4140 2750,2934 2378,2131 2249,2934 1640,4140 2396)))

Step 8
A6 = Result from Step 6
B6 = Result from Step 7
boost::geometry::difference( A8, B8 ): 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