Markus, The GDAL C# bindings in FWTools is pretty ancient at this point so reporting bugs against it is unlikely to result in improvements. You might want to upgrade to the latest version - either building from source, or perhaps using Tamas' SDK (http://www.gisinternals.com/sdk/).
Best regards, Frank On Wed, May 8, 2013 at 3:07 PM, markus.u.mueller <markus.u.muel...@zoho.com>wrote: > ** > 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@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Software Developer
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev