diff --git a/src/algorithm/hull/ConcaveHullOfPolygons.cpp b/src/algorithm/hull/ConcaveHullOfPolygons.cpp index a774cf6f0f..db8c354363 100644 --- a/src/algorithm/hull/ConcaveHullOfPolygons.cpp +++ b/src/algorithm/hull/ConcaveHullOfPolygons.cpp @@ -153,7 +153,7 @@ ConcaveHullOfPolygons::setTight(bool p_isTight) std::unique_ptr ConcaveHullOfPolygons::getHull() { - if (inputPolygons->isEmpty()) { + if (inputPolygons->isEmpty() || inputPolygons->getEnvelopeInternal()->getArea() == 0) { return createEmptyHull(); } buildHullTris(); diff --git a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp index 8de6baf542..22f6c2cfc6 100644 --- a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp +++ b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp @@ -52,6 +52,14 @@ void object::test<2>() ensure_geometry_equals(geom1_, expected_); } +template<> +template<> +void object::test<3>() +{ + input_ = fromWKT("POLYGON((0 0, 0 0, 0 0))"); + result_ = GEOSConcaveHullOfPolygons(input_, 0.7, false, false); +} + } // namespace tut