[Gdal-dev] Using DEM

Frank Warmerdam warmerdam at pobox.com
Tue Oct 21 14:00:49 EDT 2003


Sylvain Rioux wrote:
> Hi,
>  
> In GDAL using a USGS DEM file,  is it possible to find the elevation of 
> a point from its coordinates (lat-lon or projected)? Does GDAL have some 
> kind of interpolation method to allow this?

Sylvain,

The short answer is no.  You can use PROJ.4 or OGRCoordinateTransformation
services to reproject a location into the coordinate system of the USGS DEM
file and then convert to pixel/line coordinates.  Then read the four pixels
in the neighbourhood of that pixel/line location and perform bilinear
interpolation.

I have done this in the general warper resampler code, but I am not sure it
would work well to running to warper to produce a single output pixel image.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list