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 3:22 AM

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

How display layer .adf?

Coordinator
Nov 22, 2011 at 9:26 AM

You may have luck using GdalRasterLayer (see: http://www.gdal.org/frmt_various.html#AIG)

Hth FObermaier

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

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

Who can code display a file .adf?

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

This is error srid of me.

http://i262.photobucket.com/albums/ii120/manh8x9/error.png

Developer
Dec 11, 2011 at 3:31 PM

have you configured FWTools the right way? http://sharpmap.codeplex.com/wikipage?title=Configure%20GDAL%20%20OGR%20FWTools%20%28as%20of%20revision%2057193%29&referringTitle=How%20to...

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

I'm configured same u.

http://i262.photobucket.com/albums/ii120/manh8x9/error1.jpg

But it's still error GDAL.Dataset dataset

Developer
Dec 12, 2011 at 7: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 7: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?)

Coordinator
Dec 20, 2011 at 1: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 2: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;

            OSGeo.GDAL.Gdal.AllRegister();
            try
            {
                _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\

Coordinator
Dec 21, 2011 at 10: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?