Batch raster calculator?

10513
7
04-17-2012 02:50 PM
AhmedEl-Gabbas
New Contributor
Hello,

I have around 1000 raster image files (.img) and I need to use some map algebra functions with them (mainly repetitively adding some of these layers together) and need to use the model builder to make it easier for me to run it. Is it available to use raster calculator functions in model builder and use a pre-prepared input functions and output destinations (using concatenate functions in exel). I am using ArcMAP 10.

That is a samples of what I need:
"J:\sp1\sp1_Thresholded_0_3.img" + "J:\sp1\sp1_A2a_2020_Thresholded.img" ==> J:\sp1\sp1_CCCMA_A2a_2020_GainLoss.img

I will repeat the previous steps more than 1000 times and it will take me huge time to run them individulaly.

Any help will be appreciated,
Ahmed
0 Kudos
7 Replies
curtvprice
MVP Esteemed Contributor
That is a samples of what I need:
"J:\sp1\sp1_Thresholded_0_3.img" + "J:\sp1\sp1_A2a_2020_Thresholded.img" ==> J:\sp1\sp1_CCCMA_A2a_2020_GainLoss.img

I will repeat the previous steps more than 1000 times and it will take me huge time to run them individulaly.


A modelbuilder iterator should do this nicely for you. Just set up raster calculator tool and pipe the output of your iterator into it.  You may have to use the Calculate Value tool to generate the input and output pathnames you need on each iteration using a python expression. [thread=55358](See this thread.)[/thread]
JerryGarcia1
Occasional Contributor II
I had to do similar analysis and the iterator worked great.
0 Kudos
AhmedEl-Gabbas
New Contributor
I had to do similar analysis and the iterator worked great.


Thanks a lot curtvprice and Jerry,
I am new to model builder and never use iterations. Could you please give me a brief explanation of which iteration method I should use and how to code the inputs (the addition of different input layers) and the output filenames and directories. I have prepared in exel a series of inputs and output destinations and filenames and need to run them not one by one.

It would be great if you could send me a link to a simple tutorial or so discussing that.

Thanks a lot,
Ahmed
0 Kudos
JerryGarcia1
Occasional Contributor II
http://video.esri.com/watch/91/modelbuilder_dash_advanced-technologies

This video does a pretty good job at explaining some of the advanced modelbuilder tools.
0 Kudos
AhmedEl-Gabbas
New Contributor
http://video.esri.com/watch/91/modelbuilder_dash_advanced-technologies

This video does a pretty good job at explaining some of the advanced modelbuilder tools.


Thanks a lot Jerry_G, but it seems to be not that easy for me. Could you please explain for me which iteration method is best useful in my case and how to use the Calculate Value tool to generate the input and output pathnames...

Thanks a lot,
Ahmed
0 Kudos
curtvprice
MVP Esteemed Contributor

Ahmed - there's a set of three really good blog posts in the ArcGIS blog that are a good help getting started with advanced ModelBuilder..

If you are stuck at "if" – Part 1 | ArcGIS Blog

0 Kudos
curtvprice
MVP Esteemed Contributor
  please explain for me which iteration method is best useful in my case and how to use the Calculate Value tool to generate the input and output pathnames...


Ahmed -



  • Since you're iterating on rasters, it seems to me Iterate Rasters would worth a try.

  • see the Callculate Value tool help and that other [thread=55358]thread[/thread] for some examples. Parse Path is also a handy tool in MB 10.0 for manipulating pathnames


Good luck!
0 Kudos