Here is another example:

polygonA = "MULTIPOLYGON(((1920 1660,1920 1462,3720 1462,3720 3262,1920 3262,1920 1958,2218 2189,1920 1660),(3718 1561,3360 2233,3718 1957,3718 1561),(2818 2653,2218 2189,2818 3253,3360 2233,2818 2653)))"

polygonB = "MULTIPOLYGON(((1918 2155,1918 1957,2818 2653,3718 1957,3718 2154,2818 3055,1918 2155)))"

 

difference(polygonA, polygonB, polygonC)

-> polygonC == MULTIPOLYGON(((2218 2189,1920 1660,1920 1462,3720 1462,3720 3262,1920 3262,1920 2157,2562 2799,2818 3253,3043 2829,3718 2154,3718 1957,3718 1561,3360 2233,3718 1957,3360 2234,3360 2233,2818 2653,2218 2189)))

 

Both, polygonA and polygonB, satisfy is_valid(…), but polygonC doesn’t.

Regards

   Volker

 

 

--
Volker Schöch | vschoech@think-cell.com
Senior Software Engineer


We are looking for C++ Developers: http://www.think-cell.com/career

From: Geometry [mailto:geometry-bounces@lists.boost.org] On Behalf Of Volker Schöch
Sent: Montag, 17. November 2014 17:24
To: Boost.Geometry library mailing list (geometry@lists.boost.org)
Subject: [geometry] difference algorithm yields invalid multi-polygon

 

polygonA = MULTIPOLYGON(((1701 985,3501 985,3501 2785,1701 2785,1701 985)))

polygonB = MULTIPOLYGON(((1698 1860,1698 1122,2598 1392,3492 1842,3492 32706,2598 2340,1698 1860)))

 

difference(polygonA, polygonB, polygonC)

-> polygonC == MULTIPOLYGON(((1701 1122,1701 985,3501 985,3501 2785,3492 1857,3492 1842,2598 1392,1701 1122)),((1701 1861,2598 2340,1669 2785,1701 2785,1701 1861)))

 

Both, polygonA and polygonB, satisfy is_valid(…), but polygonC doesn’t.

Is there anything wrong with the input? Is this a bug?

 

Regards

   Volker

--
Volker Schöch | vschoech@think-cell.com
Senior Software Engineer


We are looking for C++ Developers: http://www.think-cell.com/career


think-cell Software GmbH

http://www.think-cell.com

Chausseestr. 8/E

phone / fax

+49 30 666473-10 / -19

10115 Berlin, Germany

US phone / fax

+1 800 891 8091 / +1 212 504 3039

Amtsgericht Berlin-Charlottenburg, HRB 85229 | European Union VAT Id DE813474306

Directors: Dr. Markus Hannebauer, Dr. Arno Schödl