Raster: Calculating all cells within the new resampling boundary

541
4
03-31-2011 10:00 PM
DanKips
New Contributor
Hello,

I am new to raster analysis. I have a raster layer of 30x30m and wanted to resample to 2000x2000m. The four built-in resampling option in ArcView 9.3.1 (Nearest, Bilinier, Cubic & Majority) only consider 1, 4, or 16 nearest cell centers.

Rather than selecting 1, 4 or 16 cells, I wanted to average ALL of the value of cell centers that occur inside the new cells' boundary. In my case of resampling from 30x30 to 2000x2000, according to my calculator, this is an average of 4444 cells. How can I compute the mean of these 4444 cells within the boundary of the new 2000x2000 grid? After calculating the mean, I would probably need to resample this new grid with the Nearst Neighbor method to get the 2000x2000 grid?

Please help, thank you.
0 Kudos
4 Replies
JeffLee
New Contributor II
Dan;

Create a grid or a feature class of the new cell extents and use spatial analyst to run a zonal statistics.  In the dialog box pick "mean" as the statistic to compute.
0 Kudos
DanKips
New Contributor
Hi Jeff, thanks for your input and my apologies for the late reply. I did lots of reading and tried many steps but I think I need more help...

Create a grid or a feature class of the new cell extents and use spatial analyst to run a zonal

statistics.  In the dialog box pick "mean" as the statistic to compute.

What I did so far following your steps:

- Creating new raster 2000x2000

ArcToolbox > Data Management Tools > Raster > Raster Processing > Resample
Input Raster: raster30 (which is the original 30x30m)
Output Raster Dataset: raster2000 (the new 2000x2000m)
Output Cell Size (optional): 2000
Resampling Technique: Nearest

So the output from above is raster2000.img which also have 3 other files (.vat.dbfm, .img.xml and .rrd).

- Zonal Statistics

ArcToolbox > Spatial Analyst Tool > Zonal > Zonal Statistics
Input raster: raster2000
Zone field: VALUE
Input value raster: raster30
Output raster: ZS_raster2000 (new file created by zonal stats)
STatistical type: MEAN
Ignore NoData in calculations: checked

Unfortunately there's no Attribute Table associated with ZS_raster2000?
But I converted the raster to ASCII successfully using ArcToolbox > Conversion Tools > From Raster > Raster to ASCII.

Comparing raster2000 vs ZS_raster2000 (ignoring -9999), I found there are a few missing VALUE data in ZS_raster2000.

Please let me know if I missed something. Thanks.
0 Kudos
DanKips
New Contributor
Hello Bill, thanks for your input.

Resampling occurs automatically in any raster calculation, Dan.  Therefore it suffices to set the Spatial Analyst options to the new cellsize (2000 instead of 30), specify you want to use bilinear resampling by default, and simply copy the grid using the Raster Calculator.


I did the following:
- Spatial Analyst toolbar, select Layer raster30 (the original 30x30m) > Options > Cell Size.
- Analysis cell size: As Specified Below = 2000.
- Then in Raster Calculator I added raster30 (simply double click) and "Evaluate".
- In the Layer's TOC it appears new layer named "Calculation".
- Then I converted it to ASCII (for further analysis)

I ignored your step "specify you want to use bilinear resampling by default" because I couldn't find it, can you please tell me where to specify it?

In any case, reading ESRI's webhelp Cell SIze and Resampling it says that Bilinear resampling calculates mean of 4 values. What I'm trying to do is to calculate mean of all values from raster30 that occurs inside the new raster2000 grid (4444 values). Is it possible?

You can get a little more control over this by explicitly using the
resample command.  The aggregate command could also be pressed into service if need be.  Similar-looking procedures, including focal statistics and zonal statistics, will either not work or be much more cumbersome (for you) and inefficient (for the computer).
I read your link but I never use the "command" so I'm a bit loss, sorry. If you can point me to the right direction I appreciate very much. I'm sorry if I ask too much, I'm very new to this but I wanted to learn. Thanks.
0 Kudos
DanKips
New Contributor
Yes it is, Dan: use the Aggregate command in Spatial Analyst.  This is exactly what it's designed to do.  I recollect you first need to set the raster analysis environment appropriately (i.e., to the new cellsize and origin) and then issue the command.


I checked out the Aggregate function in ArcToolbox. You're right, this is what I want. I will try this and if there's anything else will let you know. 🙂

Thanks so much Bill!
0 Kudos