Skip to content

Commit

Permalink
Raise error if wrong exposures
Browse files Browse the repository at this point in the history
  • Loading branch information
Chahan Kropf committed Jan 5, 2024
1 parent e5dffd9 commit 1f6ec54
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions climada/hazard/centroids/centr.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ def from_exposures(cls, exposures):
**dict(gdf.items())
)

raise ValueError(
"The given exposures object has no coordinates information."
"The exposures' geodataframe must have either point geometries"
" or latitude and longitude values.")

@classmethod
def from_pnt_bounds(cls, points_bounds, res, crs=DEF_CRS):
"""Create Centroids object with meta attribute according to points border data.
Expand Down

0 comments on commit 1f6ec54

Please sign in to comment.