Showing results for 
Search instead for 
Do you mean 


Download model and sample data




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
before.png fter.png


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.




  1. Single band raster DEM as input
  2. Any gaps in the raster must be pre-defined as NoData (before being input to the model)
  3. Ideally the DEM should have a vertical datum defined, but it's not necessary
  4. If you have more holes than pixels, you may be better off using Terrain Prep Tool instead
  5. As implemented, the number of pixels in the input DEM must be less than can be contained in a u32 integer (see Create Unique DN Values sub-model above), i.e. 4 billion pixels, or the equivalent of a 64k x 64k image.


Input parameters:


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.




Example data


s17.dt1 – a Digital Terrain Elevation Data (DTED) raster file derived from the Shuttle Radar Topography Mission (SRTM) with occluded pixels marked as NoData



on ‎04-26-2019 08:30 AM
Great. this is exactly what i was looking for. Is there an option to get the file "interpolate_holes_in_dems_v16_5_2.gmdx" Where can I find it?
by Technical Evangelist
on ‎04-26-2019 08:33 AM - last edited on ‎02-24-2020 03:13 AM by Community Manager

Yes - "Download model and sample data" at the top of the article. You'll need to be logged in with an account associated with the company which has a maintenance contract.



on ‎04-26-2019 09:23 AM
Thanks you very much Ian! I am getting this error: "Could not load Spatial Model." I don't get any further information. I am working with Erdas Image 2015. Am I able to open the model with this version? Best regards
by Technical Evangelist
on ‎04-26-2019 09:35 AM

Hi Angela,


No - the Spatial Model uses Operators which were introduced after ERDAS IMAGINE 2015. You should update to ERDAS IMAGINE 2018 Update 2.




on ‎09-24-2020 01:38 AM

Hi Ian,

I have the same problem but in a pansharpened 3 band imagery. It has holesi,e no data values. Is there is any model i can use to solve the problem. I am new to spatial modeler and we have 2015 erdas imagine.