[gdal-dev] Bug in of GDALRead.cs

Tamas Szekeres szekerest at gmail.com
Wed May 8 23:34:45 PDT 2013


Markus,

The GDAL issue tracker is the right place to record such issues (
http://trac.osgeo.org/gdal/newticket). I'd also require your sample
dataset, since I have no ArcMap 10 available to reproduce that according to
your description below.

Best regards,

Tamas



2013/5/9 markus.u.mueller <markus.u.mueller at zoho.com>

> **
> Dear listers,
>
> I  think I found a bug in GDALReadDirect.cs (part of FWTools). Is this the
> right place to record it? I will describe the problem anyway and would be
> willing to move it to another place if more appropriate.
>
> I want to read Arc/Info Binary Grids and convert them to other image
> formats using the C#-bindings of GDAL. I installed FWTools 2.4.7 and the
> current binaries (MSVC2010 (Win64) -stable) from
> http://vbkto.dyndns.org/sdk/. Then I started testing the example
> C#-programs that are part of FWTools, especially  GDALReadDirect.cs. When I
> use the demo dataset utm.tif, this all works fine.
>
> I then converted utm.tif to the Arc/Info Binary Grid format using ArcMap
> 10 (Conversion Tools - To Raster - Raster to other Format). When I try to
> use  GDALReadDirect.cs I get the following error messages:
>
> Using driver Arc/Info Binary Grid Band 1 :    DataType: GDT_Int16    Size (512,512)    PaletteInterp: GCI_Undefined       OverView 0 :          DataType: GDT_Int16          Size (256,256)          PaletteInterp: GCI_GrayIndex       OverView 1 :          DataType: GDT_Int16          Size (128,128)          PaletteInterp: GCI_GrayIndex The number of the raster bands is not enough to run this sample
>
> GDALReadDirect.cs obviously has an erroneous method named SaveBitMapDirect,
> that first checks on the available Color interpretation and then on the
> number of bands. After the file is converted to Arc/Info binary Grid
> format, the information about the Color interpretation is lost, so only
> then the program checks on the number of available bands and returns an
> error message. SaveBitMapDirect works for the described case if Line 157
> is edited:
>
> if (redBand.GetRasterColorInterpretation() == ColorInterp.GCI_GrayIndex ||
> redBand.GetRasterColorInterpretation() == ColorInterp.GCI_Undefined)
>
> This is not a general fix, only for the immediate problem.
>
>
>
> Cheers,
>
>
> Markus
>
>
>
>
>
>
> _______________________________________________
> 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/20130509/1841fb94/attachment-0001.html>


More information about the gdal-dev mailing list