[Gdal-dev] SetLocalCS() binding?

Frank Warmerdam warmerdam at pobox.com
Tue Mar 27 22:06:54 EDT 2007

Richard Matsunaga wrote:
> Coincidentally, I had the same question myself today. In my case, it came up
> because I am taking the spatial reference from a GDAL datasource and setting
> it in an OGR datasource.
> To do so is a little funky - get a wkt string from GetProjectionRef() from
> the GDAL Dataset, then create a OSGeo.OGR.SpatialReference from the wkt
> string. I guess this has always been the case with GDAL and OGR?


Yes, this has always been different.  Originally GDAL returned PROJ.4 strings
from GetProjectionRef(), but then fairly early on I changed to using WKT.
But with the API already set to return strings I just left it that way.

OGR came on the scene a bit later, and used OGRSpatialReference from the start.

> Also, why is there a GetProjection() and GetProjectionRef() on the Dataset
> class, both returning strings? There seems to be only one such method in the
> C API (GDALGetProjectionRef).

I'd guess that originally GetProjectionRef() was wrapped directly, and
then later GetProjection() was introduced because the Ref concept doesn't
apply to most languages with built in string types.

I *think* that GetProjectionRef() ought to be considered deprecated.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list