wiki:GdalOgrInCsharp

Version 4 (modified by tamas, 17 years ago) ( diff )

--

GDAL/OGR In CSharp

The GDAL project maintains SWIG generated CSharp bindings for GDAL and OGR. Generally speaking the classes and methods mostly match those of the GDAL and OGR C++ classes, but there is currently no CSharp specific documentation beyond this wiki topic. The CSharp bindings are also usable from other .NET languages, such as VB .Net.

The CSharp interface has been build upon a common ground as the other SWIG generated wrappes (like Perl, Python, Java, PHP and Ruby). In this regard the class names and class member names along with the method signatures are fairly predestinated and might not follow the conventional .NET naming guidelines. However, one can easily identify the counterpars of the members in the GDAL/OGR API documentation.

The GDAL/OGR CSharp classes use the .NET P/Invoke mechanism for the communication between the managed and unmanaged code. Every class implements the IDisposable interface to control the finalization of the underlying unmanaged memory referenced by every the wrapper class.

Supported platforms

Currently the interface is compilable and supports the various Win32 and Win64 platforms targeting the Microsoft.NET and the MONO framework. The interface is also compilable under the GNU Linux/OSX systems for the MONO framework. The compilation steps for the various platforms have been added to the GDAL buildbot and tested regularly.

CSharp interface versions

The GDAL/OGR CSharp interface is fairly new and the first official version was published first along with the GDAL 1.4.0 release. As of the 1.4.0 release there was a substantial evolution in the interface based on the various user requests. Some of these changes in the current version (1.5.0) were backward incompatible with 1.4.0 and currently the transition to the current development version is suggested for the interface users and 1.4.0 is considered as deprecated.

The main differences between 1.4.0 and 1.5.0, migration steps for the existing code

TODO

GDAL/OGR CSharp interface compilation

TODO

Using the GDAL/OGR CSharp interface

TODO

Useful Links

FWTools

One way to get the CSharp bindings is to use FWTools 1.2.0+ for windows. To use these it should be sufficient to add the assembles in FWTools\csharp to your project, and to ensure that FWTools\bin is in your path. See http://fwtools.maptools.org

Note: See TracWiki for help on using the wiki.