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?
Solved! Go to Solution.
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.
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).
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.
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.
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.
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.
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.
Was this not sufficiently answered two days ago?
One could say "All roads lead to Rome". Although this one requires an Advanced license...
actually it does not require an advanced license if you use the 'clip' function. I have the standard license.