Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 (appolications) that use it so that I could see how it's set up in practice.

First question here. Thanks!

share|improve this question
    
can you post the errors. –  Nathan W Apr 7 '11 at 22:49
    
@Nathan W: I'm very sorry. The errors weren't with AllRegister(). That changes my question a bit, I guess. –  John Apr 8 '11 at 17:48

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Thanks for this answer. I'll check it tomorrow at work. –  John Apr 8 '11 at 7:29
    
I added a comment above. I made a mistake as to where the errors were from. But you answer is helpful in that it leads me to MapWindow. Thanks! –  John Apr 8 '11 at 17:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.