I have a geodataframe which I load in as follows:
gdf = gpd.GeoDataFrame(
ds.to_pandas(),
geometry=gpd.points_from_xy(ds["CENLON"], ds["CENLAT"]),
crs="EPSG:4326",
)
It looks as:
print(gdf)
CENLON CENLAT O1REGION O2REGION AREA ... ZMAX ZMED SLOPE \
index ...
0 -146.8230 63.6890 1 2 0.360 ... 2725 2385 42.0
1 -146.6680 63.4040 1 2 0.558 ... 2144 2005 16.0
2 -146.0800 63.3760 1 2 1.685 ... 2182 1868 18.0
3 -146.1200 63.3810 1 2 3.681 ... 2317 1944 19.0
4 -147.0570 63.5510 1 2 2.573 ... 2317 1914 16.0
... ... ... ... ... ... ... ... ... ...
216424 -37.7325 -53.9860 19 3 0.042 ... 510 -999 29.9
216425 -36.1361 -54.8310 19 3 0.567 ... 830 -999 23.6
216426 -37.3018 -54.1884 19 3 4.118 ... 1110 -999 16.8
216427 -90.4266 -68.8656 19 1 0.011 ... 270 -999 0.4
216428 37.7140 -46.8972 19 4 0.528 ... 1170 -999 9.6
I want to create a 2D matrix (world map) of the column "01REGION" at a 0.5 degree resolution (720x360 world map) with the mean as the aggregation method. How can I do this (preferably with cartopy?)
For anyone looking the same: