[Gdal-dev] Reading USGS ASCII DEMS

Frank Warmerdam warmerdam at pobox.com
Thu Jul 29 13:52:51 EDT 2004


StefanReisser at t-online.de wrote:
> Hello everybody! I have a question concerning the reading and input of
> DEM files in USGS ASCII format:
> 
> As the quadrilateral, containing the height information, often has a
> variable orientation in relation to the UTM grid, how can I just read
> the values that do contain real height information. Futhermore, how can
> I get the quadrilateral's UTM coordinates out of the DEM using GDAL
> (note: I'm not interested in the corners of the rectangle, but the
> corner's of the quadrilateral, the DEM itself.

Stefan,

The driver does not currently return any information on where the
"real corners" are. However, it does return information indicating that
the "nodata" value is -32767 so you can easily identify pixel values that
aren't valid.

In theory it is possible to figure out what 7.5" section you are in for
any given file, and from that work back to which pixel locations are the
corners but it is somewhat complicated and there are still some issue of
roundoff error.

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