[geotk] RE: Coordinate reference systems: identifiers and equality

Jonathan Blower j.d.blower at reading.ac.uk
Wed Apr 21 10:40:46 EDT 2010

I think I can answer one of my questions.  I guess I can find out
whether a CRS is logically equal to another one with:

CRS.findMathTransform(crs1, crs2).isIdentity()

Unless there are some hidden pitfalls?  (By the way, does CRS cache the
MathTransform objects or will a new one be created every time for the
same parameters)?


-----Original Message-----
From: Jonathan Blower 
Sent: 21 April 2010 15:26
To: geotoolkit at lists.osgeo.org
Subject: Coordinate reference systems: identifiers and equality


I have a couple of questions about coordinate reference systems.  I
would like to implement a method that detects whether a given coordinate
system represents a WGS84 longitude-latitude system:

public static boolean isWgs84LonLat(CoordinateReferenceSystem crs);

Is there such a method available in Geotk?  I notice that the three
coordinate systems:
   CRS.decode("EPSG:4326", true)
   CRS.decode("CRS:84", true)
are not considered equal() to each other, even though I thought they all
represent the same logical CRS (note that I am forcing longitude-first
axis order).  The WKT is slightly different in each case, but not
"functionally" so as far as I understand.  Is there a reason they are
considered different?

Secondly, I'd like a reliable method to perform the inverse of
CRS.decode(), i.e. take a CRS and return its code.  I notice that Geotk
has a CRS.getDeclaredIdentifier() method, which is cheaper than
CRS.lookupIdentifier().  Is getDeclaredIdentifier() guaranteed to return
the correct code for a CRS for all CRSs that are returned by
CRS.decode()?  I.e. does every CRS returned by CRS.decode() declare an


Dr Jon Blower
Technical Director, Reading e-Science Centre
Environmental Systems Science Centre
University of Reading
Harry Pitt Building, 3 Earley Gate
Reading RG6 6AL. UK
Tel: +44 (0)118 378 5213
Fax: +44 (0)118 378 6413
j.d.blower at reading.ac.uk

More information about the Geotoolkit mailing list