Skip to content

Commit

Permalink
On enableKeepPartialLinestring, output a closed linestring if the ori…
Browse files Browse the repository at this point in the history
…ginal way is closed even on missing start/end node #133
  • Loading branch information
frodrigo committed Jul 16, 2023
1 parent 447e5df commit a3484ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ public LineString createWayLinestring(Way way, boolean enableKeepPartialLinestri
}
}

if (enableKeepPartialLinestring && way.isClosed() && linePoints.size() > 0
&& !linePoints.get(0).equals(linePoints.get(linePoints.size() - 1))) {
linePoints.add(linePoints.get(0));
}

if (numValidNodes >= 2) {
return createLinestring(linePoints);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ public LineString createWayLinestring(Way way, boolean enableKeepPartialLinestri
}
}
}

if (enableKeepPartialLinestring && way.isClosed() && linePoints.size() > 0
&& !linePoints.get(0).equals(linePoints.get(linePoints.size() - 1))) {
linePoints.add(linePoints.get(0));
}

return createLinestring(linePoints);
}

Expand Down

0 comments on commit a3484ff

Please sign in to comment.