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