[geotk] RE: Coordinate reference systems: identifiers and equality
Martin Desruisseaux
martin.desruisseaux at geomatys.fr
Wed Apr 21 11:29:29 EDT 2010
Le 21/04/10 16:40, Jonathan Blower a écrit :
> 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?
No pitfals, it should work. It can even be slightly more accurate than
CRS.equalsIgnoreMetadata(...), while more costly if the MathTransform is not in
the cache.
I would said that 90% of cases, CRS.equalsIgnoreMetadata(...) is suffisient.
> (By the way, does CRS cache the
> MathTransform objects or will a new one be created every time for the
> same parameters)?
The MathTransforms are cached for any pair of CRS. The 'n' most recently
requested transform are cached by strong references (I don't remember the value
of 'n'; probably something like 10), and all other MathTransforms (if any) are
cached by WeakReferences.
Martin
More information about the Geotoolkit
mailing list