From ef16ff831d0dce2ce8a62fa4a55097a433a9fa52 Mon Sep 17 00:00:00 2001 From: hsieyuan Date: Fri, 15 Nov 2024 14:45:52 +0800 Subject: [PATCH] Fix issue #1191 Fix the bug in LineString::getPointN, which causes the output point of GEOSGeomGetEndPoint loses the 'm' dimension --- src/geom/LineString.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/geom/LineString.cpp b/src/geom/LineString.cpp index e3c84c3dc8..c7cfa9669d 100644 --- a/src/geom/LineString.cpp +++ b/src/geom/LineString.cpp @@ -181,7 +181,12 @@ LineString::getPointN(std::size_t n) const { assert(getFactory()); assert(points.get()); - return std::unique_ptr(getFactory()->createPoint(points->getAt(n))); + if (hasM()) + return std::unique_ptr(getFactory()->createPoint(points->getAt(n))); + else if (hasZ()) + return std::unique_ptr(getFactory()->createPoint(points->getAt(n))); + else + return std::unique_ptr(getFactory()->createPoint(points->getAt(n))); } std::unique_ptr