0

Attached is the model that i am working on.

Model1

The "To Value" and "From Value" are model parameters and hence subject to change each time according to requirements, This leads to varying number of files generated each time. This variation in the number and names of output files in a workspace is creating the problem in hardcoding the following calculator expression in a subsequent model directly.

Model2

This is the expression in the second map algebra tool that i want to use. The input rasters are those generated from the model shown above. Raster Calculator (output1+(output2/Output1)+(output3/Output2)+(output4/Output3)+(output5/Output4)+....)

I saw some effort to a similar question here, Raster Calculator dynamic map algebra expression, but I didn't find it conclusive. (I didn't understand the advice to use the FOR loop there)

Help and advice please! I am using ArcGIS-10.1

1

Your raster calculation requires all your output rasters to exist but it's getting called on each iteration before they are built. You need to put the iterator part in its own model which becomes a sub model so all that part is called first. Look at the desktop help for submodel.

  • I have edited the model taking note of your suggestion. Now, the first set of the model gives 5 files (By value = 1). I need help to write map algebra expression (second model) for as many (depending on the user input of TO and FROM values) files created by the first model. – Uttam Paudel Jul 14 '13 at 17:36
  • Just thinking off the top of my head but one way to do this is using the Calculate Value tool to call a bit of python that takes your range of values and builds an expression that which can feed into the raster calculate tool as some sort of inline substitution. – Hornbydd Jul 14 '13 at 22:34
  • Exactly. The only problem is that I am very new to python. :( – Uttam Paudel Jul 15 '13 at 2:04
  • Have a look at this book, if you are going to do Python in ArcGIS might as well start learning it! amazon.co.uk/Python-Scripting-ArcGIS-Paul-Zandbergen/dp/… – Hornbydd Jul 15 '13 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.