Display GeoTIF or ECW Image

Topics: General Topics
Jan 19, 2007 at 3:58 AM

I am loving SharpMap, but am struggling with how to get an ECW or GeoTIF image to display along with my vector data (from a shapefile or MSSQL database). Can anyone post some sample code to show how this is possible?

I have followed the instructions for compiling SharpMap and Extensions (http://sharptools.de/Blog/tabid/203/Default.aspx), but don't get how my image displaying. I think I have to do something with the GDAL provider, but am lost on how to progress. Any help would be appreciated.

Jan 19, 2007 at 6:01 AM

The OGR Provider posted at sharptools.de is only for vetcor data. I will release a renewed
GDAL Provider this weekend for raster image usage (GeoTIFF, ECW, JP2).

Please stay tuned.

best regards
Christian - Mainz/Germany
Jan 20, 2007 at 12:26 AM
Brilliant. It's great to see this mapping tool evolving and improving. I'm fairly new to it, but am finding it fairly user-friendly and capable of doing almost everything I need. Keep up the good work.

Jan 23, 2007 at 11:17 PM
Hey Christian,

I've downloaded and compiled the latest check-in (#19369) which includes the GDALRasterLayer. I'm trying to get it running, but am having problems. I've compiled it exactly as described on your blog:


I've then referenced the compiled files in my aspx page and copied all the 'unmanaged' dependencies (*_wrap.dll) and the gdal14.dll files to my websites Bin directory. When I run the page (which adds a TIF file onto a GDALRasterLayer and then adds it to the map), I get the following:

DllNotFoundException: Unable to load DLL 'gdal_gdal_wrap'...
TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
TypeInitializationException: The type initializer for 'GDAL.gdalPINVOKE' threw an exception.

It seems that gdalgdalwrap.dll can't be found, but the file is in my websites bin directory. Is there anything different that needs to be done with getting this latest version running?

The only thing I had to do different when compiling it was allow 'unsafe' code. Could this have caused things to break?

Steve - Melbourne/Australia
Jan 24, 2007 at 7:09 AM
Hi Steve,

I'm sorry, I missed to include a dll, which is needed to run the GDAL raster layer properly.
I will update the Dependencies zip file this evening.

As i compile the GDAL dependencies my self at the moment, it could be possible that this errors sometimes arise.
I hope that the GDAL guys will provide full featured windows binaries soon with c# bingings included.

This isn't so at the moment.