[Gdal-dev] SetLocalCS() binding?

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

Simon Perkins wrote:
> Can someone clarify for me the purpose of the "local" coordinate system 
> which appears in the OGR API docs? I'm guessing this is for user-defined 
> special purpose projections?
> In dealing with layers that don't have any georeferencing, I'm looking 
> for a convenient place to put a tag saying whether the coordinates in 
> the layer have the y-axis running up vs. down the screen. One 
> possibility I'm considering is to define a local coordinate system for 
> these layers and store the tag there.
> Using the C# bindings, I thought I could just do something like:
> OGR.SpatialReference ref = new OGR.SpatialReference("LOCALCS[\"MAP\"]")


Your core problem is that you are using the keyword LOCALCS instead of
the required LOCAL_CS.

> and then call things like
> ref.IsLocalCS()

BTW, I think the call is ref.IsLocal()

> However, that doesn't seem to work - the latter still returns false (or 
> rather 0 - but shouldn't we have bools here?).
> I then turned to the SetLocalCS() method, but the bindings for that 
> don't seem to exist. Is adding them just a question of adding the 
> appropriate line to the SWIG ogr.i file, using the SetProjCS() entry as 
> a template? 

Yes.  In fact I have added this myself in trunk this evening.

 > How do I then retrieve the name of the local coordinate
> system? Using GetAttrValue("LOCALCS")?

Yes, but using "LOCAL_CS".

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