I've created 5,000 viewshed rasters for ~5,000 sites in my study area. Using ModelBuilder, I am trying to reclass these rasters so that all "0" values are now "NoData".

When I iterate across all rasters in my folder, it seems to work well until I get to the 4,001th raster. Then the operation stops and I receive an error message. This has happened three times.

It doesn't seem to be a matter associated with naming, as the operation works for the first 4,000 rasters. Does anyone have any idea why this may be happening? I don't have the error message recorded, unfortunately, but I'm wondering if anyone has come up on similar issues.

  • I've come across similar situations with model builder and it's probably some sort of memory leak. I would restart your model at 4001 and let it continue.
    – Hornbydd
    Oct 11 '16 at 13:28
  • Thanks for the help! I must admit ignorance here. How do you restrict the model to only run on those observations from, say, 4000 to 5000 if I'd be restricting based on a file name, rather than a feature value? Does this make sense?
    – Andy B
    Oct 11 '16 at 17:16

A model with a For Iterator can be used to help construct raster dataset names that can then feed into your workflow.

A simple example is shown below. See how the output of the iterator called value is used as in an inline substitution (the %value%) in the calculate value tool to create a raster dataset path which can feed into the raster to point tool. You would also use the inline substitution in that tool to create valid and unique file names.

Example model

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.