I have two DEM rasters which overlap and have different extents. I would like to create a new raster which sums the pixels where there is an overlap.

I tried using gdal_calc first by doing A+B but seeing the rasters are different dimensions it errors.

I then tried using gdalwarp using the -r sum. This creates a raster but it has not preformed a sum.

I have successfully performed this in QGIS using the raster calculator, but as I will eventually be running it on multiple files I'm trying to get a command line solution to work.

The closest solution I've found on Stack Exchange is this question Using rasters with different dimensions in GDAL_calc.py

Is there another way?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.