OK guys, I got it, very helpful!<div>Thank you so much<br><br><div class="gmail_quote">2010/9/6 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yes , what you see is expected.<br>
<br>
The prototype of RasterIO() is :<br>
<br>
RasterIO( flag, x, y, width, height, buffer, buffer_width, buffer_height,<br>
gdal_type, pixel_offset, line_offset)<br>
<br>
so that means that you ask the extraction of the window [x, x + with-1] x [y,<br>
y + height -1] to be stored in a buffer_width x buffer_height buffer.<br>
<br>
so if you set x to be non-null, you cannot ask for the full XSize to be read,<br>
the maximum value for width is XSize - x.<br>
<br>
See <a href="http://gdal.org/classGDALRasterBand.html#5497e8d29e743ee9177202cb3f61c3c7" target="_blank">http://gdal.org/classGDALRasterBand.html#5497e8d29e743ee9177202cb3f61c3c7</a><br>
for the full reference.<br>
<br>
Le lundi 06 septembre 2010 17:25:31, Carmelo Terrasi a écrit :<br>
<div><div></div><div class="h5">> Hello everybody,<br>
> I'm trying to figure out how to get elevation from a .dem file.<br>
><br>
> I opened the file:<br>
> ...<br>
> pointerToDataSet=(GDALDataset*) GDALOpen("myFile.dem", GA_ReadOnly);<br>
> ...<br>
><br>
><br>
> So I caught a grid as a 371x371 matrix, but I can read only the first line,<br>
> so the first 371 elevations... the error is: *...Access window out of range<br>
> in RasterIO()...*<br>
><br>
> I mean If I put coordinates like (*0*, *somethingelse*) where 0<*<br>
> somethingelse<*370:<br>
> ...<br>
> pointerToBand->RasterIO( GF_Read, 0, *somethingelse*, nXSize, 1, elevation,<br>
> nXSize, 1, GDT_Float32, 0, 0 );<br>
> ...<br>
> that's ok<br>
><br>
><br>
><br>
> Instead if I put coordinates (*x*, *somethingelse*) where<br>
> 0<*somethingelse*<370 and<br>
> 0<*x*:<br>
> ...<br>
> pointerToBand->RasterIO( GF_Read, *x*, *somethingelse*<br>
> , nXSize, 1, elevation, nXSize, 1, GDT_Float32, 0, 0 );<br>
> ...<br>
> that doesn't work :(<br>
><br>
> I opened myFile.dem with a text editor and I've seen the whole matrix as a<br>
> linecode values...<br>
> There's something I cannot understand obviously, any tips would be really<br>
> appreciated, thanks in advance,<br>
> Regards<br>
> Carmelo<br>
</div></div></blockquote></div><br></div>