MapProjection changes for revisions 7706:7845

Changes in this commit are consequence of a GeoAPI changes. For the changes related GeoAPI interfaces, reverting this commit causes compilation errors which are fixed by redoing the same changes. For the part about GeoTools class names, those changes are not relevant since Apache SIS uses different class names.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r7706:7845 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/MapProjection.java
Revision 7706Revision 7845
import javax.units.NonSI;

// OpenGIS dependencies
import org.opengis.metadata.Identifier;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransform2D;
import org.opengis.referencing.operation.OperationMethod;
import org.opengis.referencing.operation.TransformException;
import org.opengis.parameter.InvalidParameterValueException;
import org.opengis.parameter.InvalidParameterNameException;
import org.opengis.parameter.ParameterNotFoundException;
import org.opengis.parameter.OperationParameterGroup;
import org.opengis.parameter.OperationParameter;
import org.opengis.parameter.ParameterValueGroup;

// Geotools dependencies
import org.geotools.measure.Latitude;
import org.geotools.measure.Longitude;
import org.geotools.metadata.citation.Citation;
import org.geotools.referencing.wkt.Formatter;
import org.geotools.referencing.wkt.UnformattableObjectException;
import org.geotools.referencing.operation.MathTransformProvider;
import org.geotools.referencing.operation.transform.AbstractMathTransform;
import org.geotools.resources.cts.Resources;
import javax.units.NonSI;

// OpenGIS dependencies
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransform2D;
import org.opengis.referencing.operation.TransformException;
import org.opengis.parameter.InvalidParameterValueException;
import org.opengis.parameter.InvalidParameterNameException;
import org.opengis.parameter.ParameterNotFoundException;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterValueGroup;

// Geotools dependencies
import org.geotools.measure.Latitude;
import org.geotools.measure.Longitude;
import org.geotools.referencing.operation.MathTransformProvider;
import org.geotools.referencing.operation.transform.AbstractMathTransform;
import org.geotools.resources.cts.Resources;
 * @throws ParameterNotFoundException if a mandatory parameter is missing.
 */
protected MapProjection(final ParameterValueGroup values) throws ParameterNotFoundException {
    semiMajor           = values.getValue("semi_major")        .doubleValue(SI.METER);
    semiMinor           = values.getValue("semi_minor")        .doubleValue(SI.METER);
    centralMeridian     = values.getValue("central_meridian")  .doubleValue(SI.RADIAN);
    latitudeOfOrigin    = values.getValue("latitude_of_origin").doubleValue(SI.RADIAN);
    scaleFactor         = values.getValue("scale_factor")      .doubleValue(Unit.ONE);
    falseEasting        = values.getValue("false_easting")     .doubleValue(SI.METER);
    falseNorthing       = values.getValue("false_northing")    .doubleValue(SI.METER);
    isSpherical         = (semiMajor == semiMinor);
    excentricitySquared = 1.0 - (semiMinor*semiMinor)/(semiMajor*semiMajor);
    excentricity        = Math.sqrt(excentricitySquared);
 * @throws ParameterNotFoundException if a mandatory parameter is missing.
 */
protected MapProjection(final ParameterValueGroup values) throws ParameterNotFoundException {
    semiMajor           = values.parameter("semi_major")        .doubleValue(SI.METER);
    semiMinor           = values.parameter("semi_minor")        .doubleValue(SI.METER);
    centralMeridian     = values.parameter("central_meridian")  .doubleValue(SI.RADIAN);
    latitudeOfOrigin    = values.parameter("latitude_of_origin").doubleValue(SI.RADIAN);
    scaleFactor         = values.parameter("scale_factor")      .doubleValue(Unit.ONE);
    falseEasting        = values.parameter("false_easting")     .doubleValue(SI.METER);
    falseNorthing       = values.parameter("false_northing")    .doubleValue(SI.METER);
    isSpherical         = (semiMajor == semiMinor);
    excentricitySquared = 1.0 - (semiMinor*semiMinor)/(semiMajor*semiMajor);
    excentricity        = Math.sqrt(excentricitySquared);
 *
 * @todo Would like to start range from 0 <u>exclusive</u>.
 */
public static final OperationParameter SEMI_MAJOR = new org.geotools.parameter.OperationParameter(
        "semi_major", Double.NaN, 0, Double.POSITIVE_INFINITY, SI.METER);

/**
 *
 * @todo Would like to start range from 0 <u>exclusive</u>.
 */
public static final ParameterDescriptor SEMI_MAJOR = new org.geotools.parameter.ParameterDescriptor(
        "semi_major", Double.NaN, 0, Double.POSITIVE_INFINITY, SI.METER);

/**
 *
 * @todo Would like to start range from 0 <u>exclusive</u>.
 */
public static final OperationParameter SEMI_MINOR = new org.geotools.parameter.OperationParameter(
        "semi_minor", Double.NaN, 0, Double.POSITIVE_INFINITY, SI.METER);

/**
 *
 * @todo Would like to start range from 0 <u>exclusive</u>.
 */
public static final ParameterDescriptor SEMI_MINOR = new org.geotools.parameter.ParameterDescriptor(
        "semi_minor", Double.NaN, 0, Double.POSITIVE_INFINITY, SI.METER);

/**
 * 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 OperationParameter CENTRAL_MERIDIAN = new org.geotools.parameter.OperationParameter(
        "central_meridian", 0, -180, 180, NonSI.DEGREE_ANGLE);

/**
 * 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 = new org.geotools.parameter.ParameterDescriptor(
        "central_meridian", 0, -180, 180, NonSI.DEGREE_ANGLE);

/**
 * 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 OperationParameter LATITUDE_OF_ORIGIN = new org.geotools.parameter.OperationParameter(
        "latitude_of_origin", 0, -90, 90, NonSI.DEGREE_ANGLE);

/**
 * 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 = new org.geotools.parameter.ParameterDescriptor(
        "latitude_of_origin", 0, -90, 90, NonSI.DEGREE_ANGLE);

/**
 *
 * @todo Would like to start range from 0 <u>exclusive</u>.
 */
public static final OperationParameter SCALE_FACTOR = new org.geotools.parameter.OperationParameter(
        "scale_factor", 1, 0, Double.POSITIVE_INFINITY, Unit.ONE);

/**
 *
 * @todo Would like to start range from 0 <u>exclusive</u>.
 */
public static final ParameterDescriptor SCALE_FACTOR = new org.geotools.parameter.ParameterDescriptor(
        "scale_factor", 1, 0, Double.POSITIVE_INFINITY, Unit.ONE);

/**
 * The operation parameter descriptor for the {@link #falseEasting falseEasting}
 * parameter value. Valid values range is unrestricted. Default value is 0.
 */
public static final OperationParameter FALSE_EASTING = new org.geotools.parameter.OperationParameter(
        "false_easting", 0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METER);

/**
 * The operation parameter descriptor for the {@link #falseEasting falseEasting}
 * parameter value. Valid values range is unrestricted. Default value is 0.
 */
public static final ParameterDescriptor FALSE_EASTING = new org.geotools.parameter.ParameterDescriptor(
        "false_easting", 0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METER);

/**
 * The operation parameter descriptor for the {@link #falseNorthing falseNorthing}
 * parameter value. Valid values range is unrestricted. Default value is 0.
 */
public static final OperationParameter FALSE_NORTHING = new org.geotools.parameter.OperationParameter(
        "false_northing", 0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METER);

/**
 * The operation parameter descriptor for the {@link #falseNorthing falseNorthing}
 * parameter value. Valid values range is unrestricted. Default value is 0.
 */
public static final ParameterDescriptor FALSE_NORTHING = new org.geotools.parameter.ParameterDescriptor(
        "false_northing", 0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METER);

/**
     * @param targetDimensions Number of dimensions in the target CRS of this operation method.
     * @param parameters The set of parameters (never <code>null</code>).
     */
    public Provider(final OperationParameterGroup parameters) {
        super(2, 2, parameters);
    }
}
     * @param targetDimensions Number of dimensions in the target CRS of this operation method.
     * @param parameters The set of parameters (never <code>null</code>).
     */
    public Provider(final ParameterDescriptorGroup parameters) {
        super(2, 2, parameters);
    }
}