"SharpMap. The Layers. GdalRasterLayer" of type initializers throw an exception

Topics: CompactFramework, SharpMap Project, SharpMap v0.9 / v1.x, WinForms Controls
Nov 13, 2013 at 5:21 AM
Edited Nov 13, 2013 at 5:23 AM
In a recent study Sharpmap, in Winform exercise, I created a GdalResterLayerFactory class, inheritance IlayerFactory.

code in the Create method is as follows:
    #region ILayerFactory Members

    public ILayer Create(string layerName, string connectionInfo)
        GdalRasterLayer gdalRasterLayer = new GdalRasterLayer(layerName, connectionInfo);
        return gdalRasterLayer;

When running load a. Tif files, debugging to
GdalRasterLayer GdalRasterLayer = new GdalRasterLayer (layerName connectionInfo);
Just throw exceptions.

Exception information: "SharpMap. The Layers. GdalRasterLayer" of type initializers throw an exception.
Have encountered the same situation?
Nov 13, 2013 at 6:57 AM
If you want to use GdalRasterLayer of Ogr Provider, you need to add GDAL.Native nuget package to your application.
Nov 15, 2013 at 4:49 AM
Thank you very much.
WinForm, in the application is running, SharpMap allows users to drag the logo picture to Map any position?
The user-defined add logo to the picture.
Nov 17, 2013 at 9:30 AM
You can find all sorts of sample code in the repository. mainly in the WinFormSamples project and the ExampleCodeSnipplets