Select to view content in your preferred language

Iterator to add succeeding values to feature output name and iterators into other iterators

405
1
11-14-2024 03:28 PM
BarrettLewis1
Regular Contributor

Hi all. I am attempting to create a large model of many submodels, all of which contain iterators. The first submodel is an iterate raster model which outputs clipped rasters. It ends with the "Collect Values" tool. Next, I have two questions:

1. When I add the first submodel to the larger model, I can't connect the output to another iterator. I assume that all I can really do here is re-connect the workspace to the second iterator and simply have the submodel act as a precondition. Please let me know if there is something I am missing.

2. I want to rename the outputs from the first model so that their names include their year. There is one raster per year, beginning in 1985. So I want the output to be something like "Raster_1985", then "Raster_1986", up to "Raster 2023". I thought maybe Iterate Time was the way to do this but I can't figure it out. Any help?

Tags (2)
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

1] To expose the sub model in your master model, edit the sub model and expose the output of the collect values tool as a PARAMETER. Just right click on it and select parameter. Save you changes then drag 'n' drop the sub-model into the master model and you will be able to feed the list of rasters into the next tool.

2] You don't say where the year value is stored? I assume its part of the file path name of the rasters that the iterator is stepping over? If so use the calculate value tool to extract that part of the file name and then use inline variable substitution to help build your output raster name. I would so this all in the sub-model.

0 Kudos