CRS changes for revisions 20873:20974

Changes in the GeoTools copyright header do not apply to SIS.

The other change is a renaming of transform(…) method to findMathTransform(…), with deprecation of old method. For Apache SIS we plan to provide a findCoordinateOperation(…) method instead, returning CoordinateOperation objects instead of MathTransform.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r20873:20974 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/CRS.java
Revision 20873Revision 20974
/*
 * Geotools 2 - OpenSource mapping toolkit
 * (C) 2005, Geotools Project Managment Committee (PMC)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation; either
 *    version 2.1 of the License, or (at your option) any later version.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package org.geotools.referencing;
/*
 *    GeoTools - OpenSource mapping toolkit
 *    http://geotools.org
 *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.referencing;
* <p>
* Sample use:
* <blockquote><code>
* {@linkplain MathTransform} transform = CRS.transform(
* CRS.{@linkplain #decode decode}("EPSG:42102"),
* CRS.{@linkplain #decode decode}("EPSG:4326") );
* </blockquote></code>
* <p>
* Sample use:
* <blockquote><code>
* {@linkplain MathTransform} transform = CRS.findMathTransform(
* CRS.{@linkplain #decode decode}("EPSG:42102"),
* CRS.{@linkplain #decode decode}("EPSG:4326") );
* </blockquote></code>
 * @throws FactoryException If no math transform can be created for the specified source and
 *         target CRS.
 */
public static MathTransform transform(final CoordinateReferenceSystem sourceCRS,
                                      final CoordinateReferenceSystem targetCRS)
        throws FactoryException
{
    return transform(sourceCRS, targetCRS, false);
}

/**
 * Grab a transform between two Coordinate Reference Systems. This method is similar to
 * <code>{@linkplain #transform(CoordinateReferenceSystem, CoordinateReferenceSystem)
 * @throws FactoryException If no math transform can be created for the specified source and
 *         target CRS.
 */
public static MathTransform findMathTransform(final CoordinateReferenceSystem sourceCRS,
                                      final CoordinateReferenceSystem targetCRS)
        throws FactoryException
{
    return transform(sourceCRS, targetCRS, false);
}
/**
 * Grab a transform between two Coordinate Reference Systems. This method is similar to
 * <code>{@linkplain #transform(CoordinateReferenceSystem, CoordinateReferenceSystem)
 *
 * @see Hints#LENIENT_DATUM_SHIFT
 */
public static MathTransform transform(final CoordinateReferenceSystem sourceCRS,
                                      final CoordinateReferenceSystem targetCRS,
                                      boolean lenient)
        throws FactoryException
 *
 * @see Hints#LENIENT_DATUM_SHIFT
 */
public static MathTransform findMathTransform(final CoordinateReferenceSystem sourceCRS,
                                              final CoordinateReferenceSystem targetCRS,
                                              boolean lenient)
throws FactoryException
{
    final CoordinateOperationFactory factory =
            FactoryFinder.getCoordinateOperationFactory(lenient ? LENIENT : null);
    return factory.createOperation(sourceCRS, targetCRS).getMathTransform();
}
/**
 * Grab a transform between two Coordinate Reference Systems.
 *
 * @param  sourceCRS The source CRS.
 * @param  targetCRS The target CRS.
 * @return The math transform from {@code sourceCRS} to {@code targetCRS}.
 * @throws FactoryException If no math transform can be created for the specified source and
 *         target CRS.
 * @deprecated Please use findMathTransform
 */
public static MathTransform transform(final CoordinateReferenceSystem sourceCRS,
                                      final CoordinateReferenceSystem targetCRS)
        throws FactoryException
{
    return findMathTransform(sourceCRS, targetCRS);
}

/**
 * Grab a transform between two Coordinate Reference Systems.
 * @param  sourceCRS The source CRS.
 * @param  targetCRS The target CRS.
 * @param  lenient {@code true} if the math transform should be created even when there is
 *         no information available for a datum shift. The default value is {@code false}.
 * @return The math transform from {@code sourceCRS} to {@code targetCRS}.
 * @throws FactoryException If no math transform can be created for the specified source and
 *         target CRS.
 * @deprecated use findMathTransform
 */
public static MathTransform transform(final CoordinateReferenceSystem sourceCRS,
                                      final CoordinateReferenceSystem targetCRS,
                                      boolean lenient)
        throws FactoryException