You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm still getting the "can't create multiline string with empty component and I'm not sure why. I updated ocsmesh main branch using pip install and adding both code snippets for the hold and the matplotlib package. Here is what the error code says:
Traceback (most recent call last):
File "/mnt/projects/hpc/mattwig/grid/ocsmesh/usace_dem.py", line 123, in <module>
hfun_r1.add_contour(level=ref_r1+50, expansion_rate=0.05, target_size=150)
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/ocsmesh/features/constraint.py", line 403, in wrapped
rv = method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/ocsmesh/hfun/raster.py", line 1022, in add_contour
_contours = self.raster.get_contour(_level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/ocsmesh/raster.py", line 1371, in get_contour
return self._get_raster_contour_feathered(level, iter_windows)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/ocsmesh/raster.py", line 1497, in _get_raster_contour_feathered
results = self._get_raster_contour_feathered_internal(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/ocsmesh/raster.py", line 1559, in _get_raster_contour_feathered_internal
features = ops.linemerge(features)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/shapely/ops.py", line 108, in linemerge
source = MultiLineString([ls.coords for ls in lines])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mattwig/miniconda3/envs/ocsmesh/lib/python3.11/site-packages/shapely/geometry/multilinestring.py", line 52, in __new__
raise EmptyPartError(
shapely.errors.EmptyPartError: Can't create MultiLineString with empty component
SorooshMani-NOAA
changed the title
Getting contours from raster in chunks can result in EmptyPartErrorEmptyPartError in get_contour when chunked
Jan 23, 2024
Originally posted by @melissamattwig in #127 (reply in thread)
The text was updated successfully, but these errors were encountered: