Select to view content in your preferred language

Environment Settings Raster Analysis Cell Size

2689
13
11-09-2016 01:44 AM
NikolaiKirch
Emerging Contributor

I need some kind of "official statement" for this case:

I have a raster with a cell size of 1x1 and one with the cell size of 10x10 and need them to be aligend with each other.

This worked for me so far, but i need to understand what has happend to align them:

I used the Extract by Mask Tool (ArcGIS 10.4.1.5686 License type Basic) like this:

Input:                         1x1 raster

feature mask data:   10x10 raster

Environment Settings -> Raster Analysis -> Cell Size:  Maximum of Inputs

my result is a raster with the values of the 1x1 raster but with the extent and cell size of my 10x10 raster (so they are aligend?).

The help says about the Cell Size that if you specify a finer cell size the tool will interpolate with the nearest neighbor technique, but in my case I had a coarser cell size and the cells were not aligend before.

With witch technique were the cells of my new raster populated?

Thanks in advance!

0 Kudos
13 Replies
JayantaPoddar
MVP Esteemed Contributor

You could use Snap Raster (Environment Settings) to align the cells properly.

Environment > Processing Extent > Snap Raster.



Think Location
NikolaiKirch
Emerging Contributor

this sounds like they arent? they seem to be align after the extract by mask, arent they?

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

In case you want to align the input Raster with the Feature Mask Raster, you could use Copy Raster for the input raster with Snap Raster Environment. Then you could use the Extract by Mask tool.



Think Location
0 Kudos
NikolaiKirch
Emerging Contributor

so i just tried this and i got the same result like i did with the extract by mask tool, but again i need to know how these tools/thier environment settings choose to align the pixels or the position of thier values.

i think that while processing something happend to the position of the pixels in order to align with the snap raster?

If thats not right and nothing had to be interpolated or resampled could you please explain it to me?

0 Kudos
DanPatterson_Retired
MVP Emeritus

Beyond the visual explanation of how it works

How the Snap Raster environment setting works—Geoprocessing | ArcGIS for Desktop 

you have to assess the results based on the input extents of the tool you are using and the raster being used as the snap raster.  The visual pretty well sums it up

NikolaiKirch
Emerging Contributor

thank you!

to quote the help: " The cell value in the output raster depends on where the cell center falls on the input raster."

this sound like nearest neighbor?

0 Kudos
DanPatterson_Retired
MVP Emeritus

nearest neighbor in this context then is just that... it is not an interpolation if you are going from a finer resolution raster to a coarser snap raster.   You could get different results if the resolutions were reversed.  I always like to think of as trying to align the left and top of the raster first and fitting in the number of cells needed to fill the space or aggregate the space... this is why you can end up with a bit of extra on the right and bottom when cells sizes and extents don't match exactly.  For example, try to picture a 1 cell snap raster of dimensions 1x1.  If I am trying to fit in a cell of 0.9x0.9 into it, the input raster has to get a bit bigger after it is snapped to the snap raster.  Get a picture in your mind that meets the case, with the rules, left, top and cell size to fit/aggregate in that order

0 Kudos
DanPatterson_Retired
MVP Emeritus

You can Aggregate the raster your finer raster to a coarser raster... it honors the Snap Raster in the environment settings, and there is no interpolation involved.

NikolaiKirch
Emerging Contributor

For me it already seems to be align after the Extract by Mask, the resulting raster has the same cell size, extent, rows and columns. Or am i wrong? and Extract by Mask does not fullfil this purpose?

Does Extract by Mask use nearest neighbor? Some kind of algorithm is used to populate my new raster with the values of the 1x1 raster.

0 Kudos