Skip to content

Commit 2b3ea1e

Browse files
impact: quick fix in plot_raster_eai_exposure
set geometry points before plotting
1 parent 11a707b commit 2b3ea1e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

climada/engine/impact.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,9 @@ def plot_raster_eai_exposure(self, res=None, raster_res=None, save_tiff=None,
595595
cartopy.mpl.geoaxes.GeoAxesSubplot
596596
"""
597597
eai_exp = self._build_exp()
598+
# we need to set geometry points because the `plot_raster` method accesses the
599+
# exposures' `gdf.crs` property, which raises an error when geometry is not set
600+
eai_exp.set_geometry_points()
598601
axis = eai_exp.plot_raster(res, raster_res, save_tiff, raster_f,
599602
label, axis=axis, adapt_fontsize=adapt_fontsize, **kwargs)
600603
axis.set_title(self._eai_title())

0 commit comments

Comments
 (0)