Updating a subset of raster values using ArcMap

349
5
06-17-2021 01:05 PM
Labels(2)
ManishShrivastav
New Contributor III

I have a source raster data set (tif file) I want to select a subset (cells) of the source raster data, change the values of the selected cells and write the changes values again to the source raster.

How should I approach this in ArcMap.

Thank you,

Manish

0Kudos
5 Replies
JayantaPoddar
MVP Esteemed Contributor

Subset by an area of interest (polygon) or by a range of values?



Think Location
0Kudos
ManishShrivastav
New Contributor III

By Area of interest.

0Kudos
JayantaPoddar
MVP Esteemed Contributor

1.Convert thePolygon to Raster. Keep the cell size same as the source raster. Also definesnap Raster (Environment)as the source Raster.

2. UseRaster Calculatorwith a similar expression.

Con(IsNull("Raster2.tif"), "Raster1.tif", 0)

replace "Raster1.tif" with the source Raster name

Raster2.tif with the subset raster name

and replace 0 with the desired constant value



Think Location
0Kudos
ManishShrivastav
New Contributor III

Thanks a lot, this worked for me partially. But this creates a new raster masked by the polygon area, my need is that the changes should be made to the selected subset of cells in the original raster and get back the original raster along with the changed values such that the area that were not under the polygon should remain unchanged.

0Kudos
JayantaPoddar
MVP Esteemed Contributor

Raster tools will usually create a new output. Use the above tools in a model builder along withCopyand删除tools.

*Keep a backupof your source raster before executing the workflow, since the Delete is permanent.

What value do you want to put for pixels falling in the subset area? What other deviation are you seeing from your desired result?



Think Location
0Kudos