sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1672288 [1/3] - in /sis/trunk: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/m...
Date Thu, 09 Apr 2015 10:52:54 GMT
Author: desruisseaux
Date: Thu Apr  9 10:52:53 2015
New Revision: 1672288

URL: http://svn.apache.org/r1672288
Log:
Merge from the JDK6 branch: Equirectangular projection, and tuning of map projection parameters.

Added:
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
      - copied unchanged from r1672283, sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
      - copied unchanged from r1672283, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
      - copied unchanged from r1672283, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java
      - copied unchanged from r1672283, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
      - copied unchanged from r1672283, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
      - copied unchanged from r1672283, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
Removed:
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/mock/MatrixMock.java
Modified:
    sis/trunk/   (props changed)
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/EPSGName.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MillerCylindrical.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MatrixParameters.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MatrixParametersAlphaNum.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
    sis/trunk/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AffineTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/LongitudeRotationTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MapProjectionParametersTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorValuesTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderMock.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
    sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties
    sis/trunk/ide-project/NetBeans/nbproject/project.xml
    sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java

Propchange: sis/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr  9 10:52:53 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK6:1394364-1670490
-/sis/branches/JDK7:1394913-1670488
-/sis/branches/JDK8:1584960-1670486
+/sis/branches/JDK6:1394364-1672283
+/sis/branches/JDK7:1394913-1672280
+/sis/branches/JDK8:1584960-1672278

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] Thu Apr  9 10:52:53 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,19 @@ 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.
+     * @param  internal {@code true} if the formatting convention is {@code Convention.INTERNAL}.
+     * @return The given object converted to a {@code FormattableObject} instance, or {@code null}.
+     *
+     * @since 0.6
+     */
+    public abstract FormattableObject toFormattableObject(MathTransform object, boolean internal);
+
+    /**
      * 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/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ElementKind.java [UTF-8] Thu Apr  9 10:52:53 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/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -53,7 +53,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.CodeList;
 
 import org.apache.sis.measure.Units;
@@ -67,7 +66,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;
@@ -868,15 +866,10 @@ 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, convention == Convention.INTERNAL);
+                if (object != null) {
+                    append(object);
                 } else {
                     throw new UnformattableObjectException(Errors.format(
                             Errors.Keys.IllegalClass_2, FormattableObject.class, transform.getClass()));
@@ -886,46 +879,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.
      *
@@ -1246,8 +1199,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/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -417,7 +417,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/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -91,7 +91,7 @@ import org.apache.sis.internal.jdk7.Obje
  * found in Geographic Markup Language (GML) documents. Example:
  *
  * {@preformat xml
- *   <gml:identifier codeSpace="OGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
+ *   <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
  * }
  *
  * In Apache SIS, the GML {@code codeSpace} attribute - despite its name - is mapped to the identifier
@@ -456,7 +456,8 @@ public class ImmutableIdentifier extends
      * code space}, but not necessarily.
      *
      * <div class="note"><b>Example:</b> Coordinate Reference System (CRS) identified by an EPSG code will return
-     * {@link Citations#OGP}, since OGP is the organization maintaining the EPSG geodetic database.</div>
+     * contact information for the <cite>International Association of Oil &amp; Gas producers</cite> (IOGP), since
+     * IOGP is the organization maintaining the EPSG geodetic database.</div>
      *
      * @return The authority, or {@code null} if not available.
      */

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -71,7 +71,11 @@ public final class Citations extends Sta
      * @category Organization
      *
      * @since 0.4
+     *
+     * @deprecated The OGP organization is now known as IOGP. This citation will be removed in SIS 0.6
+     *             because of this name change and for avoiding confusion with {@link #EPSG} citation.
      */
+    @Deprecated
     public static final Citation OGP = new SimpleCitation("OGP");
 
     /**
@@ -81,12 +85,14 @@ public final class Citations extends Sta
      *
      * <div class="note"><b>Historical note:</b>
      * The EPSG acronym meaning was <cite>European Petroleum Survey Group</cite>.
-     * But this meaning does not apply anymore since the European and American associations merged
-     * into the <cite>International Association of Oil &amp; Gas producers</cite> (IOGP).
+     * But this meaning does not apply anymore since the European and American associations merged into
+     * the <a href="http://www.iogp.org">International Association of Oil &amp; Gas producers</a> (IOGP).
      * The legacy acronym now applies only to the database Coordinate Reference System definitions,
      * known as <cite>EPSG dataset</cite>.</div>
      *
-     * @see #OGP
+     * The citation {@linkplain DefaultCitation#getTitle() title} and contact information reference
+     * the IOGP organization, but the {@link IdentifierSpace#getName() namespace} is {@code "EPSG"}.
+     *
      * @see #AUTO
      * @see #AUTO2
      * @see #CRS
@@ -94,7 +100,7 @@ public final class Citations extends Sta
      *
      * @since 0.4
      */
-    public static final IdentifierSpace<Integer> EPSG = new Authority<Integer>(Constants.EPSG, Constants.EPSG);
+    public static final IdentifierSpace<Integer> EPSG = new Authority<Integer>(Constants.IOGP, Constants.EPSG);
 
     /**
      * The <a href="http://sis.apache.org">Apache SIS</a> project.
@@ -222,6 +228,14 @@ public final class Citations extends Sta
         if (title == null || ((title = CharSequences.trimWhitespaces(title)).isEmpty())) {
             return null;
         }
+        /*
+         * We perform a special check because it is our only IdentifierSpace having an namespace ("EPSG")
+         * that can not be inferred from the authority abbreviation ("IOGP"). We test this special case
+         * first because it is usually to be the most frequently used citation.
+         */
+        if (title.equalsIgnoreCase(Constants.EPSG)) {
+            return EPSG;
+        }
         for (final Citation citation : CITATIONS) {
             if (titleMatches(citation, title)) {
                 return citation;

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] Thu Apr  9 10:52:53 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/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -43,7 +43,10 @@ import static org.opengis.referencing.Re
  * @version 0.4
  * @module
  */
-@DependsOn(DefaultIdentifierTest.class)
+@DependsOn({
+    DefaultIdentifierTest.class,
+    org.apache.sis.metadata.iso.citation.CitationsTest.class
+})
 public final strictfp class ImmutableIdentifierTest extends TestCase {
     /**
      * Returns the properties map to be used in argument to test methods.
@@ -175,8 +178,8 @@ public final strictfp class ImmutableIde
      */
     @Test
     public void testWKT() {
-        final ImmutableIdentifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326", "8.2", null);
-        assertWktEquals(Convention.WKT2, "Id[“EPSG”, 4326, “8.2”, Citation[“OGP”]]", id);
+        final ImmutableIdentifier id = new ImmutableIdentifier(HardCodedCitations.IOGP, "EPSG", "4326", "8.2", null);
+        assertWktEquals(Convention.WKT2, "Id[“EPSG”, 4326, “8.2”, Citation[“IOGP”]]", id);
         assertWktEquals(Convention.WKT1, "AUTHORITY[“EPSG”, “4326”]", id);
     }
 }

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -51,7 +51,7 @@ public final strictfp class HardCodedCit
     public static final DefaultCitation OGC;
     static {
         final DefaultCitation c = new DefaultCitation("Open Geospatial consortium");
-        c.setAlternateTitles(singleton(new SimpleInternationalString("OGC")));
+        c.setAlternateTitles(singleton(new SimpleInternationalString(Constants.OGC)));
         c.setPresentationForms(singleton(PresentationForm.DOCUMENT_DIGITAL));
         c.setIdentifiers(singleton(new DefaultIdentifier(Constants.OGC)));
         c.freeze();
@@ -85,18 +85,18 @@ public final strictfp class HardCodedCit
     }
 
     /**
-     * The <a href="http://www.ogp.org.uk">International Association of Oil &amp; Gas Producers</a> organization.
+     * The <a href="http://www.iogp.org">International Association of Oil &amp; Gas Producers</a> organization.
      * This organization is responsible for maintainance of {@link #EPSG} database.
-     * An {@linkplain Citation#getAlternateTitles() alternate title} for this citation is "OGP"
+     * An {@linkplain Citation#getAlternateTitles() alternate title} for this citation is "IOGP"
      * (according ISO 19115, alternate titles often contain abbreviations).
      */
-    public static final DefaultCitation OGP;
+    public static final DefaultCitation IOGP;
     static {
         final DefaultCitation c = new DefaultCitation("International Association of Oil & Gas Producers");
-        c.setAlternateTitles(singleton(new SimpleInternationalString("OGP")));
-        c.setIdentifiers(singleton(new DefaultIdentifier("OGP")));
+        c.setAlternateTitles(singleton(new SimpleInternationalString(Constants.IOGP)));
+        c.setIdentifiers(singleton(new DefaultIdentifier(Constants.IOGP)));
         c.freeze();
-        OGP = c;
+        IOGP = c;
     }
 
     /**
@@ -130,7 +130,7 @@ public final strictfp class HardCodedCit
         r.setFunction(OnLineFunction.INFORMATION);
 
         final DefaultResponsibleParty p = new DefaultResponsibleParty(Role.PRINCIPAL_INVESTIGATOR);
-        p.setParties(singleton(new DefaultOrganisation(OGP.getTitle(), null, null, new DefaultContact(r))));
+        p.setParties(singleton(new DefaultOrganisation(IOGP.getTitle(), null, null, new DefaultContact(r))));
 
         final DefaultCitation c = new DefaultCitation("European Petroleum Survey Group");
         c.setAlternateTitles(singleton(new SimpleInternationalString("EPSG")));

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -65,6 +65,7 @@ import org.junit.BeforeClass;
     org.apache.sis.metadata.iso.citation.DefaultResponsibilityTest.class,
     org.apache.sis.metadata.iso.citation.DefaultCitationDateTest.class,
     org.apache.sis.metadata.iso.citation.DefaultCitationTest.class,
+    org.apache.sis.metadata.iso.citation.CitationsTest.class,
     org.apache.sis.metadata.iso.maintenance.DefaultScopeDescriptionTest.class,
     org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBoxTest.class,
     org.apache.sis.metadata.iso.extent.DefaultExtentTest.class,

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -48,11 +48,11 @@ import org.opengis.metadata.Identifier;
  * Some data producers put a URN instead than a simple code value, as in the example below:
  *
  * {@preformat xml
- *   <gml:identifier codeSpace="OGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
+ *   <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
  * }
  *
  * In such case this class takes the codespace as the {@linkplain Identifier#getAuthority() authority}
- * ("OGP" in above example), and the 3 last URI elements are parsed as the codespace, version (optional)
+ * ("IOGP" in above example), and the 3 last URI elements are parsed as the codespace, version (optional)
  * and code values respectively.
  *
  * @author  Guilhem Legal (Geomatys)

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] Thu Apr  9 10:52:53 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;
@@ -45,6 +46,8 @@ import org.apache.sis.referencing.Abstra
 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;
@@ -52,6 +55,7 @@ import org.apache.sis.metadata.iso.exten
 import org.apache.sis.metadata.iso.extent.DefaultSpatialTemporalExtent;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
 import org.apache.sis.internal.metadata.ReferencingServices;
+import org.apache.sis.internal.referencing.provider.Affine;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.Utilities;
@@ -62,7 +66,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 +77,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 +88,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 +99,41 @@ 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.
+     * @param  internal {@code true} if the formatting convention is {@code Convention.INTERNAL}.
+     * @return The given object converted to a {@code FormattableObject} instance, or {@code null}.
+     *
+     * @since 0.6
+     */
+    @Override
+    public FormattableObject toFormattableObject(final MathTransform object, boolean internal) {
+        Matrix matrix;
+        final ParameterValueGroup parameters;
+        if (internal && (matrix = MathTransforms.getMatrix(object)) != null) {
+            parameters = Affine.parameters(matrix);
+        } else if (object instanceof Parameterized) {
+            parameters = ((Parameterized) object).getParameterValues();
+        } else {
+            matrix = MathTransforms.getMatrix(object);
+            if (matrix == null) {
+                return null;
+            }
+            parameters = Affine.parameters(matrix);
+        }
+        return new FormattableObject() {
+            @Override
+            protected String formatTo(final Formatter formatter) {
+                WKTUtilities.appendParamMT(parameters, formatter);
+                return "Param_MT";
+            }
+        };
+    }
+
+    /**
      * 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/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] Thu Apr  9 10:52:53 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/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -20,7 +20,6 @@ import java.awt.geom.AffineTransform;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.referencing.operation.MathTransform;
-import org.apache.sis.parameter.Parameterized;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -56,9 +55,9 @@ public final class ParameterizedAffine e
     private static final long serialVersionUID = 906346920928432466L;
 
     /**
-     * An object capable to provide the parameters used for creating this transform.
+     * The (presumed immutable) parameters used for creating this transform.
      */
-    public final Parameterized parameters;
+    private final ParameterValueGroup parameters;
 
     /**
      * {@code true} if {@link #parameters} provides an accurate description of this transform, or
@@ -72,11 +71,11 @@ public final class ParameterizedAffine e
      * Creates a new transform from the given affine and parameters.
      *
      * @param transform    The affine transform to copy.
-     * @param parameters   The parameters to remember.
+     * @param parameters   The parameters to remember. It is caller's responsibility to provide an immutable instance.
      * @param isDefinitive {@code true} if {@code parameters} provides an accurate description of {@code transform}, or
      *                     {@code false} if the transform may be different than the one described by {@code parameters}.
      */
-    public ParameterizedAffine(final AffineTransform transform, final Parameterized parameters, final boolean isDefinitive) {
+    public ParameterizedAffine(final AffineTransform transform, final ParameterValueGroup parameters, final boolean isDefinitive) {
         super(transform);
         this.parameters   = parameters;
         this.isDefinitive = isDefinitive;
@@ -106,7 +105,7 @@ public final class ParameterizedAffine e
      */
     @Override
     public ParameterDescriptorGroup getParameterDescriptors() {
-        return isDefinitive ? parameters.getParameterDescriptors() : super.getParameterDescriptors();
+        return isDefinitive ? parameters.getDescriptor() : super.getParameterDescriptors();
     }
 
     /**
@@ -117,7 +116,7 @@ public final class ParameterizedAffine e
      */
     @Override
     public ParameterValueGroup getParameterValues() {
-        return isDefinitive ? parameters.getParameterValues() : super.getParameterValues();
+        return isDefinitive ? parameters : super.getParameterValues();
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -110,7 +110,7 @@ abstract class AbstractProvider extends
      * Creates the parameter builder with the default namespace set to EPSG.
      */
     static ParameterBuilder builder() {
-        return new ParameterBuilder().setCodeSpace(Citations.OGP, Constants.EPSG).setRequired(true);
+        return new ParameterBuilder().setCodeSpace(Citations.EPSG, Constants.EPSG).setRequired(true);
     }
 
     /**
@@ -121,7 +121,7 @@ abstract class AbstractProvider extends
     }
 
     /**
-     * Creates a descriptor for a latitude parameter in degrees.
+     * Creates a descriptor for a latitude parameter in degrees with a default value of 0°.
      */
     static ParameterDescriptor<Double> createLatitude(final ParameterBuilder builder, final boolean includePoles) {
         return builder.createBounded(MeasurementRange.create(
@@ -131,7 +131,7 @@ abstract class AbstractProvider extends
     }
 
     /**
-     * Creates a descriptor for a longitude parameter in degrees.
+     * Creates a descriptor for a longitude parameter in degrees with a default value of 0°.
      */
     static ParameterDescriptor<Double> createLongitude(final ParameterBuilder builder) {
         return builder.createBounded(MeasurementRange.create(

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/EPSGName.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/EPSGName.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/EPSGName.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/EPSGName.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -76,7 +76,7 @@ public final class EPSGName {  // TODO:
      * @return An EPSG name or alias for the given string.
      */
     public static NamedIdentifier create(final String code) {
-        return new NamedIdentifier(Citations.OGP, Constants.EPSG, code, VERSION, REMARKS);
+        return new NamedIdentifier(Citations.EPSG, Constants.EPSG, code, VERSION, REMARKS);
     }
 
     /**
@@ -86,7 +86,7 @@ public final class EPSGName {  // TODO:
      * @return The EPSG identifier for the given numerical value.
      */
     public static Identifier identifier(final int code) {
-        return new ImmutableIdentifier(Citations.OGP, Constants.EPSG, String.valueOf(code).intern(), VERSION, REMARKS);
+        return new ImmutableIdentifier(Citations.EPSG, Constants.EPSG, String.valueOf(code).intern(), VERSION, REMARKS);
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -42,10 +42,14 @@ import org.apache.sis.metadata.iso.citat
 import org.apache.sis.parameter.DefaultParameterDescriptor;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.parameter.Parameters;
+import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.Messages;
 
 import static org.opengis.metadata.Identifier.AUTHORITY_KEY;
 
+// Branch-dependent imports
+import org.apache.sis.internal.jdk7.Objects;
+
 
 /**
  * Base class for all map projection providers defined in this package. This base class defines some descriptors
@@ -124,6 +128,57 @@ public abstract class MapProjection exte
     }
 
     /**
+     * Gets a parameter value identified by the given descriptor and stores it in the {@code context}.
+     * This method performs the following actions:
+     *
+     * <ul>
+     *   <li>Convert the value to the units specified by the descriptor.</li>
+     *   <li>Ensure that the value is contained in the range specified by the descriptor.</li>
+     *   <li>Store the value only if different than the default value.</li>
+     * </ul>
+     *
+     * This method should be invoked at {@link #createMathTransform(MathTransformFactory, ParameterValueGroup)}
+     * execution time only.
+     *
+     * @param  source     The parameters from which to read the value.
+     * @param  target     Where to store the parameter values.
+     * @param  descriptor The descriptor that specify the parameter names and desired units.
+     * @return The parameter value in the units given by the descriptor.
+     * @throws IllegalArgumentException if the given value is out of bounds.
+     */
+    public static double getAndStore(final Parameters source, final ParameterValueGroup target,
+            final ParameterDescriptor<Double> descriptor) throws IllegalArgumentException
+    {
+        final double value = source.doubleValue(descriptor);    // Apply a unit conversion if needed.
+        if (Double.isNaN(value) || Double.isInfinite(value)) {
+            throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalParameterValue_2,
+                    descriptor.getName(), value));
+        }
+        final Comparable<Double> min = descriptor.getMinimumValue();
+        final Comparable<Double> max = descriptor.getMaximumValue();
+        if (!Objects.equals(min, max)) {
+            /*
+             * RATIONAL: why we do not check the bounds if (min == max):
+             * The only case when our descriptor have (min == max) is when a parameter can only be zero,
+             * because of the way the map projection is defined (see e.g. Mercator1SP.LATITUDE_OF_ORIGIN).
+             * But in some cases, it would be possible to deal with non-zero values, even if in principle
+             * we should not. In such case we let the caller decides.
+             */
+            if ((min instanceof Number && !(value >= ((Number) min).doubleValue())) ||
+                (max instanceof Number && !(value <= ((Number) max).doubleValue())))
+            {
+                throw new IllegalArgumentException(Errors.format(Errors.Keys.ValueOutOfRange_4,
+                        descriptor.getName(), min, max, value));
+            }
+        }
+        final Double defaultValue = descriptor.getDefaultValue();
+        if (defaultValue == null || !defaultValue.equals(value)) {
+            target.parameter(descriptor.getName().getCode()).setValue(value);
+        }
+        return value;
+    }
+
+    /**
      * Creates a map projection from the specified group of parameter values.
      *
      * @param  factory The factory to use for creating and concatenating the (de)normalization transforms.
@@ -173,14 +228,6 @@ public abstract class MapProjection exte
     }
 
     /**
-     * Copies the EPSG name and identifier from the given parameter into the builder.
-     * The EPSG objects are presumed the first name and identifier (this is not verified).
-     */
-    static ParameterBuilder onlyEPSG(final ParameterDescriptor<?> source, final ParameterBuilder builder) {
-        return builder.addIdentifier(source.getIdentifiers().iterator().next()).addName(source.getName());
-    }
-
-    /**
      * Copies all names except the EPSG one from the given parameter into the builder.
      * The EPSG name is presumed the first name and identifier (this is not verified).
      */
@@ -192,33 +239,11 @@ public abstract class MapProjection exte
     }
 
     /**
-     * Copies the names and identifiers from the given parameter into the builder.
-     * The given {@code esri} and {@code netcdf} parameters will be inserted after the OGC name.
-     */
-    static ParameterBuilder withEsriAndNetcdf(final ParameterDescriptor<?> source, final ParameterBuilder builder,
-            final String esri, final String netcdf)
-    {
-        for (final ReferenceIdentifier identifier : source.getIdentifiers()) {
-            builder.addIdentifier(identifier);
-        }
-        builder.addName(source.getName());
-        for (final GenericName alias : source.getAlias()) {
-            builder.addName(alias);
-            if (((Identifier) alias).getAuthority() == Citations.OGC) {
-                builder.addName(Citations.ESRI,   esri)
-                       .addName(Citations.NETCDF, netcdf);
-            }
-        }
-        return builder;
-    }
-
-    /**
      * Creates a remarks for parameters that are not formally EPSG parameter.
      *
      * @param origin The name of the projection for where the parameter is formally used.
-     * @param usedIn The name of the projection where we also use that parameter.
      */
-    static InternationalString notFormalParameter(final String origin, final String usedIn) {
-        return Messages.formatInternational(Messages.Keys.NotFormalProjectionParameter_2, origin, usedIn);
+    static InternationalString notFormalParameter(final String origin) {
+        return Messages.formatInternational(Messages.Keys.NotFormalProjectionParameter_1, origin);
     }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -18,19 +18,14 @@ package org.apache.sis.internal.referenc
 
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.referencing.operation.CylindricalProjection;
-import org.apache.sis.parameter.Parameters;
+import org.apache.sis.internal.util.Constants;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.referencing.operation.projection.Mercator;
-import org.apache.sis.referencing.operation.projection.NormalizedProjection;
-import org.apache.sis.util.resources.Messages;
 
 
 /**
- * The provider for <cite>"Mercator (variant A)"</cite> projection
- * (EPSG:9804, EPSG:1026, <span class="deprecated">EPSG:9841</span>).
- * EPSG defines two codes for this projection, 1026 being the spherical case and 9804 the ellipsoidal case.
+ * The provider for <cite>"Mercator (variant A)"</cite> projection (EPSG:9804).
+ * EPSG defines two projections with the same parameters, 1026 being the spherical case and 9804 the ellipsoidal case.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Rueben Schulz (UBC)
@@ -40,104 +35,65 @@ import org.apache.sis.util.resources.Mes
  *
  * @see <a href="http://www.remotesensing.org/geotiff/proj_list/mercator_1sp.html">Mercator 1SP on RemoteSensing.org</a>
  */
-public final class Mercator1SP extends MapProjection {
+public final class Mercator1SP extends AbstractMercator {
     /**
      * For cross-version compatibility.
      */
     private static final long serialVersionUID = -5886510621481710072L;
 
-    /**
-     * The name of this projection method.
+    /*
+     * ACCESS POLICY: Only formal EPSG parameters shall be public.
+     * Parameters that we add ourselves should be package-privated.
      */
-    static final String NAME = "Mercator (variant A)";
 
     /**
      * The operation parameter descriptor for the <cite>Latitude of natural origin</cite> (φ₀) parameter value.
-     * Valid values range is (-90 … 90)° and default value is 0°.
-     *
-     * <p>In theory, this parameter should not be used and its value should be 0 in all cases.
-     * This parameter is included in the EPSG dataset for completeness in CRS labelling only.</p>
+     * In theory, this parameter should not be used and its value should be 0 in all cases.
+     * This parameter is included in the EPSG dataset for completeness in CRS labelling only.
      */
-    static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
+    public static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
 
     /**
      * The operation parameter descriptor for the <cite>Longitude of natural origin</cite> (λ₀) parameter value.
      * Valid values range is [-180 … 180]° and default value is 0°.
      */
-    static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
+    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
 
     /**
      * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k₀) parameter value.
      * Valid values range is (0 … ∞) and default value is 1.
      */
-    static final ParameterDescriptor<Double> SCALE_FACTOR;
-
-    /**
-     * The operation parameter descriptor for the <cite>False easting</cite> (FE) parameter value.
-     * Valid values range is unrestricted and default value is 0 metre.
-     */
-    static final ParameterDescriptor<Double> FALSE_EASTING;
-
-    /**
-     * The operation parameter descriptor for the <cite>False northing</cite> (FN) parameter value.
-     * Valid values range is unrestricted and default value is 0 metre.
-     */
-    static final ParameterDescriptor<Double> FALSE_NORTHING;
+    public static final ParameterDescriptor<Double> SCALE_FACTOR;
 
     /**
      * The group of all parameters expected by this coordinate operation.
      */
-    public static final ParameterDescriptorGroup PARAMETERS;
+    static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
+        LATITUDE_OF_ORIGIN = createConstant(builder.addNamesAndIdentifiers(Equirectangular.LATITUDE_OF_ORIGIN)
+                .rename(Citations.GEOTIFF, "NatOriginLat")
+                .setRemarks(Equirectangular.LATITUDE_OF_ORIGIN.getRemarks()), 0.0);
 
-        LATITUDE_OF_ORIGIN = createConstant(builder
-                .addIdentifier("8801")
-                .addName("Latitude of natural origin")
-                .addName(Citations.OGC,     "latitude_of_origin")
-                .addName(Citations.GEOTIFF, "NatOriginLat")
-                .addName(Citations.PROJ4,   "lat_0")
-                .setRemarks(Messages.format(Messages.Keys.ConstantProjParameterValue_1, 0)), 0.0);
-
-        CENTRAL_MERIDIAN = createLongitude(builder
-                .addIdentifier("8802")
-                .addName("Longitude of natural origin")
-                .addName(Citations.OGC,     "central_meridian")
-                .addName(Citations.GEOTIFF, "NatOriginLong")
-                .addName(Citations.PROJ4,   "lon_0"));
+        CENTRAL_MERIDIAN = createLongitude(builder.addNamesAndIdentifiers(Equirectangular.CENTRAL_MERIDIAN)
+                .rename(Citations.GEOTIFF, "NatOriginLong"));
 
         SCALE_FACTOR = createScale(builder
                 .addIdentifier("8805")
                 .addName("Scale factor at natural origin")
-                .addName(Citations.OGC,     "scale_factor")
+                .addName(Citations.OGC,     Constants.SCALE_FACTOR)
+                .addName(Citations.ESRI,    "Scale_Factor")
+                .addName(Citations.NETCDF,  "scale_factor_at_projection_origin")
                 .addName(Citations.GEOTIFF, "ScaleAtNatOrigin")
                 .addName(Citations.PROJ4,   "k"));
 
-        FALSE_EASTING = createShift(builder
-                .addIdentifier("8806")
-                .addName("False easting")
-                .addName(Citations.OGC,     "false_easting")
-                .addName(Citations.GEOTIFF, "FalseEasting")
-                .addName(Citations.PROJ4,   "x_0"));
-
-        FALSE_NORTHING = createShift(builder
-                .addIdentifier("8807")
-                .addName("False northing")
-                .addName(Citations.OGC,     "false_northing")
-                .addName(Citations.GEOTIFF, "FalseNorthing")
-                .addName(Citations.PROJ4,   "y_0"));
-
         PARAMETERS = builder
-            .addIdentifier(             "9804")                                                   // The ellipsoidal case
-            .addIdentifier(             "1026")                                                   // The spherical case
-            .addDeprecatedIdentifier(   "9841", "1026")                                           // The spherical (1SP) case
-            .addName(NAME            /* "Mercator (variant A)" */)                                // Starting from EPSG version 7.6
-            .addName(                   "Mercator (Spherical)")                                   // Starting from EPSG version 7.6
-            .addName(                   "Mercator (1SP)")                                         // Prior to EPSG version 7.6
-            .addDeprecatedName(         "Mercator (1SP) (Spherical)", "Mercator (Spherical)")     // Prior to EPSG version 7.6
-            .addName(Citations.OGC,     "Mercator_1SP")
-            .addName(Citations.GEOTIFF, "CT_Mercator")
-            .addName(Citations.PROJ4,   "merc")
+            .addIdentifier(              "9804")                        // The ellipsoidal case
+            .addName(                    "Mercator (variant A)")        // Starting from EPSG version 7.6
+            .addName(                    "Mercator (1SP)")              // Prior to EPSG version 7.6
+            .addName(Citations.OGC,      "Mercator_1SP")
+            .addName(Citations.GEOTIFF,  "CT_Mercator")
+            .addName(Citations.PROJ4,    "merc")
             .addIdentifier(Citations.GEOTIFF,   "7")
             .addIdentifier(Citations.MAP_INFO, "10")    // MapInfo names this projection "Mercator".
             .createGroupForMapProjection(
@@ -154,24 +110,4 @@ public final class Mercator1SP extends M
     public Mercator1SP() {
         super(PARAMETERS);
     }
-
-    /**
-     * Returns the operation type for this map projection.
-     *
-     * @return {@code CylindricalProjection.class}
-     */
-    @Override
-    public Class<CylindricalProjection> getOperationType() {
-        return CylindricalProjection.class;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return The map projection created from the given parameter values.
-     */
-    @Override
-    protected NormalizedProjection createProjection(final Parameters parameters) {
-        return new Mercator(this, parameters);
-    }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -18,17 +18,14 @@ package org.apache.sis.internal.referenc
 
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.referencing.operation.CylindricalProjection;
-import org.apache.sis.parameter.Parameters;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.referencing.operation.projection.Mercator;
-import org.apache.sis.referencing.operation.projection.NormalizedProjection;
 
 
 /**
  * The provider for "<cite>Mercator (variant B)</cite>" projection (EPSG:9805).
- * This provider reuses many of the parameters defined in {@link Mercator1SP}.
+ *
+ * <p>This provider reuses some of the parameters defined in {@link Mercator2SP}.</p>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Rueben Schulz (UBC)
@@ -38,93 +35,70 @@ import org.apache.sis.referencing.operat
  *
  * @see <a href="http://www.remotesensing.org/geotiff/proj_list/mercator_2sp.html">Mercator 2SP on RemoteSensing.org</a>
  */
-public final class Mercator2SP extends MapProjection {
+public final class Mercator2SP extends AbstractMercator {
     /**
      * For cross-version compatibility.
      */
     private static final long serialVersionUID = 6356028352681135786L;
 
+    /*
+     * ACCESS POLICY: Only formal EPSG parameters shall be public.
+     * Parameters that we add ourselves should be package-privated.
+     */
+
     /**
      * The operation parameter descriptor for the <cite>Latitude of 1st standard parallel</cite> (φ₁) parameter value.
      * Valid values range is (-90 … 90)° and default value is 0°.
      */
-    public static final ParameterDescriptor<Double> STANDARD_PARALLEL;
+    public static final ParameterDescriptor<Double> STANDARD_PARALLEL = Equirectangular.STANDARD_PARALLEL;
 
     /**
      * The operation parameter descriptor for the <cite>Latitude of natural origin</cite> (φ₀) parameter value.
-     * Valid values range is (-90 … 90)° and default value is 0°.
+     * In theory, this parameter should not be used and its value should be 0 in all cases.
+     * This parameter is included in the EPSG dataset for completeness in CRS labelling only.
      *
-     * <p>This parameter is taken from {@link Mercator1SP}. It is not formally a parameter from the {@code Mercator2SP}
-     * projection. Nevertheless we take is as an optional parameter because it is sometime used in Well Known Text.</p>
-     *
-     * <p>In theory, this parameter should not be used and its value should be 0 in all cases.
-     * This parameter is included in the EPSG dataset for completeness in CRS labelling only.</p>
+     * <p>This parameter is used by {@link Mercator1SP} and is not formally a parameter of {@link Mercator2SP}
+     * projections. Nevertheless we declare it is as an optional parameter because it is sometime used in Well
+     * Known Text (WKT).</p>
      */
-    public static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
+    static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
 
     /**
      * The operation parameter descriptor for the <cite>Longitude of natural origin</cite> (λ₀) parameter value.
      * Valid values range is [-180 … 180]° and default value is 0°.
      */
-    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
+    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN = Mercator1SP.CENTRAL_MERIDIAN;
 
     /**
-     * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k₀) parameter value.
-     * Valid values range is (0 … ∞) and default value is 1.
+     * The operation parameter descriptor for the <cite>Scale factor</cite> (not necessarily at natural origin)
+     * parameter value. Valid values range is (0 … ∞) and default value is 1.
      *
-     * <p>This parameter is taken from {@link Mercator1SP}. It is not formally a parameter from the {@code Mercator2SP}
-     * projection. Nevertheless we take is as an optional parameter because it is sometime used in Well Known Text.</p>
+     * <p>This parameter is used by {@link Mercator1SP} and is not formally a parameter of {@link Mercator2SP}
+     * projections. Nevertheless we declare it is as an optional parameter because it is sometime used in Well
+     * Known Text (WKT). However it shall be interpreted as a <cite>Scale factor at the standard parallel</cite>
+     * rather than at the natural origin.</p>
      */
-    public static final ParameterDescriptor<Double> SCALE_FACTOR;
-
-    /**
-     * The operation parameter descriptor for the <cite>False easting</cite> (FE) parameter value.
-     * Valid values range is unrestricted and default value is 0 metre.
-     */
-    public static final ParameterDescriptor<Double> FALSE_EASTING;
-
-    /**
-     * The operation parameter descriptor for the <cite>False northing</cite> (FN) parameter value.
-     * Valid values range is unrestricted and default value is 0 metre.
-     */
-    public static final ParameterDescriptor<Double> FALSE_NORTHING;
+    static final ParameterDescriptor<Double> SCALE_FACTOR;
 
     /**
      * The group of all parameters expected by this coordinate operation.
      */
-    public static final ParameterDescriptorGroup PARAMETERS;
+    static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
-
-        STANDARD_PARALLEL = createLatitude(builder
-                .addIdentifier("8823")
-                .addName("Latitude of 1st standard parallel")
-                .addName(Citations.OGC,     "standard_parallel_1")
-                .addName(Citations.ESRI,    "Standard_Parallel_1")
-                .addName(Citations.NETCDF,  "standard_parallel")
-                .addName(Citations.GEOTIFF, "StdParallel1")
-                .addName(Citations.PROJ4,   "lat_1"), false);
-
-        CENTRAL_MERIDIAN = createLongitude(withEsriAndNetcdf(Mercator1SP.CENTRAL_MERIDIAN,
-                builder, "Central_Meridian", "longitude_of_projection_origin"));
-
-        FALSE_EASTING = createShift(withEsriAndNetcdf(Mercator1SP.FALSE_EASTING,
-                builder, "False_Easting", "false_easting"));
-
-        FALSE_NORTHING = createShift(withEsriAndNetcdf(Mercator1SP.FALSE_NORTHING,
-                builder, "False_Northing", "false_northing"));
         /*
-         * "Latitude of natural origin" and "Scale factor" are not formally parameters
-         * of the "Mercator (variant B)" projection according EPSG. But we declare them
-         * as optional parameters because they are sometime used.
+         * "Latitude of natural origin" and "Scale factor" are not formally parameters of the "Mercator (variant B)"
+         * projection according EPSG. But we declare them as optional parameters because they are sometime used.
+         * However we remove the EPSG name and identifier at least for the scale factor, because its meaning does
+         * not fit well in this context. The EPSG name is "Scale factor at natural origin" while actually the scale
+         * factor applied here would rather at the standard parallel.
          */
-        LATITUDE_OF_ORIGIN = createConstant(withEsriAndNetcdf(Mercator1SP.LATITUDE_OF_ORIGIN, builder,
-                "Latitude_Of_Origin", "latitude_of_projection_origin").setRequired(false)
+        builder.setRequired(false); // Will apply to all remaining parameters.
+        LATITUDE_OF_ORIGIN = createConstant(exceptEPSG(Mercator1SP.LATITUDE_OF_ORIGIN, builder)
                 .setRemarks(Mercator1SP.LATITUDE_OF_ORIGIN.getRemarks()), 0.0);
 
-        SCALE_FACTOR = createScale(withEsriAndNetcdf(Mercator1SP.SCALE_FACTOR, builder,
-                "Scale_Factor", "scale_factor_at_projection_origin")
-                .setRemarks(notFormalParameter(Mercator1SP.NAME, "Mercator (variant B)")));
+        SCALE_FACTOR = createScale(exceptEPSG(Mercator1SP.SCALE_FACTOR, builder)
+                .setRemarks(notFormalParameter("Mercator (variant A)")));
 
         PARAMETERS = builder
             .addIdentifier(             "9805")
@@ -133,15 +107,14 @@ public final class Mercator2SP extends M
             .addName(Citations.OGC,     "Mercator_2SP")
             .addName(Citations.ESRI,    "Mercator")
             .addName(Citations.NETCDF,  "Mercator")
-            .addName(sameNameAs(Citations.GEOTIFF, Mercator1SP.PARAMETERS))
-            .addName(sameNameAs(Citations.PROJ4,   Mercator1SP.PARAMETERS))
+            .addName(sameNameAs(Citations.PROJ4, Mercator1SP.PARAMETERS))
             .addIdentifier(Citations.MAP_INFO, "26")    // MapInfo names this projection "Regional Mercator".
             .addIdentifier(Citations.S57,       "8")
             .createGroupForMapProjection(
                     STANDARD_PARALLEL,
-                    LATITUDE_OF_ORIGIN,
+                    LATITUDE_OF_ORIGIN,     // Not formally a Mercator2SP parameter.
                     CENTRAL_MERIDIAN,
-                    SCALE_FACTOR,
+                    SCALE_FACTOR,           // Not formally a Mercator2SP parameter.
                     FALSE_EASTING,
                     FALSE_NORTHING);
     }
@@ -152,24 +125,4 @@ public final class Mercator2SP extends M
     public Mercator2SP() {
         super(PARAMETERS);
     }
-
-    /**
-     * Returns the operation type for this map projection.
-     *
-     * @return {@code CylindricalProjection.class}
-     */
-    @Override
-    public Class<CylindricalProjection> getOperationType() {
-        return CylindricalProjection.class;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return The map projection created from the given parameter values.
-     */
-    @Override
-    protected NormalizedProjection createProjection(final Parameters parameters) {
-        return new Mercator(this, parameters);
-    }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MillerCylindrical.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MillerCylindrical.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MillerCylindrical.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MillerCylindrical.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -16,16 +16,10 @@
  */
 package org.apache.sis.internal.referencing.provider;
 
-import org.opengis.util.InternationalString;
-import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.referencing.operation.CylindricalProjection;
 import org.apache.sis.internal.util.Constants;
-import org.apache.sis.parameter.Parameters;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.referencing.operation.projection.Mercator;
-import org.apache.sis.referencing.operation.projection.NormalizedProjection;
 
 
 /**
@@ -57,7 +51,7 @@ import org.apache.sis.referencing.operat
  *
  * @see <a href="http://www.remotesensing.org/geotiff/proj_list/miller_cylindrical.html">Miller Cylindrical on RemoteSensing.org</a>
  */
-public final class MillerCylindrical extends MapProjection {
+public final class MillerCylindrical extends AbstractMercator {
     /**
      * For cross-version compatibility.
      */
@@ -71,46 +65,16 @@ public final class MillerCylindrical ext
     /**
      * The group of all parameters expected by this coordinate operation.
      */
-    public static final ParameterDescriptorGroup PARAMETERS;
+    private static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder().setCodeSpace(Citations.OGC, Constants.OGC);
-        /*
-         * The remotesensing.org web page said that OGC parameter name should be "longitude_of_center" and
-         * GeoTIFF parameter name should be "ProjCenterLong", but the common practice that we found with a
-         * quick search on the web seems to be the same parameter name than other Mercator projections. So
-         * we keep the later for now. Same argument apply to the latitude of origin parameter.
-         */
-        final ParameterDescriptor<?> centralMeridian = createLongitude(
-                exceptEPSG(Mercator1SP.CENTRAL_MERIDIAN, builder));
-
-        final ParameterDescriptor<?> falseEasting = createShift(
-                exceptEPSG(Mercator1SP.FALSE_EASTING, builder));
-
-        final ParameterDescriptor<?> falseNorthing = createShift(exceptEPSG(
-                Mercator1SP.FALSE_NORTHING, builder));
-        /*
-         * The "latitude of origin" and the "scale factor" are not formally a parameter of the "Miller Cylindrical"
-         * projection. But we declare them as an optional parameters because they are sometime used.
-         */
-        final InternationalString remarks = notFormalParameter(Mercator1SP.NAME, "Miller Cylindrical");
-        final ParameterDescriptor<?> scaleFactor = createScale(exceptEPSG(Mercator1SP.SCALE_FACTOR, builder)
-                .setRemarks(remarks).setRequired(false));
-
-        final ParameterDescriptor<?> latitudeOfOrigin = createLatitude(
-                exceptEPSG(Mercator1SP.LATITUDE_OF_ORIGIN, builder).setRemarks(remarks), false);
-
         PARAMETERS = builder
             .addName      (NAME)
             .addName      (Citations.GEOTIFF,  "CT_MillerCylindrical")
             .addIdentifier(Citations.GEOTIFF,  "20")
             .addName      (Citations.PROJ4,    "mill")
             .addIdentifier(Citations.MAP_INFO, "11")
-            .createGroupForMapProjection(
-                    latitudeOfOrigin,
-                    centralMeridian,
-                    scaleFactor, // Not an official parameter, provided for compatibility with those who still use it.
-                    falseEasting,
-                    falseNorthing);
+            .createGroupForMapProjection(toArray(MercatorSpherical.PARAMETERS.descriptors()));
     }
 
     /**
@@ -119,24 +83,4 @@ public final class MillerCylindrical ext
     public MillerCylindrical() {
         super(PARAMETERS);
     }
-
-    /**
-     * Returns the operation type for this map projection.
-     *
-     * @return {@code CylindricalProjection.class}
-     */
-    @Override
-    public Class<CylindricalProjection> getOperationType() {
-        return CylindricalProjection.class;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return The map projection created from the given parameter values.
-     */
-    @Override
-    protected NormalizedProjection createProjection(final Parameters parameters) {
-        return new Mercator(this, parameters);
-    }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -16,14 +16,8 @@
  */
 package org.apache.sis.internal.referencing.provider;
 
-import org.opengis.util.InternationalString;
-import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.referencing.operation.CylindricalProjection;
-import org.apache.sis.parameter.Parameters;
 import org.apache.sis.parameter.ParameterBuilder;
-import org.apache.sis.referencing.operation.projection.Mercator;
-import org.apache.sis.referencing.operation.projection.NormalizedProjection;
 
 
 /**
@@ -36,7 +30,7 @@ import org.apache.sis.referencing.operat
  * @version 0.6
  * @module
  */
-public final class PseudoMercator extends MapProjection {
+public final class PseudoMercator extends AbstractMercator {
     /**
      * For cross-version compatibility.
      */
@@ -48,40 +42,20 @@ public final class PseudoMercator extend
     public static final String NAME = "Popular Visualisation Pseudo Mercator";
 
     /**
+     * The EPSG identifier, to be preferred to the name when available.
+     */
+    public static final String IDENTIFIER = "1024";
+
+    /**
      * The group of all parameters expected by this coordinate operation.
      */
     public static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
-
-        final ParameterDescriptor<?> latitudeOfOrigin = createLatitude(
-                onlyEPSG(Mercator1SP.LATITUDE_OF_ORIGIN, builder), false);
-
-        final ParameterDescriptor<?> centralMeridian = createLongitude(
-                onlyEPSG(Mercator1SP.CENTRAL_MERIDIAN, builder));
-
-        final ParameterDescriptor<?> falseEasting = createShift(
-                onlyEPSG(Mercator1SP.FALSE_EASTING, builder));
-
-        final ParameterDescriptor<?> falseNorthing = createShift(
-                onlyEPSG(Mercator1SP.FALSE_NORTHING, builder));
-        /*
-         * The scale factor is not formally a parameter of the "Popular Visualisation Pseudo Mercator" projection
-         * according EPSG. But we declare it as an optional parameters because it is sometime used.
-         */
-        final InternationalString remarks = notFormalParameter(Mercator1SP.NAME, "Pseudo Mercator");
-        final ParameterDescriptor<?> scaleFactor = createScale(withEsriAndNetcdf(Mercator1SP.SCALE_FACTOR, builder,
-                "Scale_Factor", "scale_factor_at_projection_origin").setRemarks(remarks).setRequired(false));
-
         PARAMETERS = builder
-            .addIdentifier("1024")
+            .addIdentifier(IDENTIFIER)
             .addName(NAME)
-            .createGroupForMapProjection(
-                    latitudeOfOrigin,
-                    centralMeridian,
-                    scaleFactor, // Not an official parameter, provided for compatibility with those who still use it.
-                    falseEasting,
-                    falseNorthing);
+            .createGroupForMapProjection(toArray(MercatorSpherical.PARAMETERS.descriptors()));
     }
 
     /**
@@ -90,24 +64,4 @@ public final class PseudoMercator extend
     public PseudoMercator() {
         super(PARAMETERS);
     }
-
-    /**
-     * Returns the operation type for this map projection.
-     *
-     * @return {@code CylindricalProjection.class}
-     */
-    @Override
-    public Class<CylindricalProjection> getOperationType() {
-        return CylindricalProjection.class;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return The map projection created from the given parameter values.
-     */
-    @Override
-    protected NormalizedProjection createProjection(final Parameters parameters) {
-        return new Mercator(this, parameters);
-    }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -54,7 +54,7 @@ import static org.apache.sis.util.Utilit
  *         public static final ParameterDescriptorGroup PARAMETERS;
  *         static {
  *             ParameterBuilder builder = new ParameterBuilder();
- *             builder.setCodeSpace(Citations.OGP, "EPSG").setRequired(true);
+ *             builder.setCodeSpace(Citations.EPSG, "EPSG").setRequired(true);
  *             ParameterDescriptor<?>[] parameters = {
  *                 builder.addName("Latitude of natural origin")    .createBounded( -80,  +84, 0, NonSI.DEGREE_ANGLE),
  *                 builder.addName("Longitude of natural origin")   .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE),

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -131,6 +131,16 @@ public class DefaultParameterValueGroup
     }
 
     /**
+     * Conservatively returns {@code false} if this instance is for a subclass, because we do not know if the
+     * subclass overrides {@link #parameter(String)} in a way incompatible with {@link #parameterIfExist(String)}.
+     * (note: using {@code Class.getMethod(…).getDeclaringClass()} is presumed not worth the cost.
+     */
+    @Override
+    boolean isKnownImplementation() {
+        return getClass() == DefaultParameterValueGroup.class;
+    }
+
+    /**
      * Returns the abstract definition of this group of parameters.
      *
      * @return The abstract definition of this group of parameters.
@@ -202,6 +212,7 @@ public class DefaultParameterValueGroup
      */
     @Override
     public ParameterValue<?> parameter(final String name) throws ParameterNotFoundException {
+        ArgumentChecks.ensureNonNull("name", name);
         ParameterValue<?> value = parameterIfExist(name);
         if (value == null) {
             /*
@@ -229,10 +240,11 @@ public class DefaultParameterValueGroup
     /**
      * Returns the value in this group for the specified name if it exists, or {@code null} if none.
      * This method does not create any new {@code ParameterValue} instance.
+     *
+     * @see #isKnownImplementation()
      */
     @Override
-    final ParameterValue<?> parameterIfExist(final String name) throws ParameterNotFoundException {
-        ArgumentChecks.ensureNonNull("name", name);
+    ParameterValue<?> parameterIfExist(final String name) throws ParameterNotFoundException {
         final ParameterValueList values = this.values; // Protect against accidental changes.
         /*
          * Quick search for an exact match. By invoking 'descriptor(i)' instead of 'get(i)',

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java?rev=1672288&r1=1672287&r2=1672288&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java [UTF-8] Thu Apr  9 10:52:53 2015
@@ -77,6 +77,16 @@ final class MapProjectionParameters exte
     }
 
     /**
+     * Returns {@code true} since the {@link #parameterIfExist(String)} method below is compatible with
+     * {@link #parameter(String)}. Note that we would need to revisit this condition if this class was
+     * no longer final.
+     */
+    @Override
+    boolean isKnownImplementation() {
+        return true;
+    }
+
+    /**
      * Returns the value in this group for the specified name. If the given name is one of the
      * "invisible" parameters, returns a dynamic parameter view without adding it to the list
      * of real parameter values.
@@ -86,7 +96,7 @@ final class MapProjectionParameters exte
      * @throws ParameterNotFoundException if there is no parameter value for the given name.
      */
     @Override
-    public ParameterValue<?> parameter(final String name) throws ParameterNotFoundException {
+    ParameterValue<?> parameterIfExist(final String name) throws ParameterNotFoundException {
         if (MapProjectionDescriptor.isHeuristicMatchForName(name, MapProjectionDescriptor.EARTH_RADIUS)) {
             ParameterValue<?> value = earthRadius;
             if (value == null) {
@@ -116,7 +126,7 @@ final class MapProjectionParameters exte
                 return value;
             }
         }
-        return super.parameter(name);
+        return super.parameterIfExist(name);
     }
 
 



Mime
View raw message