model builder erroring out with empty output

3343
4
10-16-2015 07:11 AM
JustinMeyers
New Contributor III

I am using a iterator to go through rasters in a fgdb.  I am extracting values, then converting to polygons.  If the raster is empty, the polygon output is empty and the model  builder script stops.  Since I cannot add more than one iterator to a model (thanks esri...) I cannot use if then logic to check/ run the conversion tool.  how can i tell my model it is okay for empty output polys and keep processing?

Tags (1)
0 Kudos
4 Replies
JenniferMcCall4
Occasional Contributor III

Hi Justin,

You can put two iterators in a single model if they both in separate models to begin with.  Create two models, each with an iterator, then use model 1 as a sub-model within model 2.

You can find more information here: Integrating a model within a model—Help | ArcGIS for Desktop

KyleBalke__GISP
Occasional Contributor III

You could always remove the empty rasters from your FGDB...

0 Kudos
JustinMeyers
New Contributor III

party... this seems a bit complex.  i will try it though.  how do i find/ flag/ delete empty rasters in a fgdb?  I have over 850 rasters in the fgdb I am working with - is there a way to delete all the empty ones at once?

Thanks!

0 Kudos
DuncanHornby
MVP Notable Contributor

You can test if a raster is empty by using the Get Raster properties tool.  One of the property types it can test is:

  • ALLNODATAReturns whether all the pixels are NoData.

A simple model with an iterator and this tool would resolve this. The tool appears to return a string value, I have no empty rasters to test with but with a valid raster it returned the text "The raster dataset isn't all NODATA.". So you could use a calculate Value tool to test if that was the text returned, if not then run the delete tool.

0 Kudos