sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1672065 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/internal/metadata/ sis-metadata/src/main/java/org/apache/sis/io/wkt/ sis-metadata/src/test/java/org/apache/sis/io/wkt/ sis-metadata/src/test/java/org/apache/si...
Date Wed, 08 Apr 2015 11:38:36 GMT
Author: desruisseaux
Date: Wed Apr  8 11:38:35 2015
New Revision: 1672065

URL: http://svn.apache.org/r1672065
Log:
Referencing: added test for Equirectangular projection, in particular its WKT formatting.
This implied a change in the way matrices were formatted in WKT (no more special case for
Matrix, use a more generic mechanism for MathTransform instead).

Added:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java   (with props)
Removed:
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/mock/MatrixMock.java
Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.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/ContextualParameters.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/LongitudeRotationTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -19,7 +19,6 @@ package org.apache.sis.internal.metadata
 import org.opengis.geometry.Envelope;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.referencing.IdentifiedObject;
-import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.metadata.iso.extent.DefaultExtent;
@@ -43,7 +42,7 @@ import org.apache.sis.util.resources.Err
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.6
  * @module
  */
 public abstract class ReferencingServices extends SystemListener {
@@ -111,18 +110,6 @@ public abstract class ReferencingService
     }
 
     /**
-     * Returns the matrix for the given transform, or {@code null} if none.
-     *
-     * @param  tr The transform for which to get the matrix.
-     * @return The matrix, or {@code null} if none.
-     *
-     * @see org.apache.sis.referencing.operation.transform.LinearTransform#getMatrix()
-     *
-     * @since 0.4
-     */
-    public abstract Matrix getMatrix(MathTransform tr);
-
-    /**
      * Returns a fully implemented parameter descriptor.
      *
      * @param  parameter A partially implemented parameter descriptor, or {@code null}.
@@ -133,7 +120,7 @@ public abstract class ReferencingService
     public abstract ParameterDescriptor<?> toImplementation(ParameterDescriptor<?> parameter);
 
     /**
-     * Converts the given object in a {@link org.apache.sis.io.wkt.FormattableObject} instance.
+     * Converts the given object in a {@code FormattableObject} instance.
      *
      * @param  object The object to wrap.
      * @return The given object converted to a {@code FormattableObject} instance.
@@ -145,6 +132,18 @@ public abstract class ReferencingService
     public abstract FormattableObject toFormattableObject(IdentifiedObject object);
 
     /**
+     * Converts the given object in a {@code FormattableObject} instance. Callers should verify that the given
+     * object is not already an instance of {@code FormattableObject} before to invoke this method. This method
+     * returns {@code null} if it can not convert the object.
+     *
+     * @param  object The object to wrap.
+     * @return The given object converted to a {@code FormattableObject} instance, or {@code null}.
+     *
+     * @since 0.6
+     */
+    public abstract FormattableObject toFormattableObject(MathTransform object);
+
+    /**
      * Sets a geographic bounding box from the specified envelope.
      * If the envelope contains a CRS which is not geographic, then the bounding box will be transformed
      * to a geographic CRS (without datum shift if possible). Otherwise, the envelope is assumed already

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -76,7 +76,7 @@ public enum ElementKind {
     CODE_LIST,
 
     /**
-     * {@linkplain org.apache.sis.parameter.DefaultParameterValue Parameter values},
+     * Name of {@linkplain org.apache.sis.parameter.AbstractParameterDescriptor parameters},
      * often represented by {@code PARAMETER[…]} elements.
      */
     PARAMETER,

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -52,7 +52,6 @@ import org.opengis.referencing.datum.Dat
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.CoordinateOperation;
 import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.Matrix;
 import org.opengis.util.Enumerated;
 
 import org.apache.sis.measure.Units;
@@ -66,7 +65,6 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.Citations;
-import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.simple.SimpleExtent;
 import org.apache.sis.internal.metadata.ReferencingServices;
 import org.apache.sis.measure.Range;
@@ -867,15 +865,9 @@ public class Formatter implements Locali
             if (transform instanceof FormattableObject) {
                 append((FormattableObject) transform);
             } else {
-                final Matrix matrix = ReferencingServices.getInstance().getMatrix(transform);
-                if (matrix != null) {
-                    openElement(true, "Param_MT");
-                    buffer.appendCodePoint(symbols.getOpeningQuote(0)).append(Constants.AFFINE)
-                          .appendCodePoint(symbols.getClosingQuote(0));
-                    indent(+1);
-                    append(matrix);
-                    indent(-1);
-                    closeElement(true);
+                final FormattableObject object = ReferencingServices.getInstance().toFormattableObject(transform);
+                if (object != null) {
+                    append(object);
                 } else {
                     throw new UnformattableObjectException(Errors.format(
                             Errors.Keys.IllegalClass_2, FormattableObject.class, transform.getClass()));
@@ -885,46 +877,6 @@ public class Formatter implements Locali
     }
 
     /**
-     * Appends the given matrix as a sequence of {@code PARAMETER[…]} elements.
-     * Only elements different than the default values are appended.
-     * The default values are 1 on the matrix diagonal and 0 elsewhere.
-     *
-     * @param matrix The matrix to append to the WKT, or {@code null} if none.
-     */
-    public void append(final Matrix matrix) {
-        if (matrix == null) {
-            return;
-        }
-        final int numRow = matrix.getNumRow();
-        final int numCol = matrix.getNumCol();
-        final int openQuote  = symbols.getOpeningQuote(0);
-        final int closeQuote = symbols.getClosingQuote(0);
-        boolean columns = false;
-        do {
-            openElement(true, "Parameter");
-            buffer.appendCodePoint(openQuote)
-                  .append(columns ? Constants.NUM_COL : Constants.NUM_ROW)
-                  .appendCodePoint(closeQuote);
-            append(columns ? numCol : numRow);
-            closeElement(false);
-        } while ((columns = !columns) == true);
-        for (int j=0; j<numRow; j++) {
-            for (int i=0; i<numCol; i++) {
-                final double element = matrix.getElement(j, i);
-                if (element != (i == j ? 1 : 0)) {
-                    openElement(true, "Parameter");
-                    setColor(ElementKind.PARAMETER);
-                    buffer.appendCodePoint(openQuote).append("elt_").append(j)
-                            .append('_').append(i).appendCodePoint(closeQuote);
-                    resetColor();
-                    append(element);
-                    closeElement(false);
-                }
-            }
-        }
-    }
-
-    /**
      * Appends an international text in an element having the given keyword. Since this method
      * is typically invoked for long descriptions, the element will be written on its own line.
      *
@@ -1245,8 +1197,6 @@ public class Formatter implements Locali
             append(ReferencingServices.getInstance().toFormattableObject((IdentifiedObject) value));
         } else if (value instanceof MathTransform) {
             append((MathTransform) value);
-        } else if (value instanceof Matrix) {
-            append((Matrix) value);
         } else if (value instanceof Unit<?>) {
             append((Unit<?>) value);
         } else if (value instanceof GeographicBoundingBox) {

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -434,7 +434,6 @@ public class WKTFormat extends CompoundF
      * Formats the specified object as a Well Know Text. The formatter accepts at least the following types:
      * {@link FormattableObject}, {@link IdentifiedObject},
      * {@link org.opengis.referencing.operation.MathTransform},
-     * {@link org.opengis.referencing.operation.Matrix}
      * {@link org.opengis.metadata.extent.GeographicBoundingBox},
      * {@link org.opengis.metadata.extent.VerticalExtent},
      * {@link org.opengis.metadata.extent.TemporalExtent}

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -19,14 +19,12 @@ package org.apache.sis.io.wkt;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import org.opengis.util.CodeList;
-import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
 import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
 import org.apache.sis.measure.Units;
 import org.apache.sis.internal.util.X364;
-import org.apache.sis.test.mock.MatrixMock;
 import org.apache.sis.test.mock.VerticalCRSMock;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -95,24 +93,6 @@ public final strictfp class FormatterTes
     }
 
     /**
-     * Tests (indirectly) {@link Formatter#append(Matrix)}.
-     */
-    @Test
-    public void testAppendMatrix() {
-        final Matrix m = new MatrixMock(4, 4,
-                1, 0, 4, 0,
-               -2, 1, 0, 0,
-                0, 0, 1, 7,
-                0, 0, 0, 1);
-        assertWktEquals(
-                "Parameter[“num_row”, 4],\n"    +
-                "Parameter[“num_col”, 4],\n"    +
-                "Parameter[“elt_0_2”, 4.0],\n"  +
-                "Parameter[“elt_1_0”, -2.0],\n"  +
-                "Parameter[“elt_2_3”, 7.0]", m);
-    }
-
-    /**
      * Tests (indirectly) {@link Formatter#append(Unit)}.
      */
     @Test

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -21,6 +21,7 @@ import java.util.Collection;
 
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.TemporalCRS;
@@ -28,7 +29,6 @@ import org.opengis.referencing.crs.Verti
 import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.cs.CoordinateSystem;
-import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.TransformException;
 import org.opengis.referencing.operation.CoordinateOperation;
@@ -43,8 +43,9 @@ import org.apache.sis.referencing.CRS;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.referencing.crs.DefaultTemporalCRS;
-import org.apache.sis.referencing.operation.transform.MathTransforms;
 import org.apache.sis.parameter.DefaultParameterDescriptor;
+import org.apache.sis.parameter.Parameterized;
+import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.metadata.iso.extent.DefaultExtent;
 import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
@@ -62,7 +63,7 @@ import org.apache.sis.util.Utilities;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.6
  * @module
  */
 public final class ServicesForMetadata extends ReferencingServices {
@@ -73,17 +74,6 @@ public final class ServicesForMetadata e
     }
 
     /**
-     * Returns the matrix for the given transform, or {@code null} if none.
-     *
-     * @param  tr The transform for which to get the matrix.
-     * @return The matrix, or {@code null} if none.
-     */
-    @Override
-    public Matrix getMatrix(final MathTransform tr) {
-        return MathTransforms.getMatrix(tr);
-    }
-
-    /**
      * Returns a fully implemented parameter descriptor.
      *
      * @param  parameter A partially implemented parameter descriptor, or {@code null}.
@@ -95,7 +85,7 @@ public final class ServicesForMetadata e
     }
 
     /**
-     * Converts the given object in a {@link org.apache.sis.io.wkt.FormattableObject} instance.
+     * Converts the given object in a {@code FormattableObject} instance.
      *
      * @param  object The object to wrap.
      * @return The given object converted to a {@code FormattableObject} instance.
@@ -106,6 +96,33 @@ public final class ServicesForMetadata e
     }
 
     /**
+     * Converts the given object in a {@code FormattableObject} instance. Callers should verify that the given
+     * object is not already an instance of {@code FormattableObject} before to invoke this method. This method
+     * returns {@code null} if it can not convert the object.
+     *
+     * @param  object The object to wrap.
+     * @return The given object converted to a {@code FormattableObject} instance, or {@code null}.
+     *
+     * @since 0.6
+     */
+    @Override
+    public FormattableObject toFormattableObject(final MathTransform object) {
+        if (object instanceof Parameterized) {
+            final ParameterValueGroup parameters = ((Parameterized) object).getParameterValues();
+            if (parameters != null) {
+                return new FormattableObject() {
+                    @Override
+                    protected String formatTo(final Formatter formatter) {
+                        WKTUtilities.appendParamMT(parameters, formatter);
+                        return "Param_MT";
+                    }
+                };
+            }
+        }
+        return null;
+    }
+
+    /**
      * Returns the coordinate operation factory to be used for transforming the envelope.
      * We will fetch a lenient factory because {@link GeographicBoundingBox} are usually for approximative
      * bounds (e.g. the area of validity of some CRS). If a user wants accurate bounds, he should probably

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -53,7 +53,7 @@ import org.apache.sis.util.resources.Voc
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.6
  * @module
  */
 public final class WKTUtilities extends Static {
@@ -180,6 +180,19 @@ public final class WKTUtilities extends
     }
 
     /**
+     * Appends a {@linkplain ParameterValueGroup group of parameters} in a {@code Param_MT[…]} element.
+     *
+     * @param parameters The parameter to append to the WKT, or {@code null} if none.
+     * @param formatter The formatter where to append the parameter.
+     */
+    public static void appendParamMT(final ParameterValueGroup parameters, final Formatter formatter) {
+        if (parameters != null) {
+            appendName(parameters.getDescriptor(), formatter, ElementKind.PARAMETER);
+            append(parameters, formatter);
+        }
+    }
+
+    /**
      * Appends a {@linkplain ParameterValue parameter} in a {@code PARAMETER[…]} element.
      * If the supplied parameter is actually a {@linkplain ParameterValueGroup parameter group},
      * all contained parameters will be flattened in a single list.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -44,10 +44,10 @@ import static java.lang.Math.*;
  * because it does not create non-liner kernel. Instead, the projection created by this class is implemented
  * by an affine transform.
  *
- * <div class="note"><b>Note:</b>
- * EPSG defines two codes for this projection, 1029 being the spherical case and 1028 the ellipsoidal case.
- * However the formulas are the same in both cases, with an additional adjustment of Earth radius in the
- * ellipsoidal case. Consequently they are implemented in Apache SIS by the same class.</div>
+ * <p>This provider is <strong>not</strong> suitable for the <cite>Equidistant Cylindrical</cite> projection
+ * (EPSG:1028, <span class="deprecated">EPSG:9842</span>). EPSG defines Equidistant Cylindrical projection as
+ * the ellipsoidal case of this projection, which uses a more complicated formula than the affine transform
+ * used here.</p>
  *
  * <div class="note"><b>Note:</b>
  * EPSG:1028 and 1029 are the current codes, while EPSG:9842 and 9823 are deprecated codes.
@@ -166,12 +166,14 @@ public final class Equirectangular exten
                 .setRemarks(Messages.formatInternational(Messages.Keys.ConstantProjParameterValue_1, 0))
                 .setRequired(false), 0.0);
 
+        // Do not declare the ESRI "Equidistant_Cylindrical" projection name below,
+        // for avoiding confusion with EPSG "Equidistant Cylindrical" ellipsoidal projection.
         PARAMETERS = builder
             .addIdentifier(             "1029")
             .addDeprecatedIdentifier(   "9823", "1029")  // Using deprecated parameter names
             .addName(                   "Equidistant Cylindrical (Spherical)")
+            .addName(                   "Plate Carrée")  // Not formally defined by EPSG, but cited in documentation.
             .addName(Citations.OGC,     "Equirectangular")
-            .addName(Citations.ESRI,    "Equidistant_Cylindrical")
             .addName(Citations.GEOTIFF, "CT_Equirectangular")
             .addName(Citations.PROJ4,   "eqc")
             .addIdentifier(Citations.GEOTIFF, "17")
@@ -201,7 +203,10 @@ public final class Equirectangular exten
     }
 
     /**
-     * Creates an Equirectangular projection from the specified group of parameter values.
+     * Creates an Equirectangular projection from the specified group of parameter values. This method is an
+     * adaptation of {@link org.apache.sis.referencing.operation.projection.NormalizedProjection} constructor,
+     * reproduced in this method because we will create an affine transform instead than the usual projection
+     * classes.
      *
      * @param  factory The factory to use if this constructor needs to create other math transforms.
      * @param  parameters The parameter values that define the transform to create.
@@ -212,26 +217,15 @@ public final class Equirectangular exten
     public MathTransform createMathTransform(final MathTransformFactory factory, final ParameterValueGroup parameters)
             throws FactoryException
     {
-        return createMathTransform(this, factory, Parameters.castOrWrap(parameters));
-    }
-
-    /**
-     * Creates an Equirectangular or Plate-Carrée projection from the specified group of parameter values. This
-     * method is an adaptation of {@link org.apache.sis.referencing.operation.projection.NormalizedProjection}
-     * constructor, reproduced in this method because we will create an affine transform instead than the usual
-     * projection classes.
-     */
-    static MathTransform createMathTransform(final AbstractProvider method, final MathTransformFactory factory,
-            final Parameters parameters) throws FactoryException
-    {
-        final ContextualParameters context = new ContextualParameters(method);
-        double a  = MapProjection.getAndStore(parameters, context, MapProjection.SEMI_MAJOR);
-        double b  = MapProjection.getAndStore(parameters, context, MapProjection.SEMI_MINOR);
-        double λ0 = MapProjection.getAndStore(parameters, context, CENTRAL_MERIDIAN);
-        double φ0 = MapProjection.getAndStore(parameters, context, LATITUDE_OF_ORIGIN);
-        double φ1 = MapProjection.getAndStore(parameters, context, STANDARD_PARALLEL);
-        double fe = MapProjection.getAndStore(parameters, context, FALSE_EASTING);
-        double fn = MapProjection.getAndStore(parameters, context, FALSE_NORTHING);
+        final Parameters p = Parameters.castOrWrap(parameters);
+        final ContextualParameters context = new ContextualParameters(this);
+        double a  = MapProjection.getAndStore(p, context, MapProjection.SEMI_MAJOR);
+        double b  = MapProjection.getAndStore(p, context, MapProjection.SEMI_MINOR);
+        double λ0 = MapProjection.getAndStore(p, context, CENTRAL_MERIDIAN);
+        double φ0 = MapProjection.getAndStore(p, context, LATITUDE_OF_ORIGIN);
+        double φ1 = MapProjection.getAndStore(p, context, STANDARD_PARALLEL);
+        double fe = MapProjection.getAndStore(p, context, FALSE_EASTING);
+        double fn = MapProjection.getAndStore(p, context, FALSE_NORTHING);
         /*
          * Perform following transformation, in that order. Note that following
          * AffineTransform convention, the Java code appears in reverse order:

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -35,7 +35,6 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
-import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.Utilities;
 import org.apache.sis.util.Classes;
@@ -465,8 +464,7 @@ final class TensorValues<E> extends Abst
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        WKTUtilities.appendName(this, formatter, ElementKind.PARAMETER);
-        WKTUtilities.append(this, formatter);
+        WKTUtilities.appendParamMT(this, formatter);
         return "ParameterGroup";
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -133,9 +133,20 @@ public class Mercator extends Normalized
     @Workaround(library="JDK", version="1.7")
     private Mercator(final OperationMethod method, final Parameters parameters, final byte type) {
         super(method, parameters,
-                (type == SPHERICAL) ? Mercator2SP     .STANDARD_PARALLEL        : null,
+                (type == SPHERICAL) ? Mercator2SP     .STANDARD_PARALLEL        : null,     // See note below.
                 (type == REGIONAL ) ? RegionalMercator.EASTING_AT_FALSE_ORIGIN  : AbstractMercator.FALSE_EASTING,
                 (type == REGIONAL ) ? RegionalMercator.NORTHING_AT_FALSE_ORIGIN : AbstractMercator.FALSE_NORTHING);
+        /*
+         * Note on above Mercator2SP.STANDARD_PARALLEL argument (used for computing radius of conformal sphere):
+         * according the EPSG guide we should rather use Mercator2SP.LATITUDE_OF_ORIGIN. But the later is fixed
+         * to 0° by EPSG guide, which makes radius calculation ineffective when using the official parameters.
+         * Given that we already allow usage of Mercator2SP.STANDARD_PARALLEL (which is not an EPSG parameter)
+         * for compatibility reasons, user who set the standard parallel may expect this latitude to be used for
+         * radius calculation. Using the standard parallel instead than the latitude of origin is also consistent
+         * with what EPSG does for the Equirectangular projection. Anyway, this choice matters only when the user
+         * request explicitely spherical formulas applied on an ellipsoidal figure of the Earth, which should be
+         * very rare.
+         */
         this.type = type;
         /*
          * The "Longitude of natural origin" parameter is found in all Mercator projections and is mandatory.

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=1672065&r1=1672064&r2=1672065&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] Wed Apr  8 11:38:35 2015
@@ -954,11 +954,7 @@ public abstract class AbstractMathTransf
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        final ParameterValueGroup parameters = getParameterValues();
-        if (parameters != null) {
-            WKTUtilities.appendName(parameters.getDescriptor(), formatter, null);
-            WKTUtilities.append(parameters, formatter);
-        }
+        WKTUtilities.appendParamMT(getParameterValues(), formatter);
         return "Param_MT";
     }
 
@@ -1119,8 +1115,7 @@ public abstract class AbstractMathTransf
         protected String formatTo(final Formatter formatter) {
             final ParameterValueGroup parameters = getParameterValues();
             if (parameters != null) {
-                WKTUtilities.appendName(parameters.getDescriptor(), formatter, null);
-                WKTUtilities.append(parameters, formatter);
+                WKTUtilities.appendParamMT(parameters, formatter);
                 return "Param_MT";
             } else {
                 formatter.append((FormattableObject) AbstractMathTransform.this);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -578,8 +578,7 @@ public class ContextualParameters extend
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        WKTUtilities.appendName(descriptor, formatter, null);
-        WKTUtilities.append(this, formatter);
+        WKTUtilities.appendParamMT(this, formatter);
         return "Param_MT";
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -42,6 +42,7 @@ import static org.junit.Assert.*;
 @DependsOn({
     org.apache.sis.referencing.operation.DefaultOperationMethodTest.class,
     AffineTest.class,
+    LongitudeRotationTest.class,
     MapProjectionTest.class
 })
 public final strictfp class AllProvidersTest extends TestCase {

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/LongitudeRotationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/LongitudeRotationTest.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/LongitudeRotationTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/LongitudeRotationTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -71,9 +71,7 @@ public final strictfp class LongitudeRot
         final ParameterValueGroup p = provider.getParameters().createValue();
         p.parameter(LongitudeRotation.NAME).setValue(2.5969213, NonSI.GRADE);
         assertWktEquals(
-                "Param_MT[“Affine”,\n" +
-                "  Parameter[“num_row”, 3],\n" +
-                "  Parameter[“num_col”, 3],\n" +
-                "  Parameter[“elt_0_2”, 2.33722917]]", provider.createMathTransform(null, p));
+                "Param_MT[“Affine parametric transformation”,\n" +
+                "  Parameter[“A2”, 2.33722917, Id[“EPSG”, 8625]]]", provider.createMathTransform(null, p));
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -50,10 +50,34 @@ public final strictfp class MapProjectio
     }
 
     /**
-     * Verifies some {@link Mercator1SP} parameter descriptors.
+     * Verifies some parameters of {@link Equirectangular}. Note that {@code Equirectangular} is the first projection
+     * to be loaded by {@link org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory} and defines
+     * some parameters which will be reused by other projections.
+     *
+     * <p><b>Note:</b> there is no test for {@code Equirectangular.createMathTransform(…)} in this class because
+     * the math transforms are tested in the {@link org.apache.sis.referencing.operation.projection} package.</p>
      */
     @Test
     @DependsOnMethod("testSemiAxes")
+    public void testEquirectangular() {
+        final Iterator<GeneralParameterDescriptor> it = Equirectangular.PARAMETERS.descriptors().iterator();
+        assertParamEquals("Equidistant Cylindrical (Spherical)", "Equirectangular",    true,  Equirectangular.PARAMETERS);
+        assertParamEquals(null,                                   SEMI_MAJOR,          true,  it.next());
+        assertParamEquals(null,                                   SEMI_MINOR,          true,  it.next());
+        assertParamEquals("Latitude of 1st standard parallel",    STANDARD_PARALLEL_1, true,  it.next());
+        assertParamEquals("Latitude of natural origin",          "latitude_of_origin", false, it.next());
+        assertParamEquals("Longitude of natural origin",          CENTRAL_MERIDIAN,    true,  it.next());
+        assertParamEquals("False easting",                        FALSE_EASTING,       true,  it.next());
+        assertParamEquals("False northing",                       FALSE_NORTHING,      true,  it.next());
+        assertFalse(it.hasNext());
+        assertIsForcedToZero((ParameterDescriptor<?>) Equirectangular.PARAMETERS.descriptor("latitude_of_origin"));
+    }
+
+    /**
+     * Verifies some {@link Mercator1SP} parameter descriptors.
+     */
+    @Test
+    @DependsOnMethod("testEquirectangular")
     public void testMercator1SP() {
         final Iterator<GeneralParameterDescriptor> it = Mercator1SP.PARAMETERS.descriptors().iterator();
         assertParamEquals("Mercator (variant A)",          "Mercator_1SP",       true, Mercator1SP.PARAMETERS);
@@ -72,12 +96,12 @@ public final strictfp class MapProjectio
      * Verifies some {@link Mercator2SP} parameter descriptors.
      */
     @Test
-    @DependsOnMethod("testSemiAxes")
+    @DependsOnMethod("testMercator1SP")
     public void testMercator2SP() {
         final Iterator<GeneralParameterDescriptor> it = Mercator2SP.PARAMETERS.descriptors().iterator();
         assertParamEquals("Mercator (variant B)",             "Mercator_2SP",        true,  Mercator2SP.PARAMETERS);
-        assertParamEquals(null,                                SEMI_MAJOR,           true, it.next());
-        assertParamEquals(null,                                SEMI_MINOR,           true, it.next());
+        assertParamEquals(null,                                SEMI_MAJOR,           true,  it.next());
+        assertParamEquals(null,                                SEMI_MINOR,           true,  it.next());
         assertParamEquals("Latitude of 1st standard parallel", STANDARD_PARALLEL_1,  true,  it.next());
         assertParamEquals(null,                               "latitude_of_origin",  false, it.next());
         assertParamEquals("Longitude of natural origin",       CENTRAL_MERIDIAN,     true,  it.next());
@@ -115,7 +139,7 @@ public final strictfp class MapProjectio
 
     /**
      * Asserts the the given parameter forces its value to zero.
-     * This test is mostly for {@link AbstractMercator#LATITUDE_OF_ORIGIN}.
+     * This test is mostly for {@link Equirectangular#LATITUDE_OF_ORIGIN}.
      */
     private static void assertIsForcedToZero(final ParameterDescriptor<?> parameter) {
         final Double zero = Double.valueOf(0);

Added: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java?rev=1672065&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java (added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.referencing.operation.projection;
+
+import org.opengis.util.FactoryException;
+import org.apache.sis.parameter.Parameters;
+import org.apache.sis.internal.referencing.Formulas;
+import org.apache.sis.internal.referencing.provider.Equirectangular;
+import org.apache.sis.test.mock.MathTransformFactoryMock;
+import org.junit.Test;
+
+
+/**
+ * Tests the affine transform created by the {@link Equirectangular} class. This map projection is a
+ * special case since the transform is implemented by an affine transform instead than a class from
+ * the {@link org.apache.sis.referencing.operation.projection} package.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+public final strictfp class EquirectangularTest extends MapProjectionTestCase {
+    /**
+     * Initializes a simple Equirectangular projection on sphere.
+     */
+    private void initialize() throws FactoryException {
+        final Equirectangular provider = new Equirectangular();
+        final Parameters parameters = parameters(provider, false);
+        transform = new MathTransformFactoryMock(provider).createParameterizedTransform(parameters);
+        tolerance = Formulas.LINEAR_TOLERANCE;  // Not NORMALIZED_TOLERANCE since this is not a NormalizedProjection.
+        validate();
+    }
+
+    /**
+     * Tests the WKT formatting of an Equirectangular projection. While the projection is implemented by an
+     * affine transform, the WKT formatter should handle this projection in a special way and show the parameters.
+     *
+     * @throws FactoryException should never happen.
+     */
+    @Test
+    public void testWKT() throws FactoryException {
+        initialize();
+        assertWktEquals(
+                "PARAM_MT[“Equirectangular”,\n" +
+                "  PARAMETER[“semi_major”, 6371007.0],\n" +
+                "  PARAMETER[“semi_minor”, 6371007.0]]");
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -23,6 +23,7 @@ import org.opengis.test.referencing.Para
 import org.apache.sis.parameter.Parameters;
 import org.apache.sis.internal.referencing.provider.MapProjection;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.referencing.operation.DefaultOperationMethod;
 import org.apache.sis.referencing.operation.transform.MathTransformTestCase;
 import org.apache.sis.test.mock.MathTransformFactoryMock;
 import org.apache.sis.test.mock.GeodeticDatumMock;
@@ -38,6 +39,11 @@ import org.apache.sis.test.mock.Geodetic
  */
 strictfp class MapProjectionTestCase extends MathTransformTestCase {
     /**
+     * Tolerance level for comparing formulas on the unitary sphere or ellipsoid.
+     */
+    static final double NORMALIZED_TOLERANCE = 1E-12;
+
+    /**
      * Creates a new test case.
      */
     MapProjectionTestCase() {
@@ -50,7 +56,7 @@ strictfp class MapProjectionTestCase ext
      * @param  ellipse {@code false} for a sphere, or {@code true} for WGS84 ellipsoid.
      * @return The parameters to use for instantiating the projection.
      */
-    static Parameters parameters(final MapProjection provider, final boolean ellipse) {
+    static Parameters parameters(final DefaultOperationMethod provider, final boolean ellipse) {
         final Parameters parameters = Parameters.castOrWrap(provider.getParameters().createValue());
         final Ellipsoid ellipsoid = (ellipse ? GeodeticDatumMock.WGS84 : GeodeticDatumMock.SPHERE).getEllipsoid();
         parameters.parameter(Constants.SEMI_MAJOR).setValue(ellipsoid.getSemiMajorAxis());
@@ -73,12 +79,20 @@ strictfp class MapProjectionTestCase ext
      * This method uses arbitrary central meridian, scale factor, false easting and false northing for increasing
      * the chances to detect a mismatch.
      */
-    final void initialize(final MapProjection provider, final boolean ellipse) throws FactoryException {
+    final void initialize(final DefaultOperationMethod provider, final boolean ellipse,
+            final boolean hasStandardParallel, final boolean hasScaleFactor)
+            throws FactoryException
+    {
         final Parameters parameters = parameters(provider, ellipse);
         parameters.parameter(Constants.CENTRAL_MERIDIAN).setValue(0.5, NonSI.DEGREE_ANGLE);
-        parameters.parameter(Constants.SCALE_FACTOR)    .setValue(0.997);
         parameters.parameter(Constants.FALSE_EASTING)   .setValue(200);
         parameters.parameter(Constants.FALSE_NORTHING)  .setValue(100);
+        if (hasStandardParallel) {
+            parameters.parameter(Constants.STANDARD_PARALLEL_1).setValue(20);
+        }
+        if (hasScaleFactor) {
+            parameters.parameter(Constants.SCALE_FACTOR).setValue(0.997);
+        }
         transform = new MathTransformFactoryMock(provider).createParameterizedTransform(parameters);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -49,7 +49,7 @@ import static org.apache.sis.referencing
 @DependsOn(NormalizedProjectionTest.class)
 public final strictfp class MercatorTest extends MapProjectionTestCase {
     /**
-     * Returns a new instance of {@link Mercator} for an ellipsoid.
+     * Creates a new instance of {@link Mercator} for a sphere or an ellipsoid.
      *
      * @param ellipse {@code false} for a sphere, or {@code true} for WGS84 ellipsoid.
      */
@@ -59,7 +59,7 @@ public final strictfp class MercatorTest
         if (!ellipse) {
             transform = new Mercator.Spherical((Mercator) transform);
         }
-        tolerance = 1E-12;
+        tolerance = NORMALIZED_TOLERANCE;
         validate();
     }
 
@@ -273,7 +273,7 @@ public final strictfp class MercatorTest
         /*
          * For some random points, compare the result of spherical formulas with the ellipsoidal ones.
          */
-        initialize(new Mercator1SP(), false);
+        initialize(new Mercator1SP(), false, false, true);
         tolerance = Formulas.LINEAR_TOLERANCE;
         verifyInDomain(CoordinateDomain.GEOGRAPHIC_SAFE, 84018710);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -40,6 +40,8 @@ import static org.junit.Assert.*;
  * @module
  */
 @DependsOn({
+    // Following dependency is where the basic parameters (e.g. SEMI_MAJOR) are tested.
+    // Those parameters are needed by NoOp pseudo-projection, which is used in this class.
     org.apache.sis.internal.referencing.provider.MapProjectionTest.class
 })
 public final strictfp class NormalizedProjectionTest extends TransformTestCase {

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1672065&r1=1672064&r2=1672065&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Wed Apr  8 11:38:35 2015
@@ -100,6 +100,7 @@ import org.junit.BeforeClass;
 
     // Test map projections. Those tests need the providers tested above.
     org.apache.sis.referencing.operation.projection.NormalizedProjectionTest.class,
+    org.apache.sis.referencing.operation.projection.EquirectangularTest.class,
     org.apache.sis.referencing.operation.projection.MercatorTest.class,
 
     // Coordinate Reference System components.



Mime
View raw message