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 developed a relatively simple web app that uses the C# OGR bindings to do a couple of simple geometric functions; buffer, clip...etc. I developed this application on my local machine, which has FWTools installed, so getting everything to play nicely wasn't very difficult.

Naturally, when I deployed this application to the server nothing worked, undoubtably due to the all of the missing associated dependencies for the C# bindings. Is there anyway I can include all needed files in the bin folder of this application? Or is that more trouble than its worth, and I should just install FWTools on the server?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

If it is a one-off install, I would just install FWTools and be done with it. There are a number of moving pieces that you'll need to make sure you bring along, including GDAL_DATA files, path settings, and multiple DLL dependencies.

If you need something that is dependably redeployable on multiple servers, it might be worth the effort to build a package from an existing FWTools or OSGeo4W install. Another option might be to use Tamas' GDAL SDKs, which might get you something that is single-directory deployable.

http://vbkto.dyndns.org/sdk/

share|improve this answer
    
Thanks for the tips. –  user890 Oct 26 '10 at 1:40
    
Just in case anyone still comes across this question, note that FWTools is no longer kept up to date in terms of GDAL/OGR version. That said, for a lot of purposes I'm sure the existing FWTools are still of use to a lot of people. –  Kevin R Dyke May 1 at 13:53

I took this a little further and did what Howard Butler suggests. Using the build at "vbkto dot dyndns dot org slash sdk" I was able to successfully run GDAL in .NET without any nasty external dependencies.

It required me to programmatically set up configuration and some environment variables for GDAL.

I have written about it here http://bjarte.com/post/gdal-in-csharp

Edit:

The DotSpatial project on CodePlex has both 32 and 64 bit assemblies for GDAL integration. The code that actually configures GDAL can be found here. It might be the most up-to-date way to GDAL integration in .NET as the project is very active.

share|improve this answer
    
BjartN, this is really interesting. I'm looking to do the same thing for java -- ideally, I'd be able to deploy GDAL in a custom jar file, with all dependencies taken care of. What are your thoughts? Or would it make more sense to just go ahead and install gdal in the machine, then package the bindings themselves? –  Sam Ritchie Jan 18 '11 at 18:26

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.