Fwd: [gdal-dev] Help with USGS SDTS DEM

Jared Carlson jared.carlson23 at gmail.com
Mon Nov 23 16:16:12 EST 2009


Just making sure the list is covered as well...

---------- Forwarded message ----------
From: Jared Carlson <jared.carlson23 at gmail.com>
Date: Mon, Nov 23, 2009 at 4:15 PM
Subject: Re: [gdal-dev] Help with USGS SDTS DEM
To: Greg Coats <gregcoats at mac.com>


Hi Greg,

Ok, but then where does the min,max calculation give me a different answer?
 The ComputeRasterMinMax gives me (0,4116) but as I said, doing the "dumb"
loop gives me 4338 which is consistent with the conversion...

Any ideas??

Thanks a lot for the help though, I appreciate any boost of confidence, even
simple unit conversions...

- Jared


On Mon, Nov 23, 2009 at 4:10 PM, Greg Coats <gregcoats at mac.com> wrote:

> 4338 feet = 1322 meters
> Greg
>
> On Nov 23, 2009, at 3:53 PM, Jared Carlson wrote:
>
> 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/f6f5c9d8/attachment.html


More information about the gdal-dev mailing list