0

I have two raster layers that I would like to add together (raster1+raster2) but although they have the same resolution(15x15 nautical miles), they are not perfectly overlapping because they have been created using two different grids and cropped at the end using the same polygon. One is the result of a Utilisation Distribution evaluation via the adehabitatHR package for R and the other is the result of a longer procedure which includes R for data gathering and analysis, ArcMap 10.4 for spline interpolation with barriers and QGIS for further editing/geoprocessing.

I have looked at different proposed solutions via ArcMap (e.g. https://community.esri.com/thread/22270), R (e.g. Sum rasters with different extent in R) but none of them seems to work for me. Two of my rasters can be downloaded from https://www.dropbox.com/sh/aq746s58hbgerru/AADci-IGR1bgqIFWKQkOY7ata?dl=0. I have several rasters, about 120, that cover 10 different areas. And Ideally I would like an automated way to “snap” one to the other by area.

EDIT:
I have actually found a solution very easily by using the basic raster calculator in QGIS. For some reasons the SAGA and GDAL raster calculators were not producing an output while the basic QGIS one works fine. Furthermore I was using an older version of QGIS that I still prefer to the newest 3.x and this prevented me from using the basic raster calculator in a model. So, in other words, I just opened my project in QGIS 3+ and put the raster calculator in a model. This works fine with me.

5
  • From your raster1, the extent of raster2 is half-pixel (0.125 degrees) shifted to south, and to east respectively, right?. If it is the case for all pairs, you can (1) Create a world file (tfw) from raster1, and (2) Make a copy of the raster1.tfw file and rename it to raster2.tfw (3) Reload them to QGIS and calculate sum. // The first part will be done on OSGeo4W shell using listgeo –tfw raster1.tif > raster1.tfw command.
    – Kazuhito
    May 13 '20 at 21:58
  • Thank you Kazuhito for taking the time to answer my question. I have to say though I am not sure what your procedure is. Can you please explain? May 14 '20 at 8:46
  • Will do. Which part would better be explained further?
    – Kazuhito
    May 14 '20 at 11:31
  • 1
    @Kazuhito, thank you for you offer, have actually solved it very easily. I am updating my question with the solution. May 21 '20 at 14:13
  • 1
    @NinoPierantonio Please add your edit as an answer and accept it so we can consider your question resolved.
    – Aaron
    May 21 '20 at 14:31
1

Use the Snap Raster functionality in environmental settings in ArcGIS. https://desktop.arcgis.com/en/arcmap/10.3/tools/environments/snap-raster.htm

You can create a new, snapped raster using Copy Raster https://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/copy-raster.htm and setting the snap raster in the environment.

Then proceed with adding the rasters together using your preferred method.

0

I have actually found a solution very easily by using the basic raster calculator in QGIS. For some reasons the SAGA and GDAL raster calculators were not producing an output while the basic QGIS one works fine. Furthermore I was using an older version of QGIS that I still prefer to the newest 3.x and this prevented me from using the basic raster calculator in a model. So, in other words, I just opened my project in QGIS 3+ and put the raster calculator in a model. This works fine with me.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.