Manually editing pixel values in ArcGis? How ?

28603
18
06-20-2013 09:29 AM
SamHuang
New Contributor II
Hi guys,

This issue has troubled me the last couple days and I'm turning to you guys in the hopes of actually finding out what the best way is to solve this problem.

I have a dem file that I'm looking to manually edit specific individual pixel value. However, I'm not sure how to go about it in ArcGIS. IF anyone who has came across this issue or knows how to resolve. Please let me know.


Much appreciated!
18 Replies
ChristopherBlinn1
Occasional Contributor III
Would it be possible to export your raster to points, then edit the points (in this case a centroid representation of the pixel) in question, then recreate the raster from the points?
0 Kudos
SamHuang
New Contributor II
Yeah, I actually just thought of that too. But if anyone can confirm that'll be great. I think as long as you convert it back raster with the same properties it should work ?
0 Kudos
ChristopherBlinn1
Occasional Contributor III
You can set the cell size and extent in the geoprocessing options, which allows you to select a current file to base those parameters off of.  That will ensure you have the same properties for the new raster.
0 Kudos
SteveH
by
Occasional Contributor
Alternatively, convert your raster to ASCII and edit the values in notepad.
Steve
0 Kudos
RinkeHeida
New Contributor III

The ARIS Grid & Raster Editor for ArcMap now also supports edits on multi-band RGB rasters. You can edit cells/pixels in one to three bands all at the same time through the Red, Green and Blue channels by painting in the map.

gridrastereditor_rgb_pencil.png

Available for ArcGIS 10.0 - 10.8:

https://www.aris.nl/gridrastereditor_arcmap

0 Kudos
JohnSchweisinger
Occasional Contributor
0 Kudos
TimLeach1
New Contributor II

One way that works for one pixel and could work in different ways for multiple pixels...

Summary:

In short create a single point in an editing session, use it as a mask feature, extract the pixel from the source, reclassify it, append it back to it's source (using source as the target), then reclassify it again to normalize it with the rest of the source raster. 

General Steps:

1. Set the environment's geoprocessing x, y, z tolerances - this important

2. Create a point feature class, import the coordinate system of the raster, start an editing session, zoom to the pixel and add a point on the pixel and save

3. Use Spatial Analyst Tools\Extraction\Extract by Mask, set the input raster and use the point as the feature mask data and run

You should now have a single pixel in the extracted output raster

4. Use Spatial Analyst Tools\Reclass\Reclassify and assign the pixel the value you want

Here's the tricky part:

5. Use Data Management Tools\General\Append and append the pixel raster to it's source
At this point it may not look like it worked because you can not access the new value in the ArcMap symbology tab, however...

6. Run Spatial Analyst Tools\Reclass\Reclassify then "Add Entry" and type the value in as old and new

7. After the reclassification you should have a raster with the pixel updated.

I was using ArcMap 10.5 with LiDAR derived rasters and used a similar technique to clean up a bunch of pixels in an area using a polygon mask...

MadhurDevkota
New Contributor

It works perfectly. Thank you for the solution.

0 Kudos
curtvprice
MVP Esteemed Contributor

I tried this using a similar approach, it should work with not just points, but any feature class

In my test the point feature class had a Long field RASTERVALU with value 2.

>>> from arcpy import env
>>> oldgrid = Raster("oldgrid.tif")
>>> env.cellSize = oldgrid
>>> env.snapRaster = oldgrid
>>> env.extent = "MINOF"
>>> r = arcpy.FeatureToRaster_conversion("Feature", "RASTERVALU", 
          "xg", oldgrid.meanCellHeight)
>>> env.extent = oldgrid.extent
>>> outraster = Con(IsNull("xg"), "test", "xg")‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
>>> outraster.save("test1")‍‍‍‍‍‍‍‍‍‍

This also worked.

>>> arcpy.CopyRaster_management(oldgrid, "test1")
>>> arcpy.Append_management("xg", "test1")‍‍‍‍
0 Kudos