Select to view content in your preferred language

How do I interpolate a raster file?

12858
7
06-13-2011 05:35 AM
RichardBecker
New Contributor
Hi All,

I've downloaded 90 m SRTM elevation data but the raster data contains "holes" of no data that I would like to fill in. 

Is there a way to directly interpolate a raster image? 

I've looked quite a bit, but I've been unable to find a way.  As a work around I've converted the raster file to a collection of point values and attempted to interpolate that, but this always leads to "System Error (0): Unexpected Error.  Failed to Execute."  I've attempted working with a smaller extents (perhaps still too large), but I still get the same error.  The interpolation method that I was attempting to use was spline, so I selected IDW, thinking that it might be less computationally intensive, but I still get the same problem, even when I reduce the resolution greatly.

Is it possible to directly interpolate a raster image, or must it be converted to a point or TIN file first?  How big can a file be without causing trouble?

Thanks in advance for any suggestions that you might have.

Sincerely,
Richard
Tags (1)
0 Kudos
7 Replies
JeffreySwain
Esri Regular Contributor
Have you considered the Fill tool?  It is used to fill in gaps in the data within certain parameters.  This should create the complete DEM that you are looking for.
0 Kudos
PatrickTaurman
Deactivated User
I would use something along the line of this:

CON(isnull([raster]), FOCALMEAN([raster], rectangle,4,4), [raster])

You can change the size of the rectangle.  I am sure someone probably has a better way than this, but it generally works well for me.

Patrick

EDIT:  Just realized this was posted in the 3D Analyst forums, not Spatial Analyst.  My suggestions requires Spatial Analyst extension (as does the Fill tool suggested previously).

2nd edit to add syntax for ArcGIS 10:  Con(IsNull("raster"),FocalStatistics("raster",NbrRectangle(4,4),"MEAN"),"raster")
0 Kudos
MarcMonbouquette
New Contributor
Patrick,

I'm trying to use the script you provided above to fill in NoData masks I blazed into a single raster image in ArcGIS 10, and it keeps giving me the following error message:

ERROR 000539: Error running expression: rcexec() <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function.
("esri.Envelope") The operation was attempted on an empty geometry.
ERROR 010298: Unable to allocate memory.
ERROR 010067: Error in executing grid expression.

Is this simply indicating an error with my processing capacity or is there something more that you can identify?

Thanks,

Marc
0 Kudos
PatrickTaurman
Deactivated User
Hi Marc,

What version of python do you have installed?  What was the exact syntax you were using in the raster Calculator?  Where are you outputting to (file geodatabase, sde, disk)?  What output format if outputting to disk (tiff, img, etc)?  How large is the raster you are trying to run this on?

Patrick
0 Kudos
MarcMonbouquette
New Contributor
Hey Patrick,

I was actually able to run the script successfully this morning.  I think the problem was that I had 3 separate inputs of the same raster image going into the raster calculator tool (one for each time "raster" is listed in the script, most likely) in the model builder, and when I opened it up today it only had one input file going in.

But that being said, the results from the successful run have led me to another question.  The NoData gaps I am trying to fill in are all different sizes, some of which might be around 100 cells in length in a given direction.  The raster file created from the script started to fill in the gaps, but it only worked to fill in a thin border around many of the gaps because of the 4x4 NbrRectangle size.  Is there a way that the rectangle can grow itself based on the size of the gaps, or to keep the focal window moving and averaging until it fills in all of the NoData cells?

Thanks,

Marc
0 Kudos
PatrickTaurman
Deactivated User
There isn't any way I know to make this "grow" until it fills the NoData.  The only thing I can think to do is either increase the size, or run it multiple times.

Patrick
0 Kudos
ChrisBater
Deactivated User
Have you checked out and of the void-filled SRTM products? For example:

http://srtm.csi.cgiar.org/
0 Kudos