<span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US"></span>Patrik,<br><br>Do you have this data available to reproduce the problem?<br><br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">
2009/11/29 patsv <span dir="ltr"><<a href="mailto:patsv@bredband.net">patsv@bredband.net</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="SV">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi, I am trying to read GDEM data
from the ASTER dataset.</span></p>
<p class="MsoNormal"><span lang="EN-US">But all I get is a buffer with zeroes, is
there something wrong with my code or is it something with the readraster
function.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Part of my code:</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
<span style="color: rgb(43, 145, 175);">Band</span> band = ds.GetRasterBand(1);</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
<span style="color: blue;">short</span>[] DEM = <span style="color: blue;">new</span>
<span style="color: blue;">short</span>[band.XSize * band.YSize];</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
<span style="color: rgb(43, 145, 175);">CPLErr</span> Ret = band.ReadRaster(0, 0,
band.XSize,band.YSize, DEM, band.XSize, band.YSize, 2, band.XSize * 2);</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
<span style="color: blue;">if</span> (Ret != <span style="color: rgb(43, 145, 175);">CPLErr</span>.CE_None)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
{</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
<span style="color: blue;">throw</span> <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">Exception</span>(<span style="color: rgb(163, 21, 21);">"Read
error "</span> + Ret.ToString());</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">
</span><span style="font-size: 10pt; font-family: "Courier New";">}</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">As mentioned above all I get
is a buffer filled with Zeroes.</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">Thanks for a good library.</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">Regards</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US">Patrik Svensson</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";" lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
</div>
</div>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br>