How sum two raster with different shapes?


byander@...
 

Hi, I'm developing a system and I need sum two raster with different shapes.
I've a DEM raster with a resolution of 30 meters and another raster with a resolution of 10 meters, both clipped in the same area by a polygon.

When I trying sum the rasters I get the error: ValueError: operands could not be broadcast together with shapes.

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. rio calc or gdal_calc.py, but I not found a example to implement this.

Thank's for any help.

Join main@rasterio.groups.io to automatically receive all group messages.