This project has moved. For the latest updates, please go here.

Display layer .ADF file?

Topics: Algorithms, CompactFramework, Data Access, Español, General Topics, Italiano, SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0, Web Controls, WinForms Controls
Nov 22, 2011 at 2:22 AM

I have a file layer .adf (Arc/Info Binary Grid (.adf)* 

How display layer .adf?

Nov 22, 2011 at 8:26 AM

You may have luck using GdalRasterLayer (see:

Hth FObermaier

Dec 5, 2011 at 2:06 AM
Edited Dec 5, 2011 at 2:55 AM

How to use GdalRasterLayer ...add file .adf ? When added GdalRasterlayer.cs

Who can code display a file .adf?

Dec 10, 2011 at 2:17 AM
Edited Dec 10, 2011 at 3:04 AM

This is error srid of me.

Dec 11, 2011 at 2:31 PM

have you configured FWTools the right way?

Dec 12, 2011 at 1:41 AM
Edited Dec 12, 2011 at 1:49 AM

I'm configured same u.

But it's still error GDAL.Dataset dataset

Dec 12, 2011 at 6:10 AM

Is the project running as a 32bit application? This is necessary to use GDAL, since GDAL provided only a 32bit library

Dec 12, 2011 at 6:29 AM

i using 32 bit...


This is error 

private GDAL.Dataset _GdalDataset;

private void GetPreview(GDAL.Dataset dataset, System.Drawing.Size size, Graphics g, SharpMap.Geometries.BoundingBox bbox)

The type or namespace name 'GDAL' could not be found (are you missing a using directive or an assembly reference?)

Dec 20, 2011 at 12:26 PM

Be sure that your web project has references to gdal_csharp.dll, osr_csharp.dll and ogr_csharp.dll.

For the demo web project, those files are copied to the "bin" folder.

Hth FObermaier

Dec 21, 2011 at 1:48 AM

my program have gdal_csharp.dll, osr_csharp.dll and ogr_csharp.dll?

 public GdalRasterLayer(string strLayerName, string imageFilename)
            this.LayerName = strLayerName;
            this.Filename = imageFilename;
            disposed = false;

                _GdalDataset = Gdal.Open(_Filename, GdalConst.GA_ReadOnly);
                imagesize = new Size(_GdalDataset.RasterXSize, _GdalDataset.RasterYSize);
                _Envelope = this.GetExtent();
            catch (Exception ex) {
                _GdalDataset = null;
                throw new Exception("Couldn't load dataset. " + ex.Message + ex.InnerException);


This is error

Error    1    The best overloaded method match for 'OSGeo.GDAL.Gdal.Open(string, OSGeo.GDAL.Access)' has some invalid arguments    C:\Users\Manh\Documents\Visual Studio 2010\GADL\App_Code\GdalRasterLayer.cs    33    32    C:\...\GADL\
Error    2    Argument 2: cannot convert from 'int' to 'OSGeo.GDAL.Access'    C:\Users\Manh\Documents\Visual Studio 2010\GADL\App_Code\GdalRasterLayer.cs    33    53    C:\...\GADL\

Dec 21, 2011 at 9:39 AM

I strongly suspect you have some sort of mismatch on your machine.

Do you have some other version of FWTools installed or some other version of GDAL/OGR and path variables set to their directories?