4

I'm trying to do some raster calculations on Landsat imagery in ModelBuilder.

I'm calculating basic indices using Raster Calculator followed by Zonal Statistics. The resulting tables are merged together into one table.

We are looking at change over time in zonal characteristics over time.

The raster images are seperated into seperate files ending in _B# (# being band number)

I would like to repeat the Model through the different folders of images to avoid having to manually input each set of images.

Is this a possibility using Iterators?

I have created my model, shown below. My question now is simply how to integrate an iterator to input the 4 bands needed for the raster calculator.

this is the basic layout of my tools used.. I know all the connections aren't set up, I just created it quickly to show what I've done. Now what I'm hoping to do is add an iterator function if possible to run this analysis, through the folders of images (with individual images per band)

  • 1
    Okay, I should've been clearer... I'll post the edit above. – Alec Dec 6 '14 at 23:01
2

It sounds like you want to do something like this:

for SubFolder in MainFolder:
  for raster in SubFolder:
    run Model

This is the sort of thing that is possible with model builder, specifically with the Iterate Rasters tool. Put that into your model, set Recursive to TRUE and your input to your parent folder. You might have to modify your model with queries or selections to separate out the bands you're working on, but, so long as the model you've created works, that should handle things.

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.