diff --git a/src/algorithm/hull/ConcaveHullOfPolygons.cpp b/src/algorithm/hull/ConcaveHullOfPolygons.cpp index d0ab8e4265..6ed54fb0ac 100644 --- a/src/algorithm/hull/ConcaveHullOfPolygons.cpp +++ b/src/algorithm/hull/ConcaveHullOfPolygons.cpp @@ -156,7 +156,7 @@ ConcaveHullOfPolygons::setTight(bool p_isTight) std::unique_ptr ConcaveHullOfPolygons::getHull() { - if (inputPolygons->isEmpty()) { + if (inputPolygons->isEmpty() || inputPolygons->getArea() == 0) { return createEmptyHull(); } buildHullTris(); diff --git a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp index 57c6a0b9c1..2cd039fb58 100644 --- a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp +++ b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp @@ -62,6 +62,15 @@ void object::test<3>() result_ = GEOSConcaveHullOfPolygons(input_, 0.7, false, false); ensure("curved geometry not supported", result_ == nullptr); } + +template<> +template<> +void object::test<4>() +{ + input_ = fromWKT("POLYGON((0 0, 0 0, 0 0))"); + result_ = GEOSConcaveHullOfPolygons(input_, 0.7, false, false); + ensure(GEOSisEmpty(result_)); +} } // namespace tut