1

I want to work with 5 raster sets in R. 3 of them are results of an Euclidian distance analysis (R1-3), 1 is from a kernel density analysis (R4) and the last one is from a viewshed analysis (R5). My goal is to stack them in R. To do this, all of the raster sets need to have the exact same extent (incl. CRC, cell size and columns/rows). R1-4 are not the problem, they are properly stackable with the following extent/resolution:

X        10
Y        10
Columns  2826
Rows     2911
xmax     5661589.216435
xmin     5632486.563462
ymax     32371381.150053
ymin     32343124.735493
CRC      ETRS89/UTM32N

R5 has the following extent/resolution:

X        10
Y        10
Columns  2827
Rows     2911
xmax     5661589.216435
xmin     5632486.563462
ymax     32371381.150053
ymin     32343124.735493
CRC      ETRS89/UTM32N

So the whole difference between R1-4 and R5 is one single column. I don't really understand this because the cell size and the extent are the same. As far as I understand, the number of columns cannot logically be anything else than 2826. What I now did was to export R5 in ArcGIS with a number of columns of 2826 which obviously changed the cell size to 9.998... each. I then tried to resample R5 to a cell size of 10. However, the number of columns remained unchanged in the newly exported raster.

My question would now be how the number of columns can be changed or which other ways there are to align the raster extents.

2 Answers 2

1

You could try re-running the viewshed analysis and setting the "snap raster" environment variable to one of the other resultant grids, i.e. your R1-4 and see if the outputs match then.

1
  • Unfortunately, I cannot re-run the viewshed analysis as it is extremely data heavy and takes too long to compute and strains my CPU a lot.
    – jslth
    Jul 20, 2020 at 19:03
0

I managed to find a solution myself. When exporting the raster, the clipping extent has to be maintained (the box must be checked), so that the raster extent of the exported file does not jump back to the extent that logically follows from the resolution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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