Is This Content Helpful?
We're glad to know this article was helpful.
After merging or mosaicking grids in ArcView 3.x, there may be areas of no data cell values left between the grids. The following code sample will demonstrate how to fill these gaps.
The following code will use a FocalStats request in conjunction with a Con request to only change the NoData cell values. The FocalStats request will determine the new cell value by averaging the cell values in the neighborhood (NbrHood) around the NoData cells. Please see the ArcView Online Help documentation for specifics on these requests.
theView = av.GetActiveDoc
theGrid = theView.GetActiveThemes.Get(0).GetGrid
theNbrHood = NbrHood.Make
theNewGrid = (theGrid.IsNull).Con((theGrid.FocalStats(#GRID_STATYPE_MEAN,theNbrHood,FALSE)),theGrid)
theGTheme = GTheme.Make(theNewGrid)
Just in case the copy/paste applies some justification to the script, be sure the line beginning "theNewGrid" is complete. Otherwise, the code may not compile.
Depending on the data, modification of the neighborhood may be necessary. Vertical and horizontal gaps, odd terrain shapes or large gaps require different neighborhood matrices to get positive results. The default 3x3 matrix is used in this code.