[Geotiff] Processing Elevation data in Geotiff

Frank Warmerdam warmerdam at pobox.com
Wed Sep 6 12:14:42 EDT 2006


Chandrakant Mohire (RBIN/ECM2) wrote:
> Hello ,
> 
> Firstly I am  new to the geotiff world .
> 
> I am trying to  read DEM data which is supplied in geotiff format. Its 
> geotiff image with 181 rows x 181 cols
> 
> I  wrote some code to read the basic tags. And they are as follows
> 
> SAMPLESPERPIXEL  1
> 
> TIFFTAG_BITSPERSAMPLE  16
> 
> TIFFTAG_PHOTOMETRIC  1     (1       /* min value is black */ )
> 
> TIFFTAG_PLANARCONFIG  1   ( single plane image)
> 
> Now my doubt how do I read the height data stored in this Geotiff Image  ?

Chandrakant,

The data would be read with the appropriate libtiff functions.  Likely
TIFFReadEncodedStrip() or perhaps TIFFReadEncodedTile().

> And is this height stored relative to some value ( like any value seen 
> in  ModelTiepointTag  .. )

This is unspecified in this dataset.  Presumably it would relative to
mean sea level in meters.  There is no reason to believe there is any
arbitrary offset or scaling that needs to be applied to the elevation
values.

> Any API’s in libgeotiff  / pointers on handling Digital Elevation data 
> in geotiff will be appreciated .

There aren't any specific functions for elevation data.  There is a bit of
stuff about vertical datums in the geotiff specification, but these are not
widely used, even by folks producing elevation datasets in GeoTIFF.

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 Geotiff mailing list