Help with model builder and iterators

4028
6
Jump to solution
12-01-2015 03:12 AM
VictorLoss
New Contributor II

Hi, my name is Victor and i'm new at the model building theme, but I need your help to connect two models that Ihave, they function perfectly when executed separately, but when I try to join them, they stop working....

So, here is my scenario: I need to convert a series MODIS image scenes, .hdf type to a geotiff mosaic so I can work with it.

The arrangement of the files are: Modis image folder > Month of the image (ex: Jan15) > Two folders with 7 .hdf scenes each separated by date (ex: 01_01_15 and 17_01_15).

The first model that i built converts the entire folder to a geotiff image, with the same name but with a extension (%Name%_Copy.tif), it works fine if i need to convert just a few images, because i need to select just one date folder at a time, but i can't do it in the batch mode due the iterator for large numbers of dates, and this is very time consuming....

hdf_to_raster_model.jpg

The second model transforms a entire folder into a single geotiff mosaic and rescale it, it works in batch mode, so this step is working just fine

workspace to mosaic model.jpg

If i join the models, when i execute it, the Create Raster Dataset process of the second model doesn't work anymore giving me the 9999 error.

So here's where i need your help, how can I execute the first model in a batch mode or there is another iterator that i can use to do this?

And the second problem but a optional one, why that Create raster process stops workin when i decide to join both models?

             

Sorry for my bad english, it isn't my mother language...

0 Kudos
1 Solution

Accepted Solutions
LukeSturtevant
Occasional Contributor III

Victor I think you might be looking for collect value​ to collect all rasters you iterate through in a folder first. Try something like this

I also have a calculate value tool to remove any periods and remove ".hdf" for the output name, but if your tool works without using that then you don't have to worry about it. Also, you had the tool set up to delete the Mosaic Folder when the tool finished was that intentional? I set it up to delete the raster dataset after the raster calculator output instead of the whole folder.

View solution in original post

6 Replies
DanPatterson_Retired
MVP Emeritus

I have moved this to Geoprocessing because GeoNet Help is about Help on GeoNet GeoNet Community Structure

KenBuja
MVP Esteemed Contributor

That move didn't take, for some reason. I have moved it again.

LukeSturtevant
Occasional Contributor III

Would you be able to upload your combined tool to this thread so we can try to reproduce the error and take a look at what is happening?

0 Kudos
VictorLoss
New Contributor II

Sure, here it is.

To run it, you need a folder with at least two hdf images in it, a empty folder for the raster images and a empty mosaic folder that will be deleted after the process.

https://www.dropbox.com/s/gn29n8wvdhyhnkm/Toolbox_Victor.tbx?dl=0

LukeSturtevant
Occasional Contributor III

Victor I think you might be looking for collect value​ to collect all rasters you iterate through in a folder first. Try something like this

I also have a calculate value tool to remove any periods and remove ".hdf" for the output name, but if your tool works without using that then you don't have to worry about it. Also, you had the tool set up to delete the Mosaic Folder when the tool finished was that intentional? I set it up to delete the raster dataset after the raster calculator output instead of the whole folder.

VictorLoss
New Contributor II

Now the entire model works!

Thank you very much!

0 Kudos