I received a request to produce a model that would interpolate values to fill in holes present in a digital elevation model (DEM). Such holes can be common in DEMs derived from Interferometric SAR techniques and LiDAR data.
|Input DEM with holes shown in red||Output DEM with continuos surface|
As an example of the versatility of using Spatial Models, I used this older model as the starting point for building up this model, because it already showed how to turn individual pixels into point features attributed with the corresponding pixel's DN value:
The premise of the model is that there are patches of the DEM where no data could be generated and so there are "holes" (which were already set to value-based NoData in the DEMs I used to test the model). It was desired to fill these holes by using valid height values from around the edges of the holes to interpolate a continuous surface across the gaps. So the holes are turned into a unique class value (32767 was used in this model) and then that class is buffered (using the Search operator) to a distance of two pixels to form a two-pixel wide band (or ring) around each hole. Two pixels is used as the default, but the user can specify a larger (or smaller) distance if desired.
|Create Unique DN Values sub-model|
All pixels falling under the buffer band are then converted to point geometry features and attributed with the height value of the underlying source pixel.
These height point features are then used as input to the Convert to Surface operator which will create an interpolated continuous surface.
Just the original hole locations are then filled in using the interpolated values so that the original DEM values are not altered.
Finally, if present in the input DEM, the vertical datum information is reattached to the raster stream and a new raster DEM is output.
Raster DEM: Provide the input image filename of the raster DEM with NoData holes.
Output DEM: Provide an output DEM name with NoData holes closed
Hole Buffer: Distance (in pixels) around the NoData holes to buffer. These pixels provide the height samples for the interpolation, Default is a 2 pixel wide ring.
s17.dt1 – a Digital Terrain Elevation Data (DTED) raster file derived from the Shuttle Radar Topography Mission (SRTM) with occluded pixels marked as NoData