TransWikia.com

How can the amount of columns/rows in a raster be altered?

Geographic Information Systems Asked on November 1, 2021

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

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.

Answered by j01i147 on November 1, 2021

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.

Answered by Michael on November 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP