Just making sure the list is covered as well...<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Jared Carlson</b> <span dir="ltr">&lt;<a href="mailto:jared.carlson23@gmail.com">jared.carlson23@gmail.com</a>&gt;</span><br>
Date: Mon, Nov 23, 2009 at 4:15 PM<br>Subject: Re: [gdal-dev] Help with USGS SDTS DEM<br>To: Greg Coats &lt;<a href="mailto:gregcoats@mac.com">gregcoats@mac.com</a>&gt;<br><br><br>Hi Greg,<div><br></div><div>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 &quot;dumb&quot; loop gives me 4338 which is consistent with the conversion...</div>

<div><br></div><div>Any ideas??  </div><div><br></div><div>Thanks a lot for the help though, I appreciate any boost of confidence, even simple unit conversions...</div><div><br></div><div><font color="#888888">- Jared</font><div>
<div></div><div class="h5"><br><br><div class="gmail_quote">
On Mon, Nov 23, 2009 at 4:10 PM, Greg Coats <span dir="ltr">&lt;<a href="mailto:gregcoats@mac.com" target="_blank">gregcoats@mac.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><div>4338 feet = 1322 meters<div>Greg</div></div><br></div><div><div><div>On Nov 23, 2009, at 3:53 PM, Jared Carlson wrote:</div><br></div><div><div></div><div>
<blockquote type="cite"><span style="font-family:&#39;times new roman&#39;, &#39;new york&#39;, times, serif;font-size:16px"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">Hello,</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">I&#39;m trying to reconcile some geological data, via a SDTS DEM, and comparing the elevations from what I&#39;m reading in GDAL to what I&#39;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.</div>


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">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:</div>


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">


pafScanline = (float*) CPLMalloc( sizeof(float) * nXSize * nYSize );</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">  /* Read the buffer via the following call RasterIO(</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">          GF_Read/GF_Write, xoffset, yoffset, width, height, void * data, xBufWidth, yBufHeight, Type, pspace, lspace</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">


<span style="white-space:pre">        </span>  )</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">   */</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
  poBand-&gt;RasterIO( GF_Read, 0, 0, nXSize, nYSize, pafScanline, nXSize, nYSize, GDT_Float32, 0, 0 );</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">


  for (int i=0; i&lt;nXSize*nYSize; i++)</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">    {</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
      if ( pafScanline[i] &gt; value ) value = pafScanline[i];</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">    }</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">


<br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">I see a max value of 4338...</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br>
</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">Does anyone have some experience with this??  I&#39;m a newbie to GDAL so perhaps I&#39;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.</div>


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">Thanks for any help,</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">


<br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"> - Jared</div></div></span></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div></div>
</div><br>