-
Dear professor, I see you have shown two methods to clip rasters:
My question is: I see sometimes when I have a raster mask and I use it to clip different rasters they tend to coincide cell by cell even if I use a mask with a shapefile. However if the original map is a shapefile (e.g landcover) and then I rasterize and use the same mask this last raster tends to be slightly moved regarding other already existing rasters over an area. What is the best procedure to get all raster to coincide cell by cell programmatically? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is because the crs_transform are different. You can use |
Beta Was this translation helpful? Give feedback.
It is because the crs_transform are different. You can use
rio.reproject_match
to align the two raster datasets before clipping.https://corteva.github.io/rioxarray/stable/examples/reproject_match.html#Reproject-Match