[gdal-dev] SRS_UL_US_FOOT etc in C#?

Tamas Szekeres szekerest at gmail.com
Wed Dec 12 16:01:59 EST 2007


Mark,

This is due to how SWIG handles the %constant declaration for the
char* constants. I consider this as a bug and I'll submit a csharp
specific fix for it. I guess however this problem applies to the java
side as well.

Moreover in the future we should alter how to expose the constants
that would be suitable for all of the languages equally well. I'll
post a development note about that here as soon as possible for
further consideration of the other SWIG language maintainers.

Best regards,

Tamas



2007/12/11, Mark Cheyne <cheynm at yahoo.com>:
> Hello - I am using SpatialReference.SetLinearUnits()
> (http://www.gdal.org/ogr/classOGRSpatialReference.html#2016fee7b234666c5e94d528661e6729)
> which takes a string identifying the unit, and a
> double defining its conversion factor to meters.
>
> in the C# wrap, I see the static readonly strings like
>
> OSGeo.OSR.Osr.SRS_UL_US_FOOT and
> OSGeo.OSR.Osr.SRS_UL_US_FOOT_CONV which would seem to
> be the sort of thing I want as the arguments to
> SetLinearUnits().
>
> But interestingly, the values of these constants is
> their NAME, not their VALUE as listed in the #DEFINEs
> in ogr_srs_api.h
> (http://www.gdal.org/ogr/ogr__srs__api_8h-source.html)
>
> For example, I'd expect
>
> OSGeo.OSR.Osr.SRS_UL_US_FOOT = "U.S. Foot"
> but it is
> OSGeo.OSR.Osr.SRS_UL_US_FOOT = "SRS_UL_US_FOOT"
>
> huh?
>
> thanks, Mark
>
> Mark Cheyne
> (608) 332-2235 (cell)
>
>
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


More information about the gdal-dev mailing list