2

I have two folders with parts of rasters that I want to merge each, using the modeler:

Folder 1

  • area1_part_1
  • area2_part_1
  • area3_part_1
  • ...

Folder 2

  • area1_part_2
  • area2_part_2
  • area3_part_2
  • ...

(output) Folder 3

  • area1_part1+part2
  • area2_part1+part2
  • area3_part1+part2
  • ...

This is my model right now: enter image description here

Since you can't use two iterators, I made a sub-model. However when I run everything, Input 1 iterates correctly but it always merges with the last file from Input 2. How do I prevent this?

1 Answer 1

1

By far the simplest solution is to ensure Folders 1 and Folders 2 sit in the same sub-folder then all you need to do is tick on Recursive in the Iterator, make sure your output folder is not in the same sub-folder

So for example:

c:\temp
     \Folder1
     \Folder2

BUT

If you look at the syntax section of the help file for the tool Mosaic To New Raster it takes a list of rasters. So what you need to do is feed the output of an iterator into the model only Collect Values tool, this creates your list of rasters. All this must be in a sub-model exposing the output of the collects tool as a parameter. Drop that sub-model into the master model with nothing more than the Mosaic To New Raster tool and connect it. Look at my answer to this question if you are unsure about sub-model and collect tools and how to connect

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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