[gdal-dev] Extract data from a.dem file

Carmelo Terrasi terrasi.carmelo at gmail.com
Mon Sep 6 11:25:31 EDT 2010


Hello everybody,
I'm trying to figure out how to get elevation from a .dem file.

I opened the file:
...
pointerToDataSet=(GDALDataset*) GDALOpen("myFile.dem", GA_ReadOnly);
...


So I caught a grid as a 371x371 matrix, but I can read only the first line,
so the first 371 elevations... the error is: *...Access window out of range
in RasterIO()...*

I mean If I put coordinates like (*0*, *somethingelse*) where 0<*
somethingelse<*370:
...
pointerToBand->RasterIO( GF_Read, 0, *somethingelse*, nXSize, 1, elevation,
nXSize, 1,  GDT_Float32, 0, 0 );
...
that's ok



Instead if I put coordinates (*x*, *somethingelse*) where
0<*somethingelse*<370 and
0<*x*:
...
pointerToBand->RasterIO( GF_Read, *x*, *somethingelse*
, nXSize, 1, elevation, nXSize, 1,  GDT_Float32, 0, 0 );
...
that doesn't work :(

I opened myFile.dem with a text editor and I've seen the whole matrix as a
linecode values...
There's something I cannot understand obviously, any tips would be really
appreciated, thanks in advance,
Regards
Carmelo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100906/a8ae4bfc/attachment.html


More information about the gdal-dev mailing list