You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/05/08 23:47:52 UTC

svn commit: r1678450 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/ main/java/org/apache/sis/referencing/operation/transform/ test/java/org/apache/sis/referencing/

Author: desruisseaux
Date: Fri May  8 21:47:51 2015
New Revision: 1678450

URL: http://svn.apache.org/r1678450
Log:
Referencing: the "defining conversion" constructor now accepts a ParameterValueGroup argument in replacement to the MathTransform.
This is needed when creating a ProjectedCRS since the "semi-major" and "semi-minor" parameter values are usually not yet known at
Conversion construction time.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] Fri May  8 21:47:51 2015
@@ -299,8 +299,6 @@ public class AbstractCoordinateOperation
                                        final MathTransform             transform)
     {
         super(properties);
-        ArgumentChecks.ensureNonNull("transform", transform);
-
         this.sourceCRS        = sourceCRS;
         this.targetCRS        = targetCRS;
         this.interpolationCRS = interpolationCRS;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java [UTF-8] Fri May  8 21:47:51 2015
@@ -96,7 +96,8 @@ class AbstractSingleOperation extends Ab
                                    final MathTransform             transform)
     {
         super(properties, sourceCRS, targetCRS, interpolationCRS, transform);
-        ArgumentChecks.ensureNonNull("method", method);
+        ArgumentChecks.ensureNonNull("method",    method);
+        ArgumentChecks.ensureNonNull("transform", transform);
         checkDimensions(method, transform, properties);
         this.method = method;
         /*
@@ -109,6 +110,27 @@ class AbstractSingleOperation extends Ab
     }
 
     /**
+     * Creates a defining conversion from the given transform and/or parameters.
+     * See {@link DefaultConversion#DefaultConversion(Map, OperationMethod, MathTransform, ParameterValueGroup)}
+     * for more information.
+     */
+    AbstractSingleOperation(final Map<String,?>       properties,
+                            final OperationMethod     method,
+                            final MathTransform       transform,
+                            final ParameterValueGroup parameters)
+    {
+        super(properties, null, null, null, transform);
+        ArgumentChecks.ensureNonNull("method", method);
+        if (transform != null) {
+            checkDimensions(method, transform, properties);
+        } else if (parameters == null) {
+            throw new IllegalArgumentException(Errors.format(Errors.Keys.UnspecifiedParameterValues));
+        }
+        this.method = method;
+        this.parameters = (parameters != null) ? parameters.clone() : null;
+    }
+
+    /**
      * Creates a new coordinate operation with the same values than the specified defining conversion,
      * except for the source CRS, target CRS and the math transform which are set the given values.
      *
@@ -256,6 +278,9 @@ class AbstractSingleOperation extends Ab
      * values or units of measurement.</div>
      *
      * @return A description of the parameters.
+     *
+     * @see DefaultOperationMethod#getParameters()
+     * @see org.apache.sis.referencing.operation.transform.AbstractMathTransform#getParameterDescriptors()
      */
     @Override
     public ParameterDescriptorGroup getParameterDescriptors() {
@@ -269,6 +294,8 @@ class AbstractSingleOperation extends Ab
      * @return The parameter values.
      * @throws UnsupportedOperationException if the parameter values can not be determined
      *         for the current math transform implementation.
+     *
+     * @see org.apache.sis.referencing.operation.transform.AbstractMathTransform#getParameterValues()
      */
     @Override
     public ParameterValueGroup getParameterValues() {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java [UTF-8] Fri May  8 21:47:51 2015
@@ -28,6 +28,7 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.cs.CoordinateSystem;
 import org.apache.sis.referencing.cs.CoordinateSystems;
 import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
 import org.apache.sis.util.resources.Errors;
@@ -42,9 +43,11 @@ import org.apache.sis.util.Workaround;
  * The parameters describing coordinate conversions are defined rather than empirically derived.
  *
  * <p>This coordinate operation contains an {@linkplain DefaultOperationMethod operation method}, usually
- * with associated parameter values. In the SIS default implementation, the parameter values are inferred from the
- * {@linkplain #getMathTransform() math transform}. Subclasses may have to override the {@link #getParameterValues()}
- * method if they need to provide a different set of parameters.</p>
+ * with associated {@linkplain org.apache.sis.parameter.DefaultParameterValueGroup parameter values}.
+ * In the SIS default implementation, the parameter values are inferred from the
+ * {@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform math transform}.
+ * Subclasses may have to override the {@link #getParameterValues()} method if they need to provide
+ * a different set of parameters.</p>
  *
  * <div class="section">Defining conversions</div>
  * {@code OperationMethod} instances are generally created for a pair of existing {@linkplain #getSourceCRS() source}
@@ -53,14 +56,22 @@ import org.apache.sis.util.Workaround;
  * {@linkplain org.apache.sis.referencing.crs.DefaultProjectedCRS projected CRS}.
  * Those <cite>defining conversions</cite> have no source and target CRS since those elements are provided by the
  * derived or projected CRS themselves. This class provides a {@linkplain #DefaultConversion(Map, OperationMethod,
- * MathTransform) constructor} for such defining conversions.
+ * MathTransform, ParameterValueGroup) constructor} for such defining conversions.
+ *
+ * <p>After the source and target CRS become known, we can invoke the {@link #specialize specialize(…)} method for
+ * {@linkplain DefaultMathTransformFactory#createBaseToDerived(CoordinateReferenceSystem, ParameterValueGroup,
+ * CoordinateSystem) creating a math transform from the parameters}, instantiate a new {@code Conversion} of a
+ * more specific type
+ * ({@link org.opengis.referencing.operation.ConicProjection},
+ *  {@link org.opengis.referencing.operation.CylindricalProjection} or
+ *  {@link org.opengis.referencing.operation.PlanarProjection}) if possible,
+ * and assign the source and target CRS to it.</p>
  *
  * <div class="section">Immutability and thread safety</div>
- * This base class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
- * given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar
- * conditions. This means that unless otherwise noted in the javadoc, {@code CoordinateOperation} instances created
- * using only SIS factories and static constants can be shared by many objects and passed between threads without
- * synchronization.
+ * This class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
+ * given to the constructor are also immutable. This means that unless otherwise noted in the javadoc,
+ * {@code Conversion} instances created using only SIS factories and static constants can be shared
+ * by many objects and passed between threads without synchronization.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6
@@ -136,24 +147,47 @@ public class DefaultConversion extends A
     }
 
     /**
-     * Creates a defining conversion from the given transform.
-     * This conversion has no source and target CRS since those elements will be provided by the
-     * {@linkplain org.apache.sis.referencing.crs.DefaultDerivedCRS derived} or
-     * {@linkplain org.apache.sis.referencing.crs.DefaultProjectedCRS projected CRS}.
+     * Creates a defining conversion from the given transform and/or parameters.
+     * This conversion has no source and target CRS since those elements are usually unknown
+     * at <cite>defining conversion</cite> construction time. The source and target CRS will
+     * become known later, at the
+     * {@linkplain org.apache.sis.referencing.crs.DefaultDerivedCRS Derived CRS} or
+     * {@linkplain org.apache.sis.referencing.crs.DefaultProjectedCRS Projected CRS}
+     * construction time.
      *
-     * <p>The properties given in argument follow the same rules than for the
+     * <p>The {@code properties} map given in argument follows the same rules than for the
      * {@linkplain #DefaultConversion(Map, CoordinateReferenceSystem, CoordinateReferenceSystem,
      * CoordinateReferenceSystem, OperationMethod, MathTransform) above constructor}.</p>
      *
+     * <div class="section">Transform and parameters arguments</div>
+     * At least one of the {@code transform} or {@code parameters} argument must be non-null.
+     * If the caller supplies a {@code transform} argument, then it shall be a transform expecting
+     * {@linkplain org.apache.sis.referencing.cs.AxesConvention#NORMALIZED normalized} input coordinates
+     * and producing normalized output coordinates. See {@link org.apache.sis.referencing.cs.AxesConvention}
+     * for more information about what Apache SIS means by "normalized".
+     *
+     * <p>If the caller can not yet supply a {@code MathTransform}, then (s)he shall supply the parameter values needed
+     * for creating that transform, with the possible omission of {@code "semi-major"} and {@code "semi-minor"} values.
+     * The semi-major and semi-minor parameter values will be set automatically when the
+     * {@link #specialize specialize(…)} method will be invoked.</p>
+     *
+     * <p>If both the {@code transform} and {@code parameters} arguments are non-null, then the later should describes
+     * the parameters used for creating the transform. Those parameters will be stored for information purpose and can
+     * be given back by the {@link #getParameterValues()} method.</p>
+     *
      * @param properties The properties to be given to the identified object.
      * @param method     The operation method.
-     * @param transform  Transform from positions in the source CRS to positions in the target CRS.
+     * @param transform  Transform from positions in the source CRS to positions in the target CRS, or {@code null}.
+     * @param parameters The {@code transform} parameter values, or {@code null}.
+     *
+     * @see DefaultMathTransformFactory#createBaseToDerived(CoordinateSystem, MathTransform, CoordinateSystem)
      */
-    public DefaultConversion(final Map<String,?>   properties,
-                             final OperationMethod method,
-                             final MathTransform   transform)
+    public DefaultConversion(final Map<String,?>       properties,
+                             final OperationMethod     method,
+                             final MathTransform       transform,
+                             final ParameterValueGroup parameters)
     {
-        super(properties, null, null, null, method, transform);
+        super(properties, method, transform, parameters);
     }
 
     /**
@@ -263,6 +297,8 @@ public class DefaultConversion extends A
      * @throws FactoryException if the creation of a {@link MathTransform} from the {@linkplain #getParameterValues()
      *         parameter values}, or a {@linkplain CoordinateSystems#swapAndScaleAxes change of axis order or units}
      *         failed.
+     *
+     * @see DefaultMathTransformFactory#createBaseToDerived(CoordinateReferenceSystem, ParameterValueGroup, CoordinateSystem)
      */
     public <T extends Conversion> T specialize(final Class<T> baseType,
             final CoordinateReferenceSystem sourceCRS, final CoordinateReferenceSystem targetCRS,

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] Fri May  8 21:47:51 2015
@@ -551,6 +551,9 @@ public class DefaultOperationMethod exte
      * {@link #DefaultOperationMethod(MathTransform)} constructor has been unable to infer it.</div>
      *
      * @return The parameters, or {@code null} if unknown.
+     *
+     * @see DefaultConversion#getParameterDescriptors()
+     * @see DefaultConversion#getParameterValues()
      */
     @Override
     public ParameterDescriptorGroup getParameters() {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java [UTF-8] Fri May  8 21:47:51 2015
@@ -39,11 +39,10 @@ import org.apache.sis.util.ArgumentCheck
  * method if they need to provide a different set of parameters.</p>
  *
  * <div class="section">Immutability and thread safety</div>
- * This base class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
- * given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar
- * conditions. This means that unless otherwise noted in the javadoc, {@code CoordinateOperation} instances created
- * using only SIS factories and static constants can be shared by many objects and passed between threads without
- * synchronization.
+ * This class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
+ * given to the constructor are also immutable. This means that unless otherwise noted in the javadoc,
+ * {@code Transformation} instances created using only SIS factories and static constants can be shared
+ * by many objects and passed between threads without synchronization.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java [UTF-8] Fri May  8 21:47:51 2015
@@ -145,7 +145,11 @@ final class SubTypes {
             }
         }
         final Conversion conversion;
-        if (CylindricalProjection.class.isAssignableFrom(type)) {
+        if (type.isInstance(definition) && definition.getSourceCRS() == sourceCRS
+                                        && definition.getTargetCRS() == targetCRS)
+        {
+            conversion = definition;
+        } else if (CylindricalProjection.class.isAssignableFrom(type)) {
             conversion = new DefaultCylindricalProjection(definition, sourceCRS, targetCRS, factory);
         } else if (ConicProjection.class.isAssignableFrom(type)) {
             conversion = new DefaultConicProjection(definition, sourceCRS, targetCRS, factory);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java [UTF-8] Fri May  8 21:47:51 2015
@@ -29,6 +29,14 @@
  *   <li>{@link org.apache.sis.referencing.operation.transform} for any transform other than map projections</li>
  * </ul>
  *
+ * <div class="section">Apache SIS extensions</div>
+ * Some SIS implementations provide additional methods that are not part of OGC/ISO specifications:
+ *
+ * <ul>
+ *   <li>{@link org.apache.sis.referencing.operation.AbstractCoordinateOperation#getLinearAccuracy() AbstractCoordinateOperation.getLinearAccuracy()}</li>
+ *   <li>{@link org.apache.sis.referencing.operation.DefaultConversion#specialize DefaultConversion.specialize(Class, CoordinateReferenceSystem, CoordinateReferenceSystem, MathTransformFactory)}</li>
+ * </ul>
+ *
  * <div class="section">Apache SIS specific behavior</div>
  * The following operations have a behavior in Apache SIS which may be different
  * than the behavior found in other softwares. Those particularities apply only when the math transform is

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] Fri May  8 21:47:51 2015
@@ -30,7 +30,6 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.TransformException;
 import org.opengis.referencing.operation.NoninvertibleTransformException;
 import org.opengis.referencing.operation.OperationMethod;
-import org.opengis.referencing.operation.SingleOperation;
 import org.apache.sis.geometry.GeneralDirectPosition;
 import org.apache.sis.parameter.Parameterized;
 import org.apache.sis.referencing.operation.matrix.Matrices;
@@ -161,7 +160,7 @@ public abstract class AbstractMathTransf
      *
      * @return The parameter descriptors for this math transform, or {@code null} if unspecified.
      *
-     * @see OperationMethod#getParameters()
+     * @see org.apache.sis.referencing.operation.DefaultOperationMethod#getParameters()
      */
     @Override
     public ParameterDescriptorGroup getParameterDescriptors() {
@@ -186,7 +185,7 @@ public abstract class AbstractMathTransf
      *         of an ellipsoid of semi-major axis length of 1).
      *
      * @see #getContextualParameters()
-     * @see SingleOperation#getParameterValues()
+     * @see org.apache.sis.referencing.operation.DefaultConversion#getParameterValues()
      */
     @Override
     public ParameterValueGroup getParameterValues() {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Fri May  8 21:47:51 2015
@@ -609,6 +609,7 @@ public class DefaultMathTransformFactory
      *         if some required parameter has not been supplied, or has illegal value.
      *
      * @see org.apache.sis.referencing.cs.AxesConvention#NORMALIZED
+     * @see org.apache.sis.referencing.operation.DefaultConversion#DefaultConversion(Map, OperationMethod, MathTransform, ParameterValueGroup)
      */
     public MathTransform createBaseToDerived(final CoordinateSystem baseCS,
             final MathTransform parameterized, final CoordinateSystem derivedCS)

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java [UTF-8] Fri May  8 21:47:51 2015
@@ -145,6 +145,7 @@ public class PassThroughTransform extend
                                        final MathTransform subTransform,
                                        final int numTrailingOrdinates)
     {
+        ensureNonNull ("subTransform",          subTransform);
         ensurePositive("firstAffectedOrdinate", firstAffectedOrdinate);
         ensurePositive("numTrailingOrdinates",  numTrailingOrdinates);
         if (firstAffectedOrdinate == 0 && numTrailingOrdinates == 0) {

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java?rev=1678450&r1=1678449&r2=1678450&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java [UTF-8] Fri May  8 21:47:51 2015
@@ -28,7 +28,6 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.util.NoSuchIdentifierException;
 import org.opengis.util.FactoryException;
-import org.apache.sis.internal.referencing.OperationMethods;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.crs.DefaultProjectedCRS;
 import org.apache.sis.referencing.operation.DefaultConversion;
@@ -187,11 +186,10 @@ public class GeodeticObjectBuilder exten
              * except the aliases and identifiers. The name defaults to the ProjectedCRS name,
              * but can optionally be different.
              */
-            properties.put(OperationMethods.PARAMETERS_KEY, parameters);
             final Object name = (conversionName != null) ? properties.put(Conversion.NAME_KEY, conversionName) : null;
             final Object alias = properties.put(Conversion.ALIAS_KEY, null);
             final Object identifier = properties.put(Conversion.IDENTIFIERS_KEY, null);
-            final Conversion conversion = new DefaultConversion(properties, mtFactory.getLastMethodUsed(), mt);
+            final Conversion conversion = new DefaultConversion(properties, mtFactory.getLastMethodUsed(), mt, parameters);
             /*
              * Restore the original properties and create the final ProjectedCRS.
              */
@@ -203,7 +201,6 @@ public class GeodeticObjectBuilder exten
             return new DefaultProjectedCRS(properties, baseCRS, conversion, derivedCS);
         } finally {
             onCreate(true);
-            properties.remove(OperationMethods.PARAMETERS_KEY);
         }
     }
 }