diff --git a/src/algorithm/InteriorPointPoint.cpp b/src/algorithm/InteriorPointPoint.cpp index 6fb48f397..9070aa670 100644 --- a/src/algorithm/InteriorPointPoint.cpp +++ b/src/algorithm/InteriorPointPoint.cpp @@ -47,6 +47,9 @@ InteriorPointPoint::InteriorPointPoint(const Geometry* g) void InteriorPointPoint::add(const Geometry* geom) { + if (geom->isEmpty()) + return; + const Point* po = dynamic_cast(geom); if (po) { add(po->getCoordinate()); diff --git a/tests/xmltester/tests/general/TestInteriorPoint.xml b/tests/xmltester/tests/general/TestInteriorPoint.xml index 0d765caca..23b4a8705 100644 --- a/tests/xmltester/tests/general/TestInteriorPoint.xml +++ b/tests/xmltester/tests/general/TestInteriorPoint.xml @@ -14,12 +14,19 @@ - P - single point + P - multipoint MULTIPOINT ((60 300), (200 200), (240 240), (200 300), (40 140), (80 240), (140 240), (100 160), (140 200), (60 200)) POINT (140 240) + + P - multipoint with EMPTY + MULTIPOINT((0 0), EMPTY) + + POINT (0 0) + + L - linestring with single segment LINESTRING (0 0, 7 14)