[Gdal-dev] GDAL 1.3.2 SWIG C# Bindings?

Tamas Szekeres szekerest at gmail.com
Wed Oct 25 17:40:11 EDT 2006


Since OGR handles those OSR classes for internal use there's not too
much sense to
to separate them into different assemblies. If you want to use OSR
solely then you may use the gdal_osr_csharp otherwise use the
gdal_ogr_csharp assembly. One should avoid setting up C# specific
typemaps to make getCPtr of some of the classes public.

The changes mentioned at the bug (along with many other changes) are
already in the CVS head. Feel free to checkout and see how it works
for you.

Best Regards,

Tamas Szekeres



2006/10/25, Marc Lepage <mlepage at pyxisinnovation.com>:
> Yes it does seem to be the same issue reported in that bug. The fix
> noted there is to effectively bundle all of OSR in with OGR. I was
> hoping to learn of a more elegant solution to the namespace issue. :-)
>
> With regards to the getCPtr issue, that can be solved by providing a
> SWIG typemap for csbody to change its access protection from internal to
> public, as noted earlier today on the swig-users mailing list. But this
> isn't necessary when it's all in the same assembly.
>
>
> -----Original Message-----
> From: Tamas Szekeres [mailto:szekerest at gmail.com]
> Sent: Wednesday, October 25, 2006 4:16 PM
> To: Marc Lepage
> Cc: gdal-dev at lists.maptools.org
> Subject: Re: [Gdal-dev] GDAL 1.3.2 SWIG C# Bindings?
>
> Hi,
>
> I would encourage you to use the latest CVS version. There were some
> fundamental
> changes since 1.3.2 to make the things work.
>
> You might run into the same issue described at:
> http://bugzilla.remotesensing.org/show_bug.cgi?id=949
>
> Some parts of the GDAL C# is still incomplete, I hope we can get them
> work for the next release.
>
>
> Best Regards,
>
>
> Tamas Szekeres
>
>
> 2006/10/25, Marc Lepage <mlepage at pyxisinnovation.com>:
> >
> >
> >
> >
> > Hi all.
> >
> >
> >
> > I've tried to build the gdal-1.3.2 SWIG bindings for csharp, which
> generate,
> > but fail on C# compilation as noted below.
> >
> >
> >
> > Basically, I think SpatialReference is put in the OSR namespace, but
> not
> > scoped (and therefore inaccessible) from the OGR namespace. I don't
> see
> > anything in the SWIG interface files or makefiles that would make this
> work,
> > but admittedly I'm a SWIG newbie. (Actually, I was rather hoping to do
> > something similar with namespaces in another project I am wrapping
> with
> > SWIG, and therefore curious as to how GDAL accomplished this.)
> >
> >
> >
> > Should this work? Or am I doing something wrong? Thanks.
> >
> >
> >
> >
> >
> > csc /debug:full /target:library /out:gdal_ogr_csharp.dll ogr\*.cs
> >
> > Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
> >
> > for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
> >
> > Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
> >
> > ogr\DataSource.cs(78,41): error CS0246: The type or namespace name
> >
> >         'SpatialReference' could not be found (are you missing a using
> > directive
> >
> >         or an assembly reference?)
> >
> > ogr\Geometry.cs(219,26): error CS0246: The type or namespace name
> >
> >         'SpatialReference' could not be found (are you missing a using
> > directive
> >
> >         or an assembly reference?)
> >
> > ogr\Geometry.cs(224,24): error CS0246: The type or namespace name
> >
> >         'CoordinateTransformation' could not be found (are you missing
> a
> > using
> >
> >         directive or an assembly reference?)
> >
> > ogr\Geometry.cs(229,10): error CS0246: The type or namespace name
> >
> >         'SpatialReference' could not be found (are you missing a using
> > directive
> >
> >         or an assembly reference?)
> >
> > ogr\Geometry.cs(235,38): error CS0246: The type or namespace name
> >
> >         'SpatialReference' could not be found (are you missing a using
> > directive
> >
> >         or an assembly reference?)
> >
> > ogr\Layer.cs(147,10): error CS0246: The type or namespace name
> >
> >         'SpatialReference' could not be found (are you missing a using
> > directive
> >
> >         or an assembly reference?)
> >
> > ogr\ogr.cs(15,57): error CS0246: The type or namespace name
> > 'SpatialReference'
> >
> >         could not be found (are you missing a using directive or an
> assembly
> >
> >         reference?)
> >
> > ogr\ogr.cs(21,71): error CS0246: The type or namespace name
> > 'SpatialReference'
> >
> >         could not be found (are you missing a using directive or an
> assembly
> >
> >         reference?)
> >
> > NMAKE : fatal error U1077:
> > 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.EX
> >
> > E' : return code '0x1'
> >
> > Stop.
> >
> > NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> > 8\VC\BIN\n
> >
> > make.EXE"' : return code '0x2'
> >
> > Stop.
> >
> >
> >
> > --
> >
> > Marc Lepage
> >
> > the PYXIS innovation - common ground for digital earth
> >
> > www.pyxisinnovation.com
> >
> >
> > _______________________________________________
> > Gdal-dev mailing list
> > Gdal-dev at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/gdal-dev
> >
> >
>



More information about the Gdal-dev mailing list