Skip to content

Commit

Permalink
Bugfix for resegmenting linestring when target size is larger than li…
Browse files Browse the repository at this point in the history
…nestring
  • Loading branch information
SorooshMani-NOAA committed Jan 17, 2024
1 parent 318860d commit c30ebe6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ocsmesh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def transform_linestring(
):
lstr_len = linestring.length
distances = np.cumsum(np.ones(int(lstr_len // target_size)) * target_size)
if len(distances) == 0:
return linestring
if distances[-1] < lstr_len:
distances = np.append(distances, lstr_len)

Expand Down

0 comments on commit c30ebe6

Please sign in to comment.