clip hole in raster

15396
31
Jump to solution
02-08-2016 07:00 AM
RickCheney
Occasional Contributor III

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?

0 Kudos
31 Replies
DarrenWiens2
MVP Honored Contributor

Yes, either of those would work, although the OP says he only has geometry for Texas. Either way, the take-home message is: don't bother with Extract by Polygon if Extract by Mask will work.

PatIampietro
Occasional Contributor

Another advantage of ExtractByMask over Clip and the like is that it returns a raster with the minimum rectangular footprint of the extraction fetaure(s) rather than that of the original raster to be clipped, with extraneous null cells everywhere outside the clip feature(s).

0 Kudos
RickCheney
Occasional Contributor III

ExtractByMask worked!  I used the Raster Elevation data for the input raster and used a vector that for this example represents the US with a hole where Texas would be for the Feature Mask data.

0 Kudos
RickCheney
Occasional Contributor III

Thank you, all of you, for the help.  I'm still a newbie and a bit intimidated by some solutions that seem complex but I am learning so much.

PennyVossler
New Contributor

I may be oversimplifying here, but it seems to me you could clip Texas out of the US map, then use this US-without-Texas as the input to clip the DEM.

0 Kudos
RickCheney
Occasional Contributor III

It seemed like when I tried that I always ended up with Texas instead of everything except Texas.  ExtractByMask worked perfectly, it extracted (or clipped) everything from the polygon except the data that represented Texas, it extracted a raster polygon with a hole where Texas was.

0 Kudos
IanHageman
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.

DarrenWiens2
MVP Honored Contributor

Was this not sufficiently answered two days ago?

XanderBakker
Esri Esteemed Contributor

One could say "All roads lead to Rome". Although this one requires an Advanced license...

PennyVossler
New Contributor

actually it does not require an advanced license if you use the 'clip' function. I have the standard license.

0 Kudos