[geotk] comparing CRS

sorel johann.sorel at geomatys.fr
Thu Jun 24 04:02:42 EDT 2010


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



More information about the Geotoolkit mailing list