From: Martin D. <mar...@ge...> - 2008-05-27 18:54:55
|
Farrukh Najmi a écrit : > I have the following code: > > String srsName = "urn:ogc:def:crs:EPSG:6.0:4277"; > CoordinateReferenceSystem crs = CRS.decode(srsName); > String srsName1 = crs.getName().toString(); > > What I was expecting is that srsName1 would be the same as srsName that > was used to create the CoordinateReferenceSystem. What I am observing is > that srsName1 is "EPSG:OSGB 1936". In the EPSG database, CRS name are often human-readable like "NTF (Paris) / Lambert zone II". What you are looking for is rather stored as the CRS identifier. See CoordinateReferenceSystem.getIdentifiers(). In the particular case of GeoTools implementation, you can use the following convenience method (the same CRS can have different identifier for different authorities, e.g. a different identifier for the EPSG database than ESRI). crs.getIdentifier(Citations.EPSG).getCode(); Martin |