Extract By Mask for many data - using script of other method

5414
3
01-11-2012 06:14 PM
SergeRafanoharana
New Contributor
Dear All,

I have a raster data containing the temperature, a very large area, and I have a shapefile containing my study area. Then I use the Extract by Mask in the Spatial Analyst Toolbox to crop my data. It is good but the thing is that I have monthly data for many years so I have to do it one by one. Is there another way or using script to do that for my data?

I tried the Map Algebra -> Multi Output Map Algebra but couldn't get it.

ExtractByMask tmean1 SHP_adm0 F:\DATA\test1
ExtractByMask tmean2 SHP_adm0 F:\DATA\test2
ExtractByMask tmean3 SHP_adm0 F:\DATA\test3
...

Thanks...
0 Kudos
3 Replies
TimothyHales
Esri Notable Contributor
You can run a batch Extract by Mask process (Right click tool > Batch...).  With the batch you can input all of your input rasters and then input your feature mask.  Right click the cell of the mask and choose Fill.  This will populate the same value into the other cells.
0 Kudos
SergeRafanoharana
New Contributor
Dear thales007,

Thank you for your reply. I have already got it from another post. You can refer to it at: link

Anyway, thanks and I will also give it a try.

Regards,
Sypou
0 Kudos
TimothyHales
Esri Notable Contributor
Okay, great.  Glad you found a solution.  The python example of the tool can also be found at the bottom of the help document:  Extract by Mask Tool
0 Kudos