[Gdal-dev] Problem Reading DEMs

StefanReisser at t-online.de StefanReisser at t-online.de
Thu Jul 29 20:25:00 EDT 2004


Hi, it's me again!

I have a strange problem, when reading USGS ASCII DEMs:
When using the RasterIO - function to read in the data, the data in the
buffer is either always 0 or always -32767 (nodata value), although the
data should be defined! 
I am using the following lines of code to read in the file:

GDALDataset *dataSet;
GDALRasterBand *dataBand;

dataSet = ( GDALDataset * ) GDALOpen( "fileName.dem", GA_ReadOnly );
dataBand = dataSet->GetRasterBand( 1 );

dataBand->RasterIO( GF_Read, 0, 0, width, height, dataBuffer, width,
height, GDT_Int16, 0, 0 );

where "dataBuffer" is an array of type "short".

Thanks for the efforts,

Kind regards

Stefan





More information about the Gdal-dev mailing list