clip hole in raster

9878
31
Jump to solution
02-08-2016 07:00 AM
Labels (2)
Highlighted
Occasional Contributor II

For example, if I have a raster layer of Digital Elevation which represents the United States and I want to keep everything except the state of Texas. I have a vector layer polygon of the state of Texas which I hope can be used to clip or mask or intersect the raster data.

How do I get the raster DEM layer with an area cutout or missing where Texas was?

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
New Contributor

Here are the steps...  Penny Vossler has it correct.

1. Create a vector polygon of the entire US (including Texas).

2. Use the "Erase" tool to clip out (erase) Texas from the US shapefile. Now you will have a polygon of the US with Texas removed.

3. Use the Extract By Mask tool and have the DEM as your input raster and the new vector shapefile of the US (with Texas erased) as the other input.

4. You will now have a DEM with everything but Texas.

View solution in original post

31 Replies
Highlighted
Regular Contributor III

I've never clipped a raster with a donut hole but you can clip a raster based on geometry with Clip—Help | ArcGIS for Desktop

Highlighted
Occasional Contributor II

I can clip the raster data to get the state of Texas but not the United States without Texas.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor
Highlighted
Occasional Contributor II

It looks like the Extract by Polygon only accepts X Y coordinates for the Polygon that represents Texas, if I was extracting or masking a rectangle the X Y coordinates would be easy but I'm not sure how to specify a shape as complex and the state of Texas with X Y coordinates.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

you may want to see if this works for you Erase but for raster

Highlighted
Occasional Contributor II

The solution in the Erase but for raster thread is to use Raster Calculator but as far as I can see the Raster Calculator uses only Raster data and I don't have raster data for the shape that I what to cut out. Maybe I can convert my vector area into raster and then use the Raster Calculator.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Well you could cheat... convert texas to a raster giving it a constant value of zero and setting the extent to be the size of the dem.  Convert the nodata area of texas the raster to 1, so you end up with an indicator grid... not-texas = 1, texas = 0  then multiply (Times) the dem by the indicator grid... sounds complicated but is really fast to do

Highlighted
Occasional Contributor II

You are right, it sounds very complicated but I'll give it a try.

Reply
0 Kudos
Highlighted
Regular Contributor III

Have you thought about Clip—Help | ArcGIS for Desktop  each state then Make Mosaic Layer—Help | ArcGIS for Desktop  them back together minus Texas?