[Gdal-dev] SetLocalCS() binding?

Simon Perkins sy at perkins.net
Tue Mar 27 15:43:34 EDT 2007

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\"]") 

and then call things like


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? How do I then retrieve the name of the local coordinate 
system? Using GetAttrValue("LOCALCS")?

While I'm here, what's the difference between OGR.SpatialReference and 
OSR.SpatialReference? Why are there two such similar namespaces?



More information about the Gdal-dev mailing list