[gdal-dev] SDTS elevation values

Frank Warmerdam warmerdam at pobox.com
Mon Aug 4 12:45:48 EDT 2008

Karthik wrote:
> Hi,
>                 I have been using GDAL for SDTS raster terrain format 
> for reading DDF files provided by USGS. To get the exact interpolated 
> elevation at a particular point, I used the logic in 
> http://en.wikipedia.org/wiki/Bilinear_interpolation. For verifying 
> whether the values match exactly, I used Global Mapper but I find that 
> the variation of around 6 to 10 occurs and some places around 20. I 
> tried my code on various samples and in almost every sample I get the 
> same observation. I am sure I am missing something. I am attaching the 
> CPP file along with the makefile in this mail.


I would suggest doing a bit more specific testing.

Do you get an exact match when you check the center of a pixel (ie. no
bilinear interpolation is required?)

I would suspect an off-by-half-pixel error in positioning, but I'm not
brave enough to dig through your code in detail.

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    | President OSGeo, http://osgeo.org

More information about the gdal-dev mailing list