How to get the EpsgCode of a ProjectionInfo instance?

Developer
Oct 3, 2011 at 8:51 AM
Edited Oct 3, 2011 at 8:56 AM

I init the ProjectionInfo with OGC project string , but the EpsgCode of the ProjectionInfo is always 0.

I have to parse the string to get the EPSGCode.

 

Thank you for any advice...
Developer
Oct 3, 2011 at 5:00 PM

It looks like this is only used by SpatialLite presently. We'll need to add more support for this to ProjectionInfo.

Developer
Oct 3, 2011 at 8:06 PM

Presently this is a one-way look up. Provide an EPSG code and we return a ProjectionInfo, but we don't provide an EPSG code based on a projection string.

Developer
Oct 3, 2011 at 8:14 PM

How are you looking up or parsing the EPSGCode? Is it part of the  OGC projection string?

Developer
Oct 4, 2011 at 2:41 AM
OGC WKT

20790

PROJCS["Lisbon (Lisbon)/Portuguese National Grid",GEOGCS["Lisbon (Lisbon)",DATUM["Lisbon_1937_Lisbon",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],AUTHORITY["EPSG","6803"]],PRIMEM["Lisbon",-9.131906111111112,AUTHORITY["EPSG","8902"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4803"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",39.66666666666666],PARAMETER["central_meridian",1],PARAMETER["scale_factor",1],PARAMETER["false_easting",200000],PARAMETER["false_northing",300000],AUTHORITY["EPSG","20790"],AXIS["X",EAST],AXIS["Y",NORTH]]

3238
PROJCS["WGS 84 / SCAR IMW SR53-54",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",-68.66666666666667],PARAMETER["standard_parallel_2",-71.33333333333333],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",138],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3238"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]

4326

GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]

I try to find the number string after the last "AUTHORITY["EPSG",", and I don't think it works for all the projection .