Boost logo

Geometry :

Subject: [geometry] difference algorithm yields invalid multi-polygon
From: Volker Schöch (vschoech_at_[hidden])
Date: 2014-11-17 11:24:05


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_at_[hidden]<mailto:vschoech_at_[hidden]>
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


Geometry list run by mateusz at loskot.net