[GIS] Open-source projects that use DotSpatial

dotspatialgdalopen-source-gisreferences

I'm intrigued by what I see with DotSpatial, mainly for its C# interface with GDAL. I've downloaded the source (and the 3.5 x86 package) and I'm a bit stuck with using the GDALHelper class to initialize the GDAL library.

(I think it should be just a call to GDALHelper.Configure() but I'm hitting errors when I do that.)

I figure that's probably going to be the first of many questions with the DotSpatial, and was wondering if there are any good open-source projects (applications) that use it so that I could see how it's set up in practice.

Best Answer

Not sure there are many projects out there that use it other than MapWindow - who are also the creators of DotSpatial.

If you look at the source for the GDALHelper class, you can see exactly why errors are thrown:

var driverPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

if (driverPath == null) throw new GdalException("Cannot get the executing assemblies location");

Gdal.SetConfigOption("GDAL_DRIVER_PATH", Path.Combine(driverPath, "gdalplugins"));

Gdal.SetConfigOption("GDAL_DATA", Path.Combine(driverPath, "gdal-data"));

var systemPath = Environment.GetEnvironmentVariable("PATH");

if (systemPath == null) throw new GdalException("Cannot get the environment path variable");

Are any of these the errors you encounter? It looks like it needs all the GDAL DLLs in subfolders of the DotSpatial project, and also needs to access the PATH Windows environment variable.

If you already have another version of GDAL that could cause problems.