[gdal-dev] Problem with readraster in C#

Tamas Szekeres szekerest at gmail.com
Mon Nov 30 15:08:50 EST 2009


Patrik,

Do you have this data available to reproduce the problem?

Best regards,

Tamas



2009/11/29 patsv <patsv at bredband.net>

>  Hi,  I am trying to read GDEM data from the ASTER dataset.
>
> But all I get is a buffer with zeroes, is there something wrong with my
> code or is it something with the readraster function.
>
>
>
> Part of my code:
>
>        Band band = ds.GetRasterBand(1);
>
>        short[] DEM = new short[band.XSize * band.YSize];
>
>
>
>        CPLErr Ret = band.ReadRaster(0, 0, band.XSize,band.YSize, DEM,
> band.XSize, band.YSize, 2, band.XSize * 2);
>
>        if (Ret != CPLErr.CE_None)
>
>        {
>
>                 throw new Exception("Read error " + Ret.ToString());
>
>        }
>
>
>
> As mentioned above all I get is a buffer filled with Zeroes.
>
>
>
> Thanks for a good library.
>
>
>
> Regards
>
> Patrik Svensson
>
>
>
>
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20091130/3be43fad/attachment.html


More information about the gdal-dev mailing list