Clip a raster using features in feature class

687
4
Jump to solution
02-20-2012 03:55 AM
ClaireParsons1
New Contributor
Hi All

I have got a raster dataset that I want clipped into several new rasters by each feature in polygon feature class.
I'd like to know hope i could 'loop' through each polygon in the feature class to clip the raster dataset.

thanks
Claire
0 Kudos
1 Solution

Accepted Solutions
TorbjørnDalløkken
New Contributor II
Hi!

I havn't had the opportunity to try this, but it may give you some advice. Do you have the Spatial Analysis extention? If you're using modelbuilder and ArcGIS 10, you might start by taking your featureclass connect it to the new iterator in modelbuilder, Iterate Feature Selection. In the iterator you can set which field you want to select by; if no input is given, then each of the seperate polygons are used.  Then combine the output selection with the tool Extract Raster by Mask and connect the rasterimage. If you'd like to give the rasters a name that represents the field value of the selected feature in your featureclass, give the output from Extract Raster By Mask the name %Value% (which is one of the outputs from the iterator). The model might look similar to the sample I've drawn...

I hope this helps. :)

View solution in original post

0 Kudos
4 Replies
TorbjørnDalløkken
New Contributor II
Hi!

I havn't had the opportunity to try this, but it may give you some advice. Do you have the Spatial Analysis extention? If you're using modelbuilder and ArcGIS 10, you might start by taking your featureclass connect it to the new iterator in modelbuilder, Iterate Feature Selection. In the iterator you can set which field you want to select by; if no input is given, then each of the seperate polygons are used.  Then combine the output selection with the tool Extract Raster by Mask and connect the rasterimage. If you'd like to give the rasters a name that represents the field value of the selected feature in your featureclass, give the output from Extract Raster By Mask the name %Value% (which is one of the outputs from the iterator). The model might look similar to the sample I've drawn...

I hope this helps. :)
0 Kudos
DavidGordon1
New Contributor
I'm trying to do a similar operation that Claire seemed to have been asking about.  In my case, I want to extract 155 separate areas from a raster using a shp file with 155 circular buffers as masks.  I set up the model as described in model builder and it successfully iterated through the dataset.  However, the output rasters kept overwriting the last file so I ended up with only one raster at the end of the run.  Clearly I don't understand how to specify the output from the Extract by Mask.  Can someone help me?

Dave
0 Kudos
EricRice
Esri Regular Contributor
David,

You probably didn't use an inline variable for the output raster, which is why it was overwriting. See, Examples of inline model variable substitution, specifically Ex 2.


Best,
Eric
0 Kudos
DavidGordon1
New Contributor
Thank you Eric! That article provided the information about variables I needed.  I finally got my model to work.

Dave
0 Kudos