[Gdal-dev] Data format

Ben Discoe ben at vterrain.org
Fri Feb 13 14:23:26 EST 2004


> -----Original Message-----
> From: Clay, Bruce
> 
> The data file I opened is a DEM file from the GTOPO30 data set.
> When I use RasterIO I get
> back a buffer full of floats.  How do I interpret them?

They are elevation in meters.

> The origin is 20.0, 40.0 I assume this is latitude and longitude.

Yes.

> The pixel size is 0.008333, -0.008333.  Does this represent 
> the distance between values in degrees?

Yes.

>  What does the negative number represent?

The fact that pixel sizes are measured from the top-left corner downward,
which is the negative latitude direction.

> The GetRasterxxx methods say that the file data 4800 x 6000 x 1.
> Does this mean that only the elevation data is in the file?

Yes.  Were you expecting something more in a GTOPO file?

> The bands are reported to be 4800 wide. Based on the file names
> in the GTOPO30 data set it looks like they cover 40 Deg. Longitude
> but differing coverage in latitude.  

Yes.

> I am trying to find the elevation for specific coordinates based
> on latitude and longitude input.

You have the corner and the extents, so it's simple arithmetic to compute
the offset based on an input, X,Y = (input-corner)/pixel_size

> Sorry if these are dumb questions.

We're all beginners at some point :)

-Ben




More information about the Gdal-dev mailing list