Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

is there a way to handle an error within the ArcGIS ModelBuilder? I have a model which iterates over hundreds of raster files. some of them may be corrupt. i`m looking for a way in which the ModelBuilder skips any corrupt raster files and proceeds with the next file.

share|improve this question

2 Answers 2

ModelBuilder is great but has its limitations even with the new (to v 10) iterations and much depends on how you define 'corrupt'. While it would not be impossible to do what you want in ModelBuilder, I think it would get messy and you would probably have to write a script to test whether the file meets your criteria anyway. Therefore, it would probably be simpler to export your model to Python and add a try-except test.

I regularly used ModelBuilder to prototype a process and then export it to Python and add tests for validity, iterations etc. Just note that the export from ModelBuilder will not include the iteration but that is straight forward to add.

share|improve this answer
    
thanks mappagnosis, that was my plan b. i will try it that way. –  user1504307 Feb 28 '13 at 12:03
    
I always opt for pragmatism over coercion when it comes to model builder :) –  MappaGnosis Feb 28 '13 at 16:38

Another alternative to skipping errors would be to instead pre-test for issues that would lead to errors. So, in your example above, after you iterate to the next raster, you could write a small Python script that could pre-test the raster and either pass or fail the raster, at which point your model could read the results (True/False?) either pass the layer to the remaining portion of skip it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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