Select to view content in your preferred language

Erase but for raster

02-04-2011 12:13 PM
Occasional Contributor III
I'm looking for a tool similar to Erase_analysis but for raster source instead of a feature class. The clip feature is still vector. That is the opposite of Clip_management (leaving a hole of NoData in the result). I have found three ways to do it so far, but they all seem a little cumbersome, and I'm looking for something simpler.

My possible workarounds are so far:

  • Convert clip feature class to raster, and call SetNull

  • Create a feature class from raster extent, call erase with clip feature class, and then Clip Raster
  • Same as above but ExtractByMask instead of Clip Raster

Is there anyone out there with a better idea on how to accomplish this task?

I Have ArcGIS 10 / ArcInfo with spatial to play with.
0 Kudos
7 Replies
New Contributor III

Have you looked at the Image Analysis window and the clip / mask buttons? They are very easy to use and give you quick results.
The window is new at 10.0 and can be accessed from windows > Image Analysis.

0 Kudos
Occasional Contributor III
Yes I know about that one. Forgot to mention it. It does exactly what I want. My problem is only that this is one little step in a huge model. So I what I need is that functionality but as a toolbox tool, so I can connect it with other tool.

Thanks for mention it anyway.
0 Kudos
New Contributor III
I know this is an old question, but I just encountered a need for this functionality as well, so I thought I'd share my solution:

Use Extract By Polygon, and set the extraction area parameter to 'OUTSIDE'. See:

No need to convert between vector and raster and run a series of clips and reclassifications. Just one tool and done.
New Contributor
Additionally this can be achieved using Raster Calculator:

SetNull( Not(IsNull( [EraseRaster] )), [OriginalRaster] )

Note that Not must be replaced with ~ in Arc 10.

This was EXACTLY what I needed! Thanks so much for sharing!
New Contributor III

I don't see who originally posted this solution, but thanks. It saved me from having to brush up on my raster calculator. Thanks.

0 Kudos
New Contributor

I know this is really old, but this answer was perfect, EXCEPT how do you preserve the shape of the original raster? I performed this operation and the "new raster" was clipped by the extent of the "EraseRaster" when really, I'd like the extent of the "OriginalRaster".

0 Kudos
New Contributor II

I think you could just set the extent environment variable to be the extent of the "OriginalRaster" before performing the Raster Calculation and that should solve the issue.

0 Kudos