Iterate a raster hundreds of times with raster calculator

08-08-2019 08:17 AM
New Contributor

Hi everyone,

I am new to iterators in model builder (i use ArcGIS Pro 2.4).

What i'm trying to do : 

I have a relatively large DEM (50km by 200km in Lidar - 1m resolution) with big gaps of NoData in some lake centers. I want to fill these gaps by a cells of value of the Mean of the cells around them. So i'm using raster calculator like this:  

Con(IsNull("MNT_RPNS_m"), FocalStatistics("MNT_RPNS_m", NbrRectangle(6,6,"CELL"), "MEAN"), "MNT_RPNS_m")  Output : MNT_RPNS_fill

The problem is that the gaps are so big that i will need to do a lot of time.

I Tried two type of iterators 1 : While and 2 : for.

1: I tried to use the "while iterator" with a value of "IsNull(("MNT_RPNS_m")"  -> continue

and link it to my raster calculator (Pre condition) so it runs till there is no more NoData. 

Its runs for one time and than its stops with the error : "000733: <value>: Same as input <value>"

2: I tried with the "for iterator" with value of 1 to 5 (planning to do 1 to 100 when it would work) And connecting the loop to the raster calculator and changing the output to " MNT_fill%Value%". I added a Feedback loop to it connected to the input, so it would redo the rastercalculator with the newly created raster "MNT_Fill1".

It worked for "MNT_Fill1", but for the second one i got the same message as for the while iterator "000733: <value>: Same as input <value>".

Do you have an idea of how i could make this work?

Thanks you.

I will be posting pictures of the models later today (my ArcGIS is loading something right now)

0 Kudos
1 Reply
New Contributor

**Update! I managed to make it work!

0 Kudos