Skip to content

Commit

Permalink
Fix TaggedLineString as per JTS 1096
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Nov 5, 2024
1 parent 23207e9 commit 3dd3b85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/simplify/TaggedLineString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ TaggedLineString::extractCoordinates(

if(size) {
for(std::size_t i = 0; i < size; i++) {
TaggedLineSegment* seg = segs[i];
TaggedLineSegment* seg = segs[i];
assert(seg);
pts->add(seg->p0);
}
Expand All @@ -185,7 +185,6 @@ TaggedLineString::extractCoordinates(
const Coordinate&
TaggedLineString::getCoordinate(std::size_t i) const
{

return parentLine->getCoordinateN(i);
}

Expand All @@ -198,6 +197,10 @@ TaggedLineString::size() const
const Coordinate&
TaggedLineString::getComponentPoint() const
{
//-- when simplified use a valid coordinate
if (resultSegs.size() > 0) {
return resultSegs[0]->p0;
}
return getParentCoordinates()->getAt(1);
}

Expand Down

0 comments on commit 3dd3b85

Please sign in to comment.