Select to view content in your preferred language

How to calculate change over distance for grids.

925
3
05-17-2011 08:43 PM
KylePurdon
Emerging Contributor
Hello,

I need to calculate change in velocities over a grid for some glacial change research i'm working on. I can do this by exporting a point file of grid values to excel and doing the calculations there but would love to be able to do this within Arc. I've attached a PDF explaining what I want to do. Any help would be much appreciated.

Thanks!
0 Kudos
3 Replies
KylePurdon
Emerging Contributor
I apologize, the cells are always squares however the raster itself could be 100 x 200 cells or something like that. (Not always 100x100) Sorry for the confusion.
0 Kudos
EricRice
Esri Regular Contributor
Kyle,

If you have rectangular cells in your raster data, please be aware that any analysis done in ArcGIS will resample the data to be square. All the algorithms in Spatial Analyst are designed for square pixels.

Using the very simplistic example in the pdf, I created a raster dataset that is 3 x 3 with the same values as your graphic described.  Using somewhat of a brute force technique I was able to solve this in ArcGIS.  It may not be elegant, but here is what I did.  This example is solving for Eyy (cell ID 5)

1. To obtain the value for cell ID 6, I shifted the raster to the left by 1 cell.  Now a value of 9 is on top of source raster value 7.
2. To obtain the value for cell ID 4, I shifted the raster to the right by 1 cell. Now a value of 8 is on top of source raster value 7.
3. Using the two newly created rasters, I used your formula in the raster calculator.  i.e. ("rightvalue" - "leftvalue") / 20.0 to obtain a new raster that has a value of 0.05 that now overlays the original source raster where the cell was equal to 7.  See screenshot where I identified all raster values located at cell ID 5.

Using this logic of shifting data you can shift up and shift down to get the values to solve Exx at any cell.  The Shift tool is located in Data Management Tools > Projections and Transformations > Raster > Shift.

A more elegant solution would be to run the function RasterToNumPyArray and use neighborhood notation to solve.

Regards,
Eric
0 Kudos
KylePurdon
Emerging Contributor
The shifting method works great. As long as I made sure the "NoData" cells were actually valued as "NoData" and not -9999 as we usually use the calculation worked perfect and was much simpler than using excel.

Thank you all, these forums are truly a godsend!
0 Kudos