Skip to content

Commit

Permalink
changed _get_raster_contour_single_window
Browse files Browse the repository at this point in the history
  • Loading branch information
felicio93 committed Jun 18, 2024
1 parent 6b042ff commit ff0cc8c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ocsmesh/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,15 +1455,18 @@ def _get_raster_contour_single_window(
ax.contour(x, y, values, levels=[level])
_logger.debug(f'Took {time()-start}...')
plt.close(fig)
for path_collection in ax.collections:
for path in path_collection.get_paths():
# LineStrings must have at least 2 coordinate tuples
if len(path.vertices) < 2:
continue
try:
features.append(LineString(path.vertices))
except ValueError:
pass

for path_collection in ax.collections[:]:
for path in path_collection.allsegs:
# LineStrings must have at least 2 coordinate tuples
for p in path:
if len(p) < 2:
continue
try:
features.append(LineString(p))
except ValueError:
pass

return ops.linemerge(features)

def _get_raster_contour_feathered(
Expand Down

0 comments on commit ff0cc8c

Please sign in to comment.