[Gdal-dev] Re: C# Geometry Classes?

Howard Butler hobu at iastate.edu
Wed Mar 21 18:54:28 EDT 2007

At 05:37 PM 3/21/2007, Simon Perkins wrote:
>Is there a reason why we wrap the C interface rather than the C++ 
>interface? The C++ interface seems closer to the C# model. Does SWIG 
>not support that?

We wrap the C interface because it has been blessed as the 'stable' 
one (almost to a fault sometimes, IMO).  SWIG happily supports C++ 
(except for certain template'y stuff, which we don't have much worry 
with in GDAL), so that isn't the problem. The GDAL/OGR C++ API can be 
changed at any time, and these changes would have automatically been 
reflected in the language bindings.  GDAL's C++ hasn't historically 
worked under the constraint of changes being reflected, and some 
implementation freedom needs to be available somewhere.  This 
tradeoff complicates the interfaces, but it also insulates 
them.  Kevin and I's first cut actually wrapped the C++ API, but we 
were persuaded otherwise ;)

>P.S. Still trying to work out how to read a polygon geometry via the 
>C API. Does it appear as a collection of LinearRings? Is the outer 
>ring specified in some way?

Searching for existing Python OGR code out there should provide 
instructive examples.  It is my understanding (and expectation) that 
the language bindings present things a similarly as possible.  My 
opinion is that the various bindings can add their own spices, but 
that the basic dish starts out the same.

/me runs home to go eat.


More information about the Gdal-dev mailing list