[gdal-dev] Help with USGS SDTS DEM

Jared Carlson jared.carlson23 at gmail.com
Mon Nov 23 15:53:09 EST 2009


Hello,

I'm trying to reconcile some geological data, via a SDTS DEM, and comparing
the elevations from what I'm reading in GDAL to what I'm seeing in ENVI.  I
seem to be reading everything in but am having issues with the actual
elevation data which seems to be scaled incorrectly.

For example, moving through the ENVI image, I see the maximum value for a
Maui DEM is 1322, but the Min/Max from GDALComputeRasterMinMax( .. ) is 0,
4116, but when I loop through my raster data, using:

pafScanline = (float*) CPLMalloc( sizeof(float) * nXSize * nYSize );
  /* Read the buffer via the following call RasterIO(
          GF_Read/GF_Write, xoffset, yoffset, width, height, void * data,
xBufWidth, yBufHeight, Type, pspace, lspace
  )
   */
  poBand->RasterIO( GF_Read, 0, 0, nXSize, nYSize, pafScanline, nXSize,
nYSize, GDT_Float32, 0, 0 );

  for (int i=0; i<nXSize*nYSize; i++)
    {
      if ( pafScanline[i] > value ) value = pafScanline[i];
    }

I see a max value of 4338...

Does anyone have some experience with this??  I'm a newbie to GDAL so
perhaps I'm doing something wrong.  I know the actual data in the rasterBand
is an int, but it says in the doc that RasterIO should still grab the
correct data values, and when looking at the GetDataNoValue that seems to
indicate that I did read in the data correctly but the maximums seem off,
and ENVI has different data values.  I checked the Scale and Offset, which
are 1.0, and 0.0 respectively.

Thanks for any help,

 - Jared
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20091123/f212e9ec/attachment.html


More information about the gdal-dev mailing list