Skip to content

Commit

Permalink
Fix shapely deprecation (and traceback)
Browse files Browse the repository at this point in the history
The traceback was coming from datasets with empty
geometry collections. Moving to the non-deprecated
alternative fixed the exception.
  • Loading branch information
jeremyh committed Jan 12, 2022
1 parent c4ecf55 commit a3ce478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cubedash/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def dataset_shape(ds: Dataset) -> Tuple[Optional[Polygon], bool]:
if extent is None:
log.warn("invalid_dataset.empty_extent")
return None, False
geom = shapely.geometry.asShape(extent.to_crs(CRS(_TARGET_CRS)))
geom = shape(extent.to_crs(CRS(_TARGET_CRS)))

if not geom.is_valid:
log.warn(
Expand Down

0 comments on commit a3ce478

Please sign in to comment.