[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 
> 
> "COORD_REF_SYS_CODE","COORD_REF_SYS_NAME","UOM_CODE","SOURCE_GEOGCRS_CODE","COORD_OP_CODE","COORD_OP_METHOD_CODE","SHOW_CRS","DEPRECATED","PARAMETER_CODE_1","PARAMETER_VALUE_1","PARAMETER_UOM_1","PARAMETER_CODE_2","PARAMETER_VALUE_2","PARAMETER_UOM_2","PARAMETER_CODE_3","PARAMETER_VALUE_3","PARAMETER_UOM_3","PARAMETER_CODE_4","PARAMETER_VALUE_4","PARAMETER_UOM_4","PARAMETER_CODE_5","PARAMETER_VALUE_5","PARAMETER_UOM_5","PARAMETER_CODE_6","PARAMETER_VALUE_6","PARAMETER_UOM_6","PARAMETER_CODE_7","PARAMETER_VALUE_7","PARAMETER_UOM_7"
> 
> 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?  

Mikael,

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
COORD_OP_CODE.

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