Skip to content

Commit

Permalink
Fix issue #1191
Browse files Browse the repository at this point in the history
Fix the bug in LineString::getPointN, which causes the output point of GEOSGeomGetEndPoint loses the 'm' dimension
  • Loading branch information
hsieyuan authored Nov 15, 2024
1 parent 51c3b3d commit ef16ff8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/geom/LineString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ LineString::getPointN(std::size_t n) const
{
assert(getFactory());
assert(points.get());
return std::unique_ptr<Point>(getFactory()->createPoint(points->getAt(n)));
if (hasM())
return std::unique_ptr<Point>(getFactory()->createPoint(points->getAt<CoordinateXYZM>(n)));
else if (hasZ())
return std::unique_ptr<Point>(getFactory()->createPoint(points->getAt<Coordinate>(n)));
else
return std::unique_ptr<Point>(getFactory()->createPoint(points->getAt<CoordinateXY>(n)));
}

std::unique_ptr<Point>
Expand Down

0 comments on commit ef16ff8

Please sign in to comment.