How to change the resampling method in rasterio's rio.reproject_match function (python)?

61 Views Asked by At

I wanted to apply to raster 1 the resolution and origin of raster 2. I found the rasterio's "rio.reproject_match" function. This take the transformation correctly but I couldn't change the default resampling method (nearst). My raster (1) represents land cover, so I wanted to apply the "mode" method. According to the definition here : https://corteva.github.io/rioxarray/html/rioxarray.html#rioxarray.raster_array.RasterArray.reproject_match

I thought of this code:

raster_match = raster_1.rio.reproject_match(raster_2,Resampling = Resampling.mode)

But I found the error below:

NameError: name 'Resampling' is not defined

I wanted to confirm with you if it is possible to change this method directly in rio.reproject_match function and how?

Thanks in advance,

0

There are 0 best solutions below