[geos-devel] C# Bindings?

Charlie Savage cfis at savagexi.com
Tue Sep 11 17:36:19 EDT 2007

Simon Perkins wrote:
> Hi,
> Are there any C# bindings for GEOS out there?

Not that I know of - at least not as part of GEOS.

> We've been using the OGR interface to GEOS (which are exposed by the OGR 
> C# bindings), but are running into some strange topology exceptions 
> (side location conflicts and non-nodal intersections) and I'd like to 
> use the GEOS isValid() method which is not exposed by OGR, AFAIK. Might 
> using the GEOS library directly be more efficient than going through OGR 
> as well?

Hmm, probably not a big difference.

> Anyway, I could go off and roll PInvoke stubs for the GEOS functions I 
> need in not much time, but I figured I'd see what other people have 
> already before I do that. Any interest in adding such bindings to geos? 
> I could also take a look at SWIG, but it always scares me for some 
> reason...

More recent versions of SWIG have a standard typemaps that apply for the 
scripting languages - so Perl, Ruby, Python.  Thus it would be very easy 
to reuse the current bindings for one of those language.

However, SWIG's static languages (C#, Java, etc.) use a different 
system.  So you would have to take the current geos.i file and 
significantly change it to work with C#.  The OGR C# bindings could 
probably provide some guidance.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20070911/9f1fd0fc/smime.bin

More information about the geos-devel mailing list