This project is read-only.

GDAL in Dotspatial

Apr 21, 2015 at 8:09 PM
I've been trying all evening to use GDAL in DotSpatial. The link to the tutorial is out of date and none of the discussions have been able to resolve my problems.

Could someone please provide a step by step guide to including GDAL in Dotspatial 1.7
Apr 22, 2015 at 7:35 AM
Normally you just have to put the DotSpatial.Data.Rasters.GdalExtension folder from the WindowsExtension folder of the DotSpatial 1.7 Full download into your WindowsExtension folder.

If you call Map.AddLayers afterwards you can see which filetypes you can import with the help of GDAL.
Apr 22, 2015 at 1:07 PM

I have got /bin/Debug/Windows Extensions/DotSpatial.Data.Rasters.GdalExtension, but it isn't working.

Is this correct?
Apr 22, 2015 at 1:43 PM
If the exe of your program is in /bin/Debug/ then that should be correct. How do you know that it's not working? Any error messages?
Apr 22, 2015 at 7:39 PM
Here is a link to a tutorial on how to add GDAL capabilities to something other than Demo Map.

In it, it discusses how to set up GDAL and also how to work around some issues. First off, the default directories shown in the AppManager control are "Application Extensions" and "Plugins" instead of "Windows Extensions" like what is used in DemoMap. This is confusing. Secondly, you must call LoadExtensions() on the AppManager in order to get the GDAL extension to load. Finally, when you do this, if you do not have a SpatialDockManager, SpatialStatusStrip and SpatialHeaderControl defined on the AppManager, then the "LoadExtensions" method will throw exceptions when attempting to load. I think this is actually a poor design. My initial intent was that you could mix and match the components how ever you want, but if the developer doesn't have, say a SpatialDockManager, then it plug-ins should be graceful enough to understand that those might not be present. We could accomplish this without throwing null exceptions all over the place with some IDockManager implementations that are used by default internally if, for instance, an application doesn't have a DockManager of any kind.

Marked as answer by mbayles on 6/5/2015 at 1:00 PM
Jun 5, 2015 at 9:00 PM
The Developer Getting Started Guide and the Tutorial section( both found in the the Documentation tab) have a step by step guide to using GDAL with DotSpatial 1.7.
Marked as answer by mbayles on 6/5/2015 at 1:00 PM