HOW TO
Instructions provided describe how to process only on rows or columns in a raster that contain a particular value.
For example, in a Grid with values from 1 to 10, make negative any values that are less than 5.
One approach is to create a custom application that loops through the raster by iterating an extent window through it, however this generates a lot of intermediate rasters that need to be collated into the final result.
A simpler approach is to incorporate the use of a Block function. The procedure is to identify the rows/columns that contain the threshold value and then conditionally restrict the operations to those rows/columns.
1 2 3 4
3 5 2 6
9 1 2 3
5 1 9 5
Note:
This procedure can be modified to operate on columns instead.
a1 = CON (a0 EQ 5, 1, 0)
0 0 0 0
0 1 0 0
0 0 0 0
1 0 0 1
a2 = BLOCKMAX (a1, rectangle, 4, 1)
0 0 0 0
1 1 1 1
0 0 0 0
1 1 1 1
a3 = CON (a2 EQ 1 AND a0 < 5, a0 * -1, a0)
1 2 3 4
-3 5 -2 6
9 1 2 3
5 -1 9 5
Article ID: 000009115
Get help from ArcGIS experts
Download the Esri Support App