1

enter image description hereI have a basic model that uses Raster Iteration to process all of the rasters in a .gdb. The model allows the user to define a weighting in the GUI and then the model runs a raster calculation on each iteration, stores the results in Collect Values and finally does a Cell Statistics calculation ton create the final output.

As of now the Raster Iteration runs through all rasters in the .gdb. Is there a way of providing the user with a checkbox/radio button in the GUI to just choose a selection of the rasters in the .gdb?

The image below shows the model and the GUI. Ideally I'd like to be able to select the required rasters in the GUI before assigning the weightings.

3
  • There are two routes I see with this. Modifying the script behind of the model to accept arcpy.GetParameterAsText and convert it over into a script tool, or you could create your own GUI using ArcObjects and call your script/model (not sure if you can call a model?). Have you looked into these options? – Branco Feb 19 '15 at 15:55
  • Branco - thanks. I'll look into this. With no experience with py is this a big challenge? – Justin Feb 19 '15 at 16:12
  • Somewhat.. It depends on how quickly you can pick up the nuances of arcpy and python. I am not 100% sure you can pre-define a list of options though in this manner. I read a post before saying you could populate a parameters list, but I have no experience with it. You probably can through ArcObjects, but that may be overkill and a lot more effort than you'd want to put into it. – Branco Feb 19 '15 at 16:24
1

Insert > Variable, and choose Raster Catalog. Create a set of raster catalogs in a geodatabase by right clicking on the GDB and selecting New -> Raster Catalog, and then right clicking on the newly created catalog and clicking Load -> Load Raster Datasets for your premade sets of raster groupings. Then right click on the variable and check the Model Parameter option.

Some other goodies you can do to modify your tool in ModelBuilder can be found here

5
  • That is close but what i want to do is have pre-defined list that the user can choose from with a check box if possible. This solution only allows the selection of one raster from the .gdb – Justin Feb 19 '15 at 16:11
  • You may want to try using a Feature Dataset as the input variable and have multiple predefined feature datasets within your GDB, each one containing rasters. You can create a feature dataset by right clicking on your GDB and going New > Feature Dataset. – Alex McVittie Feb 19 '15 at 16:19
  • So use Iterate Feature Classes or Datasets instead of Raster Iteration? – Justin Feb 19 '15 at 17:43
  • Nevermind, that wouldn't work. Sorry about that. I need to get more sleep before I go on StackExchange. You can just create Raster Catalogs in your gdb and then have it iterate through those, no other changes need to be made to your model. I'll edit my answer so that this is in it. As for a checkbox list, it might be possible but I think it would be a lot more effort than what its worth. – Alex McVittie Feb 19 '15 at 17:58
  • Thanks Alex - will this allow the user to pass multiple raster files (selected) to the raster iteration process? – Justin Feb 20 '15 at 6:41

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.