1

How do I delete a portion of a raster image using ArcMap?

Attaching the raster image and the portion to delete.

enter image description here

  • 1
    Please edit your question to add the software. One possible way is that you need to to have a boundary in vector format that covers your target area, then modify it to exclude the island from the vector file and use it to clip the raster image using Clip tool. – ahmadhanb Feb 8 at 6:29
  • We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works. Thanks. – PolyGeo Feb 8 at 6:36
  • For a one-off I'd use GIMP or Photoshop but you will need to protect the georeference as a world file or by some other method as both GIMP and Photoshop destroy georeference. If you want to use Esri to mask this raster you will need to have a spatial analyst license, do you have this extension? – Michael Stimson Feb 8 at 6:48
  • @MichaelStimson Using Extract by Mask requires Spatial Analyst: desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/…, but Clip Raster Tool does not require Spatial Analyst, it can be accessed from Data Management Tools -> Raster -> Raster Processing -> Clip: desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/…. – ahmadhanb Feb 8 at 7:01
  • 1
    My appologies @ahmadhanb, it was a difference of coordinate system that caused the checkbox to be disabled, you are correct. – Michael Stimson Feb 8 at 7:30
1

The manipulation of raster in ArcMap unfortunately requires additionnal extension (to be bought in addition to ArcMap).

If you are "lucky", you have the ArcScan extension. Then go to the "Raster Cleanup" menu on the ArcScan toolbar > "Start Cleanup" > Raster Painting. Then use the "fill" tool and you are done in one more click.

If you have the more frequent "spatial analyst" extension (required for most raster processing tasks), it is still possible but longer. Draw a vector polygon manually around the portion that you want to delete, convert your feature class to raster, then use Map algebra tool to set a background value to all pixels under the shape of your vector polygon

Con(IsNull("your_polygon_converted_to_raster"), "your_other_raster", "your_background_value")

If your background value is "NoData", then you can simply omit the last part (or use Setnull)

Con(IsNull("your_polygon_converted_to_raster"), "your_other_raster")
  • In the Arcscan extension, my start cleanup button is disabled. Can you help? – Rohan Kar Feb 13 at 5:52
  • you must be in an edit session and display your raster in a binary legend (symbology > classified) – radouxju Feb 13 at 7:14
1

You could do this in a couple lines of code with the "raster" package in R. There's a function that will do exactly what you want.

R has a learning curve, but it might be worth it. I personally find all of the tools, add-ons, and menus in ArcMap to be confusing and unwieldy.

To do this, first create a polygon in Arcmap that contains all of the pixels that you want to mask out. A rectangle will do - just make sure it roughly covers the island you're trying to remove, and none of the pixels that you want to keep.

library(raster)

r <- raster("path/to/your/raster")
s <- shapefile("polygon/to/mask.shp")

r <- mask(r,s)

writeRaster(r,"path/to/write/raster.tif", format="GTiff", overwrite=TRUE)
0

The issue here is that the pixels representing the island fall within the extent of the entire raster, so applying standard find and replace techniques won’t work as it would end up applying it to the entire raster. With this in mind this is how I would do it:

  1. Zoom into the island, so only the island pixels are showing, so no mainland coastline
  2. Run Create Constant raster setting cell values to 9999, ensure you set processing environment to current display and snap raster to 2000.tif. This will create a small raster of pixels all 9999 for the current extent so should cover only your island and surrounding nodata pixels. If you have pixels with 9999 as a value then choose some other number that is outside the existing range of cell values.
  3. Run mosaic tool and mosaic the 9999 raster into your 2000.tiff. You now have a raster with an ugly rectangle of cells in the sea where the island was and all this within your original DEM.
  4. Run the calculate statistics and build raster attribute table to update the raster.
  5. Run Set Null tool, the expression would be "Value" = 9999, false raster would be input raster. This will replace the block of 9999 cells with no data and as they are the only cells that are 9999 then the rest of the raster remains the same. This will effective delete out the island.
  • Can I use raster erase of Arc scan toolbar to delete unwanted raster portions? – Rohan Kar Feb 13 at 5:50
  • Because if there are too many unwanted patches of rasters which I wanted to delete, then your above process would be too hectic. Please help – Rohan Kar Feb 13 at 6:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.