How sum two raster with different shapes?
Anderson Roberto da Silva
Hi, I'm developing a system and I need sum two raster with different shapes. When I trying sum the rasters I get the error: I know that rasterio read raster as numpy array, but If I use the Raster Calculator from QGIS software, I can sum the rasters without problem. I would like sum the rasters without use command line, e.g. Thank's for any help. |
|
Amine Aboufirass <amine.aboufirass@...>
You can't sum rasters with different shapes. Resample your rasters to a common resolution and align them so that they can be read as arrays with the same shape, then add the two arrays together and write to a new raster. On Tue, 18 Aug 2020, 19:03 , <byander@...> wrote:
|
|
Anderson Roberto da Silva
Thank's Amine. I create a function to resample the raster keeping the extents and resolution to calc with other rasters.
|
|