Skip to content

Commit

Permalink
raise error if coordinates isn't a valid polygon, wkt/wkb, or list of…
Browse files Browse the repository at this point in the history
… coordinates
  • Loading branch information
iamdonovan committed Apr 1, 2024
1 parent 75620bf commit c8d1ef0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions earthaccess/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ def polygon(
geom = shapely.from_wkt(coordinates)
elif shapely.from_wkb(coordinates, on_invalid="ignore") is not None:
geom = shapely.from_wkb(coordinates)
else:
raise TypeError(f"{coordinates} is not a valid shapely polygon, WKT, WKB, or list of (lon, lat) tuples.")

super().polygon(_to_cmr_poly(geom))
return self
Expand Down

0 comments on commit c8d1ef0

Please sign in to comment.