[FWTools] How do I get the COORD_OP_CODE from an OGRSpatialReference?

Frank Warmerdam warmerdam at pobox.com
Thu Jun 26 12:36:09 EDT 2008

Mikael Rittri wrote:
> Hello,
> I am trying to extract the COORD_OP_CODE from an OGRSpatialReference object, 
> but I don't know how.  Maybe it is not possible?  
> The COORD_OP_CODE is a unique code for each instance of a map projection. 
> To take an arbitrary example, "Estonian Coordinate System of 1992", the information in $GDAL_DATA/pcs.csv is 
> 3300,Estonian Coordinate System of 1992,9001,4133,19938,9802,1,0,8821,57.310319415,9110,8822,24,9110,8823,59.2,9110,8824,58,9110,8826,500000,9001,8827,6375000,9001,,,
> Reading the first few entries, we have 
> 3300:  unique code for the coord. ref. system;
> "Estonian Coordinate System of 1992": the name of the coord. ref. system;
> 9001:  unique code for unit of measure, meters in this case;
> 4133:  unique code for the corresponding geographic (long/lat) coord. ref. system;
> 19938: unique code for the particular instance of Lambert_Conformal_Conic_2SP;
> 9802:  unique code for the projection class, namely the class of Lambert_Conformal_Conic_2SP projections,
> etc. 
> So, the information I want to extract from my OGRSpatialReference is the code 19938,
> but I cannot find it there - by calling ogrRefSys.GetAuthorityCode("PROJCS|PROJECTION") -
> although the number exists in the pcs.csv.  
> When I look at http://www.spatialreference.org/ref/epsg/3300/prettywkt/, 
> I found that the code 19938 is missing there, too.  
> So, is it true that such codes are not part of WKT, and therefore not part of a OGRSpatialReference?
> Or else, what am I doing wrong?  


You are correct.  There is no way of expressing the COORD_OP_CODE in WKT.
It is a level of abstraction/normalization that does not have an analog
in WKT.  You can get the PCS code (ie. COORD_REF_SYS_CODE), but not the

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 FWTools mailing list