Describe the bug
Whenever climada.util.coordinates.points_to_raster or climada.util.coordinates.set_df_geometry_points are executed a warning is raised:
FutureWarning: You are adding a column named 'geometry' to a GeoDataFrame constructed without an active
geometry column. Currently, this automatically sets the active geometry column to 'geometry' but in the
future that will no longer happen.
Instead, either provide geometry to the GeoDataFrame constructor (GeoDataFrame(... geometry=GeoSeries())
or use `set_geometry('geometry')` to explicitly set the active geometry column.
To Reproduce
Steps to reproduce the behavior/error:
Create an Exposures object without a proper geometry column.
Run set_geometry_points on it.
Run plot_raster on it.
Code example:
import pandas as pd
from shapely.geometry import Point
from climada.entity.exposures import Exposures
exp = Exposures(data=pd.DataFrame(
dict(
latitude = [1,2,3]*3,
longitude = [1]*3+[2]*3+[3]*3,
value = range(9)
)
), crs='EPSG:4326')
exp.set_geometry_points()
exp.plot_raster()
Expected behavior
Silent plotting.
Climada Version:
climada_python >= 4.0
System Information (please complete the following information):
Describe the bug Whenever
climada.util.coordinates.points_to_raster
orclimada.util.coordinates.set_df_geometry_points
are executed a warning is raised:To Reproduce Steps to reproduce the behavior/error:
Exposures
object without a proper geometry column.set_geometry_points
on it.plot_raster
on it.Code example:
Expected behavior Silent plotting.
Climada Version:
System Information (please complete the following information):
Additional context