MapProjection changes for revisions 12237:12238

Most changes in this commit seem to be the result of some "auto reformat" tool execution. The Java - GeoAPI - GeoTools import ordering is altered, imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken. This change has been reverted, except for the removal of really unused imports which are kept removed.

This commit contains also a catch (Throwable t) statement which will not be ported to Apache SIS.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r12237:12238 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/MapProjection.java
Revision 12237Revision 12238
/*
 * Geotools 2 - OpenSource mapping toolkit
 * (C) 2003, Geotools Project Managment Committee (PMC)
 * (C) 2001, Institut de Recherche pour le Développement
 * (C) 1999, Fisheries and Oceans Canada
 *
 *    This library is free software; you can redistribute it and/or
/*
 * Geotools 2 - OpenSource mapping toolkit
 * (C) 2003, Geotools Project Managment Committee (PMC)
 * (C) 2001, Institut de Recherche pour le D�veloppement
 * (C) 1999, Fisheries and Oceans Canada
 *
 *    This library is free software; you can redistribute it and/or
* WKT (Well Know Text) or XML (not yet implemented) are more appropriate.
*
* @version $Id$
* @author André Gosselin
* @author Martin Desruisseaux
* @author Rueben Schulz
*
* WKT (Well Know Text) or XML (not yet implemented) are more appropriate.
*
* @version $Id$
* @author Andr� Gosselin
* @author Martin Desruisseaux
* @author Rueben Schulz
*
protected final double excentricity;

/**
 * The square of excentricity: e² = (a²-b²)/a² where
 * <var>e</var> is the {@linkplain #excentricity excentricity},
 * <var>a</var> is the {@linkplain #semiMajor semi major} axis length and
 * <var>b</var> is the {@linkplain #semiMinor semi minor} axis length.
protected final double excentricity;

/**
 * The square of excentricity: e� = (a�-b�)/a� where
 * <var>e</var> is the {@linkplain #excentricity excentricity},
 * <var>a</var> is the {@linkplain #semiMajor semi major} axis length and
 * <var>b</var> is the {@linkplain #semiMinor semi minor} axis length.
*         <ul>
*           <li>"semi_major" (mandatory: no default)</li>
*           <li>"semi_minor" (mandatory: no default)</li>
*           <li>"central_meridian"   (default to 0°)</li>
*           <li>"latitude_of_origin" (default to 0°)</li>
*           <li>"scale_factor"       (default to 1 )</li>
*           <li>"false_easting"      (default to 0 )</li>
*           <li>"false_northing"     (default to 0 )</li>
*         <ul>
*           <li>"semi_major" (mandatory: no default)</li>
*           <li>"semi_minor" (mandatory: no default)</li>
*           <li>"central_meridian"   (default to 0�)</li>
*           <li>"latitude_of_origin" (default to 0�)</li>
*           <li>"scale_factor"       (default to 1 )</li>
*           <li>"false_easting"      (default to 0 )</li>
*           <li>"false_northing"     (default to 0 )</li>
/*
 * Makes sure that the longitude before conversion stay within +/- PI radians. As a
 * special case, we do not check the range if no rotation were applied on the longitude.
 * This is because the user may have a big area ranging from -180° to +180°. With the
 * slight rounding errors related to map projections, the 180° longitude may be slightly
 * over the limit. Rolling the longitude would changes its sign. For example a bounding
 * box from 30° to +180° would become 30° to -180°, which is probably not what the user
 * wanted.
 */
ptDst = transformNormalized(centralMeridian!=0 ?
/*
 * Makes sure that the longitude before conversion stay within +/- PI radians. As a
 * special case, we do not check the range if no rotation were applied on the longitude.
 * This is because the user may have a big area ranging from -180� to +180�. With the
 * slight rounding errors related to map projections, the 180� longitude may be slightly
 * over the limit. Rolling the longitude would changes its sign. For example a bounding
 * box from 30� to +180� would become 30� to -180�, which is probably not what the user
 * wanted.
 */
ptDst = transformNormalized(centralMeridian!=0 ?
    throws ProjectionException
{
    /*
     * Vérifie s'il faudra parcourir le tableau en sens inverse.
     * Ce sera le cas si les tableaux source et destination se
     * chevauchent et que la destination est après la source.
     */
    final boolean reverse = (src==dest && srcOffset<dstOffset &&
                             srcOffset+(2*numPts) > dstOffset);
    throws ProjectionException
{
    /*
     * V�rifie s'il faudra parcourir le tableau en sens inverse.
     * Ce sera le cas si les tableaux source et destination se
     * chevauchent et que la destination est apr�s la source.
     */
    final boolean reverse = (src==dest && srcOffset<dstOffset &&
                             srcOffset+(2*numPts) > dstOffset);
/*
 * Makes sure that the longitude after conversion stay within +/- PI radians. As a
 * special case, we do not check the range if no rotation were applied on the longitude.
 * This is because the user may have a big area ranging from -180° to +180°. With the
 * slight rounding errors related to map projections, the 180° longitude may be slightly
 * over the limit. Rolling the longitude would changes its sign. For example a bounding
 * box from 30° to +180° would become 30° to -180°, which is probably not what the user
 * wanted.
 */
final double x = Math.toDegrees(centralMeridian!=0 ?
/*
 * Makes sure that the longitude after conversion stay within +/- PI radians. As a
 * special case, we do not check the range if no rotation were applied on the longitude.
 * This is because the user may have a big area ranging from -180� to +180�. With the
 * slight rounding errors related to map projections, the 180� longitude may be slightly
 * over the limit. Rolling the longitude would changes its sign. For example a bounding
 * box from 30� to +180� would become 30� to -180�, which is probably not what the user
 * wanted.
 */
final double x = Math.toDegrees(centralMeridian!=0 ?
        throws TransformException
{
    /*
     * Vérifie s'il faudra parcourir le tableau en sens inverse.
     * Ce sera le cas si les tableaux source et destination se
     * chevauchent et que la destination est après la source.
     */
    final boolean reverse = (src==dest && srcOffset<dstOffset &&
                             srcOffset+(2*numPts) > dstOffset);
        throws TransformException
{
    /*
     * V�rifie s'il faudra parcourir le tableau en sens inverse.
     * Ce sera le cas si les tableaux source et destination se
     * chevauchent et que la destination est apr�s la source.
     */
    final boolean reverse = (src==dest && srcOffset<dstOffset &&
                             srcOffset+(2*numPts) > dstOffset);
}

/**
 * Compute function <code>f(s,c,e²) = c/sqrt(1 - s²&times;e²)</code> needed for the true scale
 * latitude (Snyder 14-15), where <var>s</var> and <var>c</var> are the sine and cosine of
 * the true scale latitude, and <var>e²</var> is the {@linkplain #excentricitySquared
 * eccentricity squared}.
 */
final double msfn(final double s, final double c) {
}

/**
 * Compute function <code>f(s,c,e�) = c/sqrt(1 - s�&times;e�)</code> needed for the true scale
 * latitude (Snyder 14-15), where <var>s</var> and <var>c</var> are the sine and cosine of
 * the true scale latitude, and <var>e�</var> is the {@linkplain #excentricitySquared
 * eccentricity squared}.
 */
final double msfn(final double s, final double c) {
/**
 * The operation parameter descriptor for the {@link #centralMeridian centralMeridian}
 * parameter value. Valid values range is from -180 to 180°. Default value is 0.
 */
public static final ParameterDescriptor CENTRAL_MERIDIAN = createDescriptor(
        new Identifier[] {
/**
 * The operation parameter descriptor for the {@link #centralMeridian centralMeridian}
 * parameter value. Valid values range is from -180 to 180�. Default value is 0.
 */
public static final ParameterDescriptor CENTRAL_MERIDIAN = createDescriptor(
        new Identifier[] {
/**
 * The operation parameter descriptor for the {@link #latitudeOfOrigin latitudeOfOrigin}
 * parameter value. Valid values range is from -90 to 90°. Default value is 0.
 */
public static final ParameterDescriptor LATITUDE_OF_ORIGIN = createDescriptor(
        new Identifier[] {
/**
 * The operation parameter descriptor for the {@link #latitudeOfOrigin latitudeOfOrigin}
 * parameter value. Valid values range is from -90 to 90�. Default value is 0.
 */
public static final ParameterDescriptor LATITUDE_OF_ORIGIN = createDescriptor(
        new Identifier[] {
 * Returns <code>true</code> is the parameters use a spherical datum.
 */
static boolean isSpherical(final ParameterValueGroup values) {
    return doubleValue(SEMI_MAJOR, values) ==
           doubleValue(SEMI_MINOR, values);
}

/**
 * Returns the parameter value for the specified operation parameter.
 * Returns <code>true</code> is the parameters use a spherical datum.
 */
static boolean isSpherical(final ParameterValueGroup values) {
    try {
    return doubleValue(SEMI_MAJOR, values) ==
           doubleValue(SEMI_MINOR, values);
}
    catch( Throwable t){
       // probably could not find the requested values -- gobble error and and be forgiving
       return false;
    }
}

/**
 * Returns the parameter value for the specified operation parameter.