GdalRasterLayer

Jan 31, 2007 at 4:49 AM
Hi,

I hope that anybody can help me. I'm trying to do a simple test application. Just load shp files and raster layers (tif or geotif). Shp layers works nice, but raster layers using GDAL not works.

//this is the code
if (openImage.ShowDialog() == DialogResult.OK)
{
foreach (string fname in openImage.FileNames)
{
SharpMap.Layers.GdalRasterLayer gdal = new SharpMap.Layers.GdalRasterLayer("Layer1", fname);
gdal.Enabled = true;
mp.Layers.Add(gdal);
}
mp.ZoomToExtents();
mapImage1.Map = mp;
mapImage1.Refresh();
}

Anybody can help me please?

thanks...
Coordinator
Jan 31, 2007 at 6:20 AM
Hi,

Can you please write a more detailed error description.
GeoTIFF is working well for me.

regards
Christian
Jan 31, 2007 at 1:09 PM
Hallo,

I am trying exactly the same thing and things go wrong in GDAL.gdal.AllRegister() while creating the SharpMap.Layers.GdalRasterLayer object:
"TypeInitializatioException was unhandled:
The type initializer for 'GDAL.gdalPINVOKE' threw an exception."

Thanks.
Coordinator
Jan 31, 2007 at 3:02 PM
Hi,

Have you downloaded the latest dependencies zip file for GDAL?
You get it here .
This should solve your problem.

regards
Christian