Using "Iterate Rasters"

2449
2
07-25-2017 12:59 AM
FlorenceMagnin
New Contributor

Hi,

I am starting to use model builder and I face some trouble when using “iterate rasters” and “collect values”. I have 50 rasters (GRID format) in a folder and I want to make simple calculation on each of this raster (using tool “Minus”). Well, this is where I ended up following various conversations on various forums to try to solve my problem.

Now, when I select my folder containing my 50 rasters (called “output” since it contains the output of previous calculations) in the iterate raster’s interface, it returns only the first raster (called “maat_e1000”) as output raster (see below), but I also have “maat_e2000”, “maat_e3000”…

So I imagine that then if I run the model it will only perform calculation on this single raster. Then I thought about using “collect values” prior to us ethe “Minus” tool, but I think I should first fix this problem.

If anyone knows why  “Iterate Rasters” generate only 1 output raster and could help me with that I will be very grateful!

Many thanks in advance

0 Kudos
2 Replies
FlorenceMagnin
New Contributor

Hi,

thank you very much for proposing these solutions.

However, I am not entirely sure that I'll manage to cope with that (I possibly misunderstand the use of inline variables).

My worries are the following:

  1. I have read the "Iterate Rasters" tutorial and this is why I think I have a problem with my input data (my 50 GRID in the"output" folder). First, when I select this folder, I don't see the list of rasters appearing, such as in the tutorial where this list: "Aland_grid". "Aparcel_grid"... is displayed. I first thought I have a problem with my rasters but from what I saw on various forums, this is would be normal that I don't see them because at this stage, when I select the input raster, I am only supposed to select a folder. Is it the case or the fact that I don't see my list of rasters means that there is a problem With them?

In my case, I select my input raster folder called "ouput" and the only output raster I have is "maat_e1000", which is the first in my list of rasters.

  1. If I understand the use of inline variable well, I can use the name of my ouput rasters as inline variables to create the name of the following output variables; by "following" I mean the output of the following tool I will use (in example 2 this is the "Project tool", for me it would be the "Minus" tool). However, I don't manage to create the 50 outputs I want by using Iterate raster because it seems to only consider 1 input raster ("maat_e1000, see the attached file) instead of the 50 rasters. So I still think that I first need to fix that: make sure that it will iterate on my 50 rasters.

Well, I hope this clarifies a little bit my problem and will help to solve it, or at least I hope this would reveal where I am wrong!

 

Thanks!

0 Kudos