[geotk] comparing CRS

Jon Blower j.d.blower at reading.ac.uk
Thu Jun 24 08:29:48 EDT 2010


Hi,

Or you could find a MathTransform between the two CRSs and check
isIdentity().  I remember a discussion on this list a little while ago
about this but I can't remember whether there were pros and cons for
this method against equalsIgnoreMetadata().

Cheers, Jon

-----Original Message-----
From: geotoolkit-bounces at lists.osgeo.org
[mailto:geotoolkit-bounces at lists.osgeo.org] On Behalf Of sorel
Sent: 24 June 2010 04:03
Cc: geotoolkit at lists.osgeo.org
Subject: Re: [geotk] comparing CRS

Hello,

You can always make use of the equal method on CRS.
But 98% of the time we don't want to check equality on the crs
metadatas.

So what I recommande to use :
        CRS.equalsIgnoreMetadata(crs1, crs2);
This way, two different crs even if they dont have the exact same 
definition will be
consider equal if there "mathematic" part is the same.
That's exactly what we want when we need to know if we must reproject 
something or not.


johann





Philippe Kruschitz wrote:
> Hi list,
>
> I was wondering what was the most reliable way to compare different
CRS.
> I know this might sound like a basic question, but I was asking myself
> if there was a "correct" way to do it (other than comparing EPSG
codes)
> and to know if two CoordinateReferenceSystem objects are the same
(i.e.
> have the same parameters).
>
> Regards,
>
> Philippe
>
>   

_______________________________________________
Geotoolkit mailing list
Geotoolkit at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geotoolkit


More information about the Geotoolkit mailing list