4

I need to extent the Value of a grid (water mirror elevation) within the nodata area until reaching a specific barrier (the limit of the watershed), in ArcGIS 10.2 for Desktop.

I am using this:

Con(IsNull("grid"),FocalStatistics("grid",NbrRectangle(3,3),"MEAN"),"grid")

So far I have applied it successively to the last output, increasing the size of the rectangle slowly. This is run in a ModelBuilder.

enter image description here

I was getting bored and I have tried to run an raster iterator to apply a focal statistics on each Output.

enter image description here

The model runs it only one time and stops. I was expecting to have to force to stop once it reachs the barrier . And the pre-existing value are also interpolated, which is not the purpose here.

  • Why is the size of the rectangle neighborhood increasing at each iteration? – GISGe Aug 6 '14 at 9:54
  • Because along the first real values, they may be some variations in the value that have to be kept. But the further from the original value, the less artefacts have to be produced by not keeping these variations. Also, the extension of the extrapolation goes up to 5000 meters and I thought that would be quicker. – PMessager Aug 6 '14 at 10:25
4
+50

I'm not sure how to manage your changing neighborhood size, but here is already an answer.

Iterate Rasters runs the same tool/chain of tools for a series of datasets in the specified workspace, so it's not going to do what you need. If you want to reuse the output of the model as input a number of times, you should do the following:

  • Right-click the input of the Focal Statistics tool > Properties > General tab. As Feedback Variable, pick the result of the Focal Stats tool:

enter image description here

  • Name the result of the Focal Statistics tool something like C:\Results_%n%. %n% is the nth result of the iteration. The first output will be named Result_0, the second one Result_1, and so on. You can't use the exact same dataset as input and output, so this does the trick.

  • Determine how many times the model will run by right-clicking within the model > Model Properties > Iteration tab. There you have 3 options:

enter image description here

In your case you might want to run the tool a fixed number of times (first option), check if the chosen number of iterations was sufficient, and adjust. Or you can choose the third option and create a variable that will turn False when you model can stop. You could stop the model when there's no NoData values anymore, for example. to do this, see next step.

  • Add the Get Raster Properties tool to your model, connect it to the input and choose 'ANYNODATA' as property type:

enter image description here

'Property' will be true as long as there is at least one NoData cell in the raster. So the model will run until there's no NoData anymore (and given the maximum number of iterations you've indicated for the third option). Connect 'Property' as precondition of the Focal Stats tool, otherwise the tool might run before checking its value.

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.