sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1654882 [1/2] - 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/citation/ core/sis-metad...
Date Mon, 26 Jan 2015 19:48:50 GMT
Author: desruisseaux
Date: Mon Jan 26 19:48:49 2015
New Revision: 1654882

URL: http://svn.apache.org/r1654882
Log:
Merge from the JDK6 branch.

Added:
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java
      - copied, changed from r1654875, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/
      - copied from r1654875, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/
      - copied from r1654875, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/OperationMethodsTest.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/OperationMethodsTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultFormulaTest.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultFormulaTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java
      - copied, changed from r1654875, sis/branches/JDK6/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/builder/
      - copied from r1654875, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/builder/
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
      - copied, changed from r1654875, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/CompoundDirectPositions.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/CompoundDirectPositions.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/Line.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/Line.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/Plane.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/Plane.java
    sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/LineTest.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/LineTest.java
    sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/PlaneTest.java
      - copied unchanged from r1654875, sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/PlaneTest.java
Removed:
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/provider/
Modified:
    sis/trunk/   (props changed)
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
    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/Convention.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/citation/Citations.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.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/MetadataStandardTest.java
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
    sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.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/MetadataAssert.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/HardCoded.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.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/referencing/AbstractIdentifiedObject.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.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/ConcatenatedTransform.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CopyTransform.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/IdentityTransform.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ProjectiveTransform.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/DefaultParameterValueGroupTest.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/ParametersTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.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/geoapi/temporal/Instant.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/geoapi/temporal/TemporalFactory.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/package-info.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Characters.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
    sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
    sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java
    sis/trunk/src/main/javadoc/stylesheet.css

Propchange: sis/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 26 19:48:49 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK6:1394364-1652025
-/sis/branches/JDK7:1394913-1652022
-/sis/branches/JDK8:1584960-1652019
+/sis/branches/JDK6:1394364-1654875
+/sis/branches/JDK7:1394913-1654869
+/sis/branches/JDK8:1584960-1654866

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -27,6 +27,9 @@ import org.apache.sis.internal.jaxb.Cont
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.ArgumentChecks;
 
+// Branch-dependent imports
+import org.apache.sis.internal.jdk7.Objects;
+
 
 /**
  * An adapter for collections of a legacy type replaced by an other collection.
@@ -319,4 +322,46 @@ public abstract class LegacyPropertyAdap
             }
         };
     }
+
+    /**
+     * Compares this collection with the given object for equality. This method performs comparisons only with
+     * instances of {@code LegacyPropertyAdapter}, and returns {@code false} for all other kinds of collection.
+     * We do <strong>not</strong> compare with arbitrary collection implementations.
+     *
+     * <p><b>Rational:</b> {@link Collection#equals(Object)} contract explicitely forbids comparisons with
+     * {@code List} and {@code Set}. The rational explained in {@code Collection} javadoc applies also to
+     * other kind of {@code Collection} implementations: we can not enforce {@code Collection.equals(Object)}
+     * to be symmetric in such cases.</p>
+     *
+     * @param  other The other object to compare with this collection, or {@code null}.
+     * @return {@code true} if the objects are equal, or {@code false} otherwise.
+     */
+    @Override
+    public final boolean equals(final Object other) {
+        if (!(other instanceof LegacyPropertyAdapter<?,?>)) {
+            return false;
+        }
+        final Iterator<?> ot = ((LegacyPropertyAdapter<?,?>) other).iterator();
+        final Iterator<L> it = iterator();
+        while (it.hasNext()) {
+            if (!ot.hasNext() || !Objects.equals(it.next(), ot.next())) {
+                return false;
+            }
+        }
+        return !ot.hasNext();
+    }
+
+    /**
+     * Returns a hash code value for this collection.
+     *
+     * @return A hash code value calculated from the content of this collection.
+     */
+    @Override
+    public final int hashCode() {
+        int code = 0;
+        for (final L element : this) {
+            code = code*31 + Objects.hashCode(element);
+        }
+        return code;
+    }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -23,6 +23,7 @@ import org.opengis.referencing.crs.*;
 import org.opengis.referencing.datum.*;
 import org.opengis.referencing.operation.*;
 import org.apache.sis.util.Static;
+import org.apache.sis.internal.util.Citations;
 
 
 /**
@@ -90,7 +91,7 @@ public final class NameMeaning extends S
      * @return {@code true} if the given code space is known to use the URN syntax.
      */
     public static boolean usesURN(final String codeSpace) {
-        return (codeSpace != null) && codeSpace.equalsIgnoreCase("EPSG");
+        return (codeSpace != null) && codeSpace.equalsIgnoreCase(Citations.EPSG);
     }
 
     /**

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -38,6 +38,9 @@ import org.apache.sis.util.resources.Err
  * This class searches for the {@link org.apache.sis.internal.referencing.ServicesForMetadata}
  * implementation using Java reflection.
  *
+ * <p>This class also opportunistically defines some constants related to "referencing by coordinates"
+ * but needed by metadata.</p>
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.18)
  * @version 0.5
@@ -45,12 +48,13 @@ import org.apache.sis.util.resources.Err
  */
 public abstract class ReferencingServices extends SystemListener {
     /**
-     * The length of one nautical mile, in metres.
+     * The length of one nautical mile, which is {@value} metres.
      */
     public static final double NAUTICAL_MILE = 1852;
 
     /**
-     * The GRS80 {@linkplain org.apache.sis.referencing.datum.DefaultEllipsoid#getAuthalicRadius() authalic radius}.
+     * The GRS80 {@linkplain org.apache.sis.referencing.datum.DefaultEllipsoid#getAuthalicRadius() authalic radius},
+     * which is {@value} metres.
      */
     public static final double AUTHALIC_RADIUS = 6371007;
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -55,7 +55,7 @@ import org.apache.sis.metadata.iso.citat
 public enum Convention {
     /**
      * The ISO 19162 format, also known as “WKT 2”.
-     * This convention follows the ISO recommendations except the following ones:
+     * This convention follows the ISO recommendations with the following exceptions:
      *
      * <ul>
      *   <li>{@code Axis} element omits the {@code Order} sub-element.</li>
@@ -144,6 +144,7 @@ public enum Convention {
      * with the following differences:
      *
      * <ul>
+     *   <li>All quoted texts (not only the remarks) preserve non-ASCII characters.</li>
      *   <li>Map projections are shown as SIS stores them internally, i.e. with the separation between
      *       linear and non-linear steps, rather than as a single operation.</li>
      *   <li>{@code CompoundCRS} shows nested compound CRS if any (the structure is not flattened).</li>
@@ -155,8 +156,8 @@ public enum Convention {
      *       not only CRS or coordinate operations.</li>
      *   <li>Additional attributes not defined by ISO 19162 may be formatted:
      *     <ul>
-     *       <li>{@code ImageDatum} includes the {@link org.apache.sis.referencing.datum.DefaultImageDatum#getPixelInCell() Pixel in Cell} code.</li>
-     *       <li>{@code TemporalDatum} includes the {@link org.apache.sis.referencing.datum.DefaultTemporalDatum#getOrigin() Origin} date.</li>
+     *       <li>{@code ImageDatum} includes the {@linkplain org.apache.sis.referencing.datum.DefaultImageDatum#getPixelInCell() Pixel in Cell} code.</li>
+     *       <li>{@code TemporalDatum} includes the {@linkplain org.apache.sis.referencing.datum.DefaultTemporalDatum#getOrigin() Origin} date.</li>
      *     </ul>
      *   </li>
      * </ul>

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -114,6 +114,10 @@ public enum ElementKind {
     /**
      * {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#getRemarks() Remarks},
      * often represented by {@code REMARKS[…]} elements.
+     *
+     * <p>When formatting an ISO 19162 Well Known Text, texts quoted as remarks preserve non-ASCII characters.
+     * By contrast, quoted texts in any other {@code ElementKind} will have some non-ASCII characters replaced
+     * by ASCII ones (e.g. "é" → "e").</p>
      */
     REMARKS,
 

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -169,6 +169,12 @@ public class Formatter implements Locali
     private Citation authority;
 
     /**
+     * {@code true} for preserving non-ASCII characters. The default value is {@code false},
+     * which causes replacements like "é" → "e" in all elements except {@code REMARKS["…"]}.
+     */
+    boolean isNonAsciiAllowed;
+
+    /**
      * The enclosing WKT element being formatted.
      *
      * @see #getEnclosingElement(int)
@@ -373,11 +379,12 @@ public class Formatter implements Locali
     final void configure(Convention convention, final Citation authority, final Colors colors,
             final boolean toUpperCase, final byte indentation)
     {
-        this.convention  = convention;
-        this.authority   = (authority != null) ? authority : convention.getNameAuthority();
-        this.colors      = colors;
-        this.toUpperCase = toUpperCase;
-        this.indentation = indentation;
+        this.convention   = convention;
+        this.authority    = (authority != null) ? authority : convention.getNameAuthority();
+        this.colors       = colors;
+        this.toUpperCase  = toUpperCase;
+        this.indentation  = indentation;
+        isNonAsciiAllowed = (convention == Convention.INTERNAL);
     }
 
     /**
@@ -860,7 +867,8 @@ public class Formatter implements Locali
                 final Matrix matrix = ReferencingServices.getInstance().getMatrix(transform);
                 if (matrix != null) {
                     openElement(true, "Param_MT");
-                    quote("Affine");
+                    buffer.appendCodePoint(symbols.getOpeningQuote(0)).append("Affine")
+                          .appendCodePoint(symbols.getClosingQuote(0));
                     indent(+1);
                     append(matrix);
                     indent(-1);
@@ -891,7 +899,7 @@ public class Formatter implements Locali
         boolean columns = false;
         do {
             openElement(true, "Parameter");
-            quote(columns ? "num_col" : "num_row");
+            buffer.appendCodePoint(openQuote).append(columns ? "num_col" : "num_row").appendCodePoint(closeQuote);
             append(columns ? numCol : numRow);
             closeElement(false);
         } while ((columns = !columns) == true);
@@ -933,9 +941,7 @@ public class Formatter implements Locali
             final String localized = CharSequences.trimWhitespaces(text.toString(locale));
             if (localized != null && !localized.isEmpty()) {
                 openElement(true, keyword);
-                setColor(type);
-                quote(localized);
-                resetColor();
+                quote(localized, type);
                 closeElement(true);
             }
         }
@@ -951,9 +957,7 @@ public class Formatter implements Locali
     public void append(final String text, final ElementKind type) {
         if (text != null) {
             appendSeparator();
-            setColor(type);
-            quote(text);
-            resetColor();
+            quote(text, type);
         }
     }
 
@@ -962,10 +966,16 @@ public class Formatter implements Locali
      * that character will be doubled (WKT 2) or deleted (WKT 1). We check for the closing quote only because
      * it is the character that the parser will look for determining the text end.
      */
-    private void quote(final String text) {
+    private void quote(final String text, final ElementKind type) {
+        setColor(type);
         final int base = buffer.appendCodePoint(symbols.getOpeningQuote(0)).length();
-        buffer.append(text);
+        if (isNonAsciiAllowed || (type == ElementKind.REMARKS)) {
+            buffer.append(text);
+        } else {
+            buffer.append(CharSequences.toASCII(text));
+        }
         closeQuote(base);
+        resetColor();
     }
 
     /**

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -78,7 +78,7 @@ import org.apache.sis.util.resources.Err
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Rémi Eve (IRD)
  * @since   0.4 (derived from geotk-3.20)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public class WKTFormat extends CompoundFormat<Object> {
@@ -150,6 +150,12 @@ public class WKTFormat extends CompoundF
     private KeywordCase keywordCase;
 
     /**
+     * {@code true} for preserving non-ASCII characters. The default value is {@code false},
+     * which causes replacements like "é" → "e" in all elements except {@code REMARKS["…"]}.
+     */
+    private boolean isNonAsciiAllowed;
+
+    /**
      * The amount of spaces to use in indentation, or {@value #SINGLE_LINE} if indentation is disabled.
      * The same value is also stored in the {@linkplain #formatter}.
      * It appears here for serialization purpose.
@@ -201,6 +207,34 @@ public class WKTFormat extends CompoundF
     }
 
     /**
+     * Returns whether non-ASCII characters are preserved. The default value is {@code false},
+     * which causes replacements like "é" → "e" in all elements except {@link ElementKind#REMARKS}.
+     *
+     * <p>This value is always {@code true} when the WKT {@linkplain #getConvention() convention}
+     * is set to {@link Convention#INTERNAL}.</p>
+     *
+     * @return Whether non-ASCII characters are preserved.
+     *
+     * @since 0.5
+     */
+    public boolean isNonAsciiAllowed() {
+        return isNonAsciiAllowed || (convention == Convention.INTERNAL);
+    }
+
+    /**
+     * Sets whether non-ASCII characters shall be preserved. The default value is {@code false},
+     * which causes replacements like "é" → "e" in all elements except {@link ElementKind#REMARKS}.
+     * Setting this property to {@code true} will disable such replacements.
+     *
+     * @param allowed Whether non-ASCII characters shall be preserved.
+     *
+     * @since 0.5
+     */
+    public void setNonAsciiAllowed(final boolean allowed) {
+        isNonAsciiAllowed = allowed;
+    }
+
+    /**
      * Returns whether WKT keywords should be written with upper cases or camel cases.
      *
      * @return The case to use for formatting keywords.
@@ -330,6 +364,7 @@ public class WKTFormat extends CompoundF
                 default: toUpperCase = (convention.majorVersion() == 1); break;
             }
             formatter.configure(convention, authority, colors, toUpperCase, indentation);
+            formatter.isNonAsciiAllowed |= isNonAsciiAllowed;
         }
     }
 

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -18,9 +18,10 @@ package org.apache.sis.metadata.iso.cita
 
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.util.Static;
+import org.apache.sis.util.CharSequences;
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.internal.simple.SimpleCitation;
-import org.apache.sis.util.CharSequences;
+import org.apache.sis.metadata.iso.DefaultIdentifier; // For javadoc
 
 
 /**
@@ -37,7 +38,7 @@ import org.apache.sis.util.CharSequences
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3 (derived from geotk-2.2)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final class Citations extends Static {
@@ -125,11 +126,17 @@ public final class Citations extends Sta
     public static final IdentifierSpace<String> PROJ4 = new Authority<String>("Proj.4", "PROJ4");
 
     /**
-     * The <a href="http://www.epsg.org">European Petroleum Survey Group</a> authority.
-     * This citation is used as an authority for
+     * The <a href="http://www.epsg.org">EPSG</a> dataset. This citation is used as an authority for
      * {@linkplain org.opengis.referencing.crs.CoordinateReferenceSystem coordinate reference system}
      * identifiers.
      *
+     * <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).
+     * The legacy acronym now applies only to the database Coordinate Reference System definitions,
+     * known as <cite>EPSG dataset</cite>.</div>
+     *
      * @see #OGP
      * @see #AUTO
      * @see #AUTO2
@@ -138,7 +145,9 @@ public final class Citations extends Sta
      *
      * @since 0.4
      */
-    public static final IdentifierSpace<Integer> EPSG = new Authority<Integer>("EPSG", "EPSG");
+    public static final IdentifierSpace<Integer> EPSG = new Authority<Integer>(
+            org.apache.sis.internal.util.Citations.EPSG,
+            org.apache.sis.internal.util.Citations.EPSG);
 
     /**
      * <cite>International Standard Book Number</cite> (ISBN) defined by ISO-2108.
@@ -180,8 +189,8 @@ public final class Citations extends Sta
      *
      * <ul>
      *   <li>If the given title is {@code null} or empty (ignoring spaces), then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given name matches a {@linkplain Citation#getTitle() title} or an
-     *       {@linkplain Citation#getAlternateTitles() alternate titles} of one of the pre-defined
+     *   <li>Otherwise if the given name matches a {@linkplain DefaultCitation#getTitle() title} or an
+     *       {@linkplain DefaultCitation#getAlternateTitles() alternate titles} of one of the pre-defined
      *       constants ({@link #EPSG}, {@link #GEOTIFF}, <i>etc.</i>), then that constant is returned.</li>
      *   <li>Otherwise, a new citation is created with the specified name as the title.</li>
      * </ul>
@@ -202,8 +211,8 @@ public final class Citations extends Sta
     }
 
     /**
-     * Returns {@code true} if at least one {@linkplain Citation#getTitle() title} or
-     * {@linkplain Citation#getAlternateTitles() alternate title} in {@code c1} is leniently
+     * Returns {@code true} if at least one {@linkplain DefaultCitation#getTitle() title} or
+     * {@linkplain DefaultCitation#getAlternateTitles() alternate title} in {@code c1} is leniently
      * equal to a title or alternate title in {@code c2}. The comparison is case-insensitive
      * and ignores every character which is not a {@linkplain Character#isLetterOrDigit(int)
      * letter or a digit}. The titles ordering is not significant.
@@ -218,8 +227,8 @@ public final class Citations extends Sta
     }
 
     /**
-     * Returns {@code true} if the {@linkplain Citation#getTitle() title} or any
-     * {@linkplain Citation#getAlternateTitles() alternate title} in the given citation
+     * Returns {@code true} if the {@linkplain DefaultCitation#getTitle() title} or any
+     * {@linkplain DefaultCitation#getAlternateTitles() alternate title} in the given citation
      * matches the given string. The comparison is case-insensitive and ignores every character
      * which is not a {@linkplain Character#isLetterOrDigit(int) letter or a digit}.
      *
@@ -233,42 +242,49 @@ public final class Citations extends Sta
     }
 
     /**
-     * Returns {@code true} if at least one {@linkplain Citation#getIdentifiers() identifier} in
-     * {@code c1} is equal to an identifier in {@code c2}. The comparison is case-insensitive
-     * and ignores every character which is not a {@linkplain Character#isLetterOrDigit(int)
-     * letter or a digit}. The identifier ordering is not significant.
+     * Returns {@code true} if at least one {@linkplain DefaultCitation#getIdentifiers() identifier}
+     * {@linkplain DefaultIdentifier#getCode() code} in {@code c1} is equal to an identifier code in
+     * {@code c2}. {@linkplain DefaultIdentifier#getCodeSpace() Code spaces} are compared only if
+     * provided in the two identifiers being compared. Comparisons are case-insensitive and ignores
+     * every character which is not a {@linkplain Character#isLetterOrDigit(int) letter or a digit}.
+     * The identifier ordering is not significant.
      *
      * <p>If (and <em>only</em> if) the citations do not contains any identifier, then this method
      * fallback on titles comparison using the {@link #titleMatches(Citation,Citation) titleMatches}
      * method. This fallback exists for compatibility with client codes using the citation
-     * {@linkplain Citation#getTitle() titles} without identifiers.</p>
+     * {@linkplain DefaultCitation#getTitle() titles} without identifiers.</p>
      *
      * @param  c1 The first citation to compare, or {@code null}.
      * @param  c2 the second citation to compare, or {@code null}.
      * @return {@code true} if both arguments are non-null, and at least one identifier,
      *         title or alternate title matches.
+     *
+     * @see org.apache.sis.referencing.IdentifierMatching
      */
     public static boolean identifierMatches(final Citation c1, final Citation c2) {
         return org.apache.sis.internal.util.Citations.identifierMatches(c1, c2);
     }
 
     /**
-     * Returns {@code true} if any {@linkplain Citation#getIdentifiers() identifiers} in the given
-     * citation matches the given string. The comparison is case-insensitive and ignores every
-     * character which is not a {@linkplain Character#isLetterOrDigit(int) letter or a digit}.
+     * Returns {@code true} if at least one {@linkplain DefaultCitation#getIdentifiers() identifier}
+     * in the given citation have a {@linkplain DefaultIdentifier#getCode() code} matching the given
+     * string. The comparison is case-insensitive and ignores every character which is not a
+     * {@linkplain Character#isLetterOrDigit(int) letter or a digit}.
      *
      * <p>If (and <em>only</em> if) the citation does not contain any identifier, then this method
      * fallback on titles comparison using the {@link #titleMatches(Citation,String) titleMatches}
      * method. This fallback exists for compatibility with client codes using citation
-     * {@linkplain Citation#getTitle() titles} without identifiers.</p>
+     * {@linkplain DefaultCitation#getTitle() title} without identifiers.</p>
      *
      * @param  citation The citation to check for, or {@code null}.
      * @param  identifier The identifier to compare, or {@code null}.
      * @return {@code true} if both arguments are non-null, and the title or alternate title
      *         matches the given string.
+     *
+     * @see org.apache.sis.referencing.IdentifierMatching
      */
     public static boolean identifierMatches(final Citation citation, final String identifier) {
-        return org.apache.sis.internal.util.Citations.identifierMatches(citation, identifier);
+        return org.apache.sis.internal.util.Citations.identifierMatches(citation, null, identifier);
     }
 
     /**
@@ -278,14 +294,14 @@ public final class Citations extends Sta
      *
      * <ul>
      *   <li>If the given citation is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the citation contains at least one {@linkplain Citation#getIdentifiers() identifier}, then:
+     *   <li>Otherwise if the citation contains at least one {@linkplain DefaultCitation#getIdentifiers() identifier}, then:
      *     <ul>
      *       <li>If at least one identifier is a {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier
      *           unicode identifier}, then the shortest of those identifiers is returned.</li>
      *       <li>Otherwise the shortest identifier is returned, despite not being a Unicode identifier.</li>
      *     </ul></li>
-     *   <li>Otherwise if the citation contains at least one {@linkplain Citation#getTitle() title} or
-     *       {@linkplain Citation#getAlternateTitles() alternate title}, then:
+     *   <li>Otherwise if the citation contains at least one {@linkplain DefaultCitation#getTitle() title} or
+     *       {@linkplain DefaultCitation#getAlternateTitles() alternate title}, then:
      *     <ul>
      *       <li>If at least one title is a {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier
      *           unicode identifier}, then the shortest of those titles is returned.</li>

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -168,7 +168,7 @@ public class DefaultTemporalExtent exten
         } else {
             return null;
         }
-        return instant.getPosition().getDate();
+        return instant.getDate();
     }
 
     /**

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -55,6 +55,22 @@ public final strictfp class FormatterTes
     }
 
     /**
+     * Tests (indirectly) {@link Formatter#quote(String)}.
+     */
+    @Test
+    public void testQuote() {
+        assertWktEquals(Convention.WKT2,
+                "“A “quote”” to double”",               // Expect doubling quotes.
+                 "A “quote” to double");
+        assertWktEquals(Convention.WKT2,
+                "“Nouvelle Triangulation Francaise”",   // Expect replacement of non-latin characters.
+                 "Nouvelle Triangulation Française");
+        assertWktEquals(Convention.INTERNAL,
+                "“Nouvelle Triangulation Française”",   // Non-latin characters shall be preserved in internal mode.
+                 "Nouvelle Triangulation Française");
+    }
+
+    /**
      * Tests (indirectly) {@link Formatter#append(GeographicBoundingBox, int)}.
      */
     @Test

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -38,7 +38,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static java.util.Collections.singleton;
-import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
@@ -248,7 +248,7 @@ public final strictfp class MetadataStan
         assertEquals("title", "European Petroleum Survey Group", map.get("getTitle").toString());
         final Object identifiers = map.get("identifiers");
         assertInstanceOf("identifiers", Collection.class, identifiers);
-        HardCodedCitations.assertIdentifiersFor("EPSG", (Collection<?>) identifiers);
+        assertContainsIdentifierCode("EPSG", (Collection<?>) identifiers);
     }
 
     /**

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -64,7 +64,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static java.util.Collections.singleton;
-import static org.opengis.test.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 import static org.apache.sis.metadata.PropertyAccessor.APPEND;
 import static org.apache.sis.metadata.PropertyAccessor.RETURN_NULL;
@@ -294,7 +294,7 @@ public final strictfp class PropertyAcce
         // Collection of Identifiers
         final Object identifiers = accessor.get(accessor.indexOf("identifiers", true), instance);
         assertInstanceOf("identifiers", Collection.class, identifiers);
-        HardCodedCitations.assertIdentifiersFor("ISO", (Collection<?>) identifiers);
+        assertContainsIdentifierCode("ISO", (Collection<?>) identifiers);
     }
 
     /**
@@ -608,7 +608,7 @@ public final strictfp class PropertyAcce
         assertInstanceOf("identifiers", Collection.class, target);
         assertNotSame("Distinct objects shall have distinct collections.", source, target);
         assertEquals ("The two collections shall have the same content.",  source, target);
-        HardCodedCitations.assertIdentifiersFor("EPSG", (Collection<?>) target);
+        assertContainsIdentifierCode("EPSG", (Collection<?>) target);
 
         // Set the identifiers to null, which should clear the collection.
         assertEquals("Expected the previous value.", source, accessor.set(index, citation, null, RETURN_PREVIOUS));

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -237,7 +237,9 @@ public final strictfp class DefaultMetad
         final DefaultMetadata metadata = new DefaultMetadata();
         assertTrue("hierarchyLevelNames", metadata.getHierarchyLevelNames().isEmpty());
         assertTrue("hierarchyLevels",     metadata.getHierarchyLevels().isEmpty());
-
+        /*
+         * Tests the setter and verify immediately with the getter methods.
+         */
         metadata.setHierarchyLevelNames(Arrays.asList(names));
         metadata.setHierarchyLevels(Arrays.asList(levels));
         assertArrayEquals("hierarchyLevelNames", names,  metadata.getHierarchyLevelNames().toArray());
@@ -254,7 +256,7 @@ public final strictfp class DefaultMetad
         assertEquals("metadataScopes[1].name", "Golden Gate Bridge", scope.getName().toString());
         assertEquals("metadataScopes[1].resourceScope", ScopeCode.FEATURE, scope.getResourceScope());
         /*
-         * Changes in the MetadataScope object shall be relfected immediately on the scope collection.
+         * Changes in the MetadataScope object shall be reflected immediately on the scope collection.
          * Verify that.
          */
         it.remove();
@@ -265,6 +267,17 @@ public final strictfp class DefaultMetad
         assertTrue(scopes.add(c));
         assertArrayEquals("hierarchyLevelNames", names,  metadata.getHierarchyLevelNames().toArray());
         assertArrayEquals("hierarchyLevels",     levels, metadata.getHierarchyLevels().toArray());
+        /*
+         * Test the customized equals(Object) and hashCode() implementations.
+         * Note: the 'assertNotSame' check is not a contract requirement. It is just that if
+         * 'n1' and 'n2' are the same, then the test become pointless and should be removed.
+         */
+        Collection<String> n1 = metadata.getHierarchyLevelNames();
+        Collection<String> n2 = metadata.getHierarchyLevelNames();
+        assertNotSame("Remove this test.", n1, n2); // See above comment.
+        assertTrue("equals", n1.equals(n2));
+        assertTrue("equals", n2.equals(n1));
+        assertEquals("hashCode", n1.hashCode(), n2.hashCode());
     }
 
     /**

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=1654882&r1=1654881&r2=1654882&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] Mon Jan 26 19:48:49 2015
@@ -17,8 +17,6 @@
 package org.apache.sis.metadata.iso.citation;
 
 import java.net.URI;
-import java.util.Collection;
-import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.OnLineFunction;
@@ -27,7 +25,6 @@ import org.apache.sis.metadata.iso.Defau
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.util.Static;
 
-import static org.opengis.test.Assert.*;
 import static java.util.Collections.singleton;
 
 
@@ -40,7 +37,7 @@ import static java.util.Collections.sing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class HardCodedCitations extends Static {
@@ -169,23 +166,4 @@ public final strictfp class HardCodedCit
      */
     private HardCodedCitations() {
     }
-
-    /**
-     * Asserts that the given {@linkplain Identifier#getCode() identifier code}
-     * is found in the collection of identifiers.
-     *
-     * @param expected The expected identifier code (typically {@code "ISO"} or {@code "EPSG"}).
-     * @param identifiers The collection to validate. Should be a collection of {@link Identifier}.
-     */
-    public static void assertIdentifiersFor(final String expected, final Collection<?> identifiers) {
-        assertNotNull("identifiers", identifiers);
-        int count = 0;
-        for (final Object id : identifiers) {
-            assertInstanceOf("identifier", Identifier.class, id);
-            if (((Identifier) id).getCode().equals(expected)) {
-                count++;
-            }
-        }
-        assertEquals("Unexpected amount of identifiers.", 1, count);
-    }
 }

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -16,10 +16,14 @@
  */
 package org.apache.sis.test;
 
+import java.util.Collection;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.IdentifiedObject;
+import org.opengis.referencing.ReferenceIdentifier;
 import org.apache.sis.io.wkt.Symbols;
 import org.apache.sis.io.wkt.WKTFormat;
 import org.apache.sis.io.wkt.Convention;
+import org.apache.sis.internal.util.Citations;
 
 
 /**
@@ -28,7 +32,7 @@ import org.apache.sis.io.wkt.Convention;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4 (derived from geotk-3.00)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public strictfp class MetadataAssert extends Assert {
@@ -51,6 +55,44 @@ public strictfp class MetadataAssert ext
     }
 
     /**
+     * Asserts that the given identifier has the expected code and the {@code "EPSG"} code space.
+     * The authority is expected to have the {@code "OGP"} title or alternate title.
+     *
+     * @param expected   The expected identifier code.
+     * @param identifier The identifier to verify.
+     *
+     * @since 0.5
+     */
+    public static void assertEpsgIdentifierEquals(final String expected, final Identifier identifier) {
+        assertNotNull(identifier);
+        assertEquals("code",      expected, identifier.getCode());
+        assertEquals("codeSpace", Citations.EPSG, (identifier instanceof ReferenceIdentifier) ? ((ReferenceIdentifier) identifier).getCodeSpace() : null);
+        assertEquals("authority", "OGP",  Citations.getIdentifier(identifier.getAuthority()));
+    }
+
+    /**
+     * Asserts that the given collection contains exactly one identifier with the given
+     * {@linkplain Identifier#getCode() code}. The {@linkplain Identifier#getCodeSpace()
+     * code space} and authority are ignored.
+     *
+     * @param expected The expected identifier code (typically {@code "ISO"} or {@code "EPSG"}).
+     * @param identifiers The collection to validate. Should be a collection of {@link Identifier}.
+     *
+     * @since 0.5
+     */
+    public static void assertContainsIdentifierCode(final String expected, final Collection<?> identifiers) {
+        assertNotNull("identifiers", identifiers);
+        int count = 0;
+        for (final Object id : identifiers) {
+            assertInstanceOf("identifier", Identifier.class, id);
+            if (((Identifier) id).getCode().equals(expected)) {
+                count++;
+            }
+        }
+        assertEquals("Unexpected amount of identifiers.", 1, count);
+    }
+
+    /**
      * Asserts that the WKT 2 of the given object is equal to the expected one.
      * This method expected the {@code “…”} quotation marks instead of {@code "…"}
      * for easier readability of {@link String} constants in Java code.

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/HardCoded.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/HardCoded.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/HardCoded.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/HardCoded.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.referencing;
 
 import org.apache.sis.util.Static;
+import org.apache.sis.internal.util.Citations;
 
 
 /**
@@ -31,7 +32,7 @@ public final class HardCoded extends Sta
     /**
      * The {@value} code space.
      */
-    public static final String EPSG = "EPSG";
+    public static final String EPSG = Citations.EPSG;
 
     /**
      * The {@value} code space.

Copied: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java (from r1654875, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java?p2=sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java&p1=sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java&r1=1654875&r2=1654882&rev=1654882&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -19,6 +19,7 @@ package org.apache.sis.internal.referenc
 import java.util.Map;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
+import org.opengis.referencing.ReferenceIdentifier;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.OperationMethod;
@@ -70,7 +71,7 @@ public final class OperationMethods exte
             boolean hasFound = false;
             for (final Identifier identifier : id1) {
                 final Citation authority = identifier.getAuthority();
-                final String   codeSpace = identifier.getCodeSpace();
+                final String   codeSpace = (identifier instanceof ReferenceIdentifier) ? ((ReferenceIdentifier) identifier).getCodeSpace() : null;
                 for (final Identifier other : id2) {
                     if (authorityMatches(identifier, authority, codeSpace)) {
                         if (CharSequences.equalsFiltered(identifier.getCode(), other.getCode(), Characters.Filter.UNICODE_IDENTIFIER, true)) {
@@ -105,7 +106,7 @@ public final class OperationMethods exte
             }
         }
         if (codeSpace != null) {
-            final String other = identifier.getCodeSpace();
+            final String other = (identifier instanceof ReferenceIdentifier) ? ((ReferenceIdentifier) identifier).getCodeSpace() : null;
             if (other != null) {
                 return CharSequences.equalsFiltered(codeSpace, other, Characters.Filter.UNICODE_IDENTIFIER, true);
             }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -31,7 +31,7 @@ import org.apache.sis.parameter.TensorPa
 import org.apache.sis.referencing.operation.matrix.Matrix2;
 import org.apache.sis.referencing.operation.matrix.AffineTransforms2D;
 import org.apache.sis.referencing.operation.transform.LinearTransform;
-import org.apache.sis.referencing.operation.provider.Affine;
+import org.apache.sis.internal.referencing.provider.Affine;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.LenientComparable;
 import org.apache.sis.util.ComparisonMode;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -563,6 +563,7 @@ public class ParameterFormat extends Tab
                 new TableAppender(out, columnSeparator) : new TableAppender(out);
         table.setMultiLinesCells(true);
         table.nextLine(horizontalBorder);
+        int numColumnsBeforeValue = 0;
         for (int i=0; ; i++) {
             boolean end = false;
             final short key;
@@ -601,6 +602,7 @@ public class ParameterFormat extends Tab
             }
             if (end) break;
             nextColumn(table);
+            numColumnsBeforeValue++;
         }
         table.nextLine();
         /*
@@ -668,8 +670,25 @@ public class ParameterFormat extends Tab
                     Object value = row.values.get(i);
                     if (value != null) {
                         if (i != 0) {
-                            table.append(lineSeparator);
+                            /*
+                             * If the same parameter is repeated more than once (not allowed by ISO 19111,
+                             * but this extra flexibility is allowed by Apache SIS), write the ditto mark
+                             * in all previous columns (name, type, etc.) on a new row.
+                             */
+                            final String ditto = resources.getString(Vocabulary.Keys.DittoMark);
+                            table.nextLine();
+                            table.setCellAlignment(TableAppender.ALIGN_CENTER);
+                            for (int j=0; j<numColumnsBeforeValue; j++) {
+                                table.append(ditto);
+                                nextColumn(table);
+                            }
+                            table.setCellAlignment(TableAppender.ALIGN_RIGHT);
                         }
+                        /*
+                         * Format the value followed by the unit of measure, or followed by spaces if there is no unit
+                         * for this value. The intend is the right align the numerical value rather than the numerical
+                         * + unit tupple.
+                         */
                         final Format format = getFormat(value.getClass());
                         if (format != null) {
                             value = format.format(value, buffer, dummyFP);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -16,10 +16,11 @@
  */
 package org.apache.sis.parameter;
 
+import java.util.Map;
+import java.util.HashMap;
 import javax.measure.unit.Unit;
 import org.opengis.util.MemberName;
-import org.opengis.parameter.ParameterValue;
-import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.*; // We use almost all types from this package.
 import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameter;
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.NumberRange;
@@ -44,6 +45,75 @@ public final class Parameters extends St
     }
 
     /**
+     * Gets the parameter name as an instance of {@code MemberName}.
+     * This method performs the following checks:
+     *
+     * <ul>
+     *   <li>If the {@linkplain DefaultParameterDescriptor#getName() primary name} is an instance of {@code MemberName},
+     *       returns that primary name.</li>
+     *   <li>Otherwise this method searches for the first {@linkplain DefaultParameterDescriptor#getAlias() alias}
+     *       which is an instance of {@code MemberName}. If found, that alias is returned.</li>
+     *   <li>If no alias is found, then this method tries to build a member name from the primary name and the
+     *       {@linkplain DefaultParameterDescriptor#getValueClass() value class}, using the mapping defined in
+     *       {@link org.apache.sis.util.iso.DefaultTypeName} javadoc.</li>
+     * </ul>
+     *
+     * This method can be used as a bridge between the parameter object
+     * defined by ISO 19111 (namely {@code CC_OperationParameter}) and the one
+     * defined by ISO 19115 (namely {@code SV_Parameter}).
+     *
+     * @param  parameter The parameter from which to get the name (may be {@code null}).
+     * @return The member name, or {@code null} if none.
+     *
+     * @see org.apache.sis.util.iso.Names#createMemberName(CharSequence, String, CharSequence, Class)
+     *
+     * @since 0.5
+     */
+    public static MemberName getMemberName(final ParameterDescriptor<?> parameter) {
+        return ServiceParameter.getMemberName(parameter);
+    }
+
+    /**
+     * Returns the domain of valid values defined by the given descriptor, or {@code null} if none.
+     * This method builds the range from the {@linkplain DefaultParameterDescriptor#getMinimumValue() minimum value},
+     * {@linkplain DefaultParameterDescriptor#getMaximumValue() maximum value} and, if the values are numeric, from
+     * the {@linkplain DefaultParameterDescriptor#getUnit() unit}.
+     *
+     * @param  descriptor The parameter descriptor, or {@code null}.
+     * @return The domain of valid values, or {@code null} if none.
+     *
+     * @see DefaultParameterDescriptor#getValueDomain()
+     */
+    @SuppressWarnings({"unchecked", "rawtypes"})
+    public static Range<?> getValueDomain(final ParameterDescriptor<?> descriptor) {
+        if (descriptor != null) {
+            if (descriptor instanceof DefaultParameterDescriptor<?>) {
+                return ((DefaultParameterDescriptor<?>) descriptor).getValueDomain();
+            }
+            final Class<?> valueClass = descriptor.getValueClass();
+            final Comparable<?> minimumValue = descriptor.getMinimumValue();
+            final Comparable<?> maximumValue = descriptor.getMaximumValue();
+            if ((minimumValue == null || valueClass.isInstance(minimumValue)) &&
+                (maximumValue == null || valueClass.isInstance(maximumValue)))
+            {
+                if (Number.class.isAssignableFrom(valueClass)) {
+                    final Unit<?> unit = descriptor.getUnit();
+                    if (unit != null) {
+                        return new MeasurementRange((Class) valueClass,
+                                (Number) minimumValue, true, (Number) maximumValue, true, unit);
+                    } else if (minimumValue != null || maximumValue != null) {
+                        return new NumberRange((Class) valueClass,
+                                (Number) minimumValue, true, (Number) maximumValue, true);
+                    }
+                } else if (minimumValue != null || maximumValue != null) {
+                    return new Range(valueClass, minimumValue, true, maximumValue, true);
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
      * Casts the given parameter descriptor to the given type.
      * An exception is thrown immediately if the parameter does not have the expected
      * {@linkplain DefaultParameterDescriptor#getValueClass() value class}.
@@ -100,71 +170,110 @@ public final class Parameters extends St
     }
 
     /**
-     * Returns the domain of valid values defined by the given descriptor, or {@code null} if none.
-     * This method builds the range from the {@linkplain DefaultParameterDescriptor#getMinimumValue() minimum value},
-     * {@linkplain DefaultParameterDescriptor#getMaximumValue() maximum value} and, if the values are numeric, from
-     * the {@linkplain DefaultParameterDescriptor#getUnit() unit}.
-     *
-     * @param  descriptor The parameter descriptor, or {@code null}.
-     * @return The domain of valid values, or {@code null} if none.
+     * Copies the values of a parameter group into another parameter group.
+     * All values in the {@code source} group shall be valid for the {@code destination} group,
+     * but the {@code destination} may have more parameters.
+     * Sub-groups are copied recursively.
+     *
+     * <p>A typical usage of this method is for transferring values from an arbitrary implementation
+     * to some specific implementation, or to a parameter group using a different but compatible
+     * {@linkplain DefaultParameterValueGroup#getDescriptor() descriptor}.</p>
+     *
+     * @param  values The parameters values to copy.
+     * @param  destination Where to copy the values.
+     * @throws InvalidParameterNameException if a {@code source} parameter name is unknown to the {@code destination}.
+     * @throws InvalidParameterValueException if the value of a {@code source} parameter is invalid for the {@code destination}.
      *
-     * @see DefaultParameterDescriptor#getValueDomain()
+     * @since 0.5
      */
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public static Range<?> getValueDomain(final ParameterDescriptor<?> descriptor) {
-        if (descriptor != null) {
-            if (descriptor instanceof DefaultParameterDescriptor<?>) {
-                return ((DefaultParameterDescriptor<?>) descriptor).getValueDomain();
-            }
-            final Class<?> valueClass = descriptor.getValueClass();
-            final Comparable<?> minimumValue = descriptor.getMinimumValue();
-            final Comparable<?> maximumValue = descriptor.getMaximumValue();
-            if ((minimumValue == null || valueClass.isInstance(minimumValue)) &&
-                (maximumValue == null || valueClass.isInstance(maximumValue)))
-            {
-                if (Number.class.isAssignableFrom(valueClass)) {
-                    final Unit<?> unit = descriptor.getUnit();
-                    if (unit != null) {
-                        return new MeasurementRange((Class) valueClass,
-                                (Number) minimumValue, true, (Number) maximumValue, true, unit);
-                    } else if (minimumValue != null || maximumValue != null) {
-                        return new NumberRange((Class) valueClass,
-                                (Number) minimumValue, true, (Number) maximumValue, true);
+    public static void copy(final ParameterValueGroup values, final ParameterValueGroup destination)
+            throws InvalidParameterNameException, InvalidParameterValueException
+    {
+        final Integer ONE = 1;
+        final Map<String,Integer> occurrences = new HashMap<String,Integer>();
+        for (final GeneralParameterValue value : values.values()) {
+            final String name = value.getDescriptor().getName().getCode();
+            if (value instanceof ParameterValueGroup) {
+                /*
+                 * Contains sub-group - invokes 'copy' recursively.
+                 */
+                final GeneralParameterDescriptor descriptor;
+                descriptor = destination.getDescriptor().descriptor(name);
+                if (descriptor instanceof ParameterDescriptorGroup) {
+                    final ParameterValueGroup groups = (ParameterValueGroup) descriptor.createValue();
+                    copy((ParameterValueGroup) value, groups);
+                    values.groups(name).add(groups);
+                } else {
+                    throw new InvalidParameterNameException(Errors.format(
+                            Errors.Keys.UnexpectedParameter_1, name), name);
+                }
+            } else {
+                /*
+                 * Single parameter - copy the value, with special care for value with units
+                 * and for multi-occurrences. Not that the later is not allowed by ISO 19111
+                 * but supported by SIS implementation.
+                 */
+                final ParameterValue<?> source = (ParameterValue<?>) value;
+                final ParameterValue<?> target;
+                Integer occurrence = occurrences.get(name);
+                if (occurrence == null) {
+                    occurrence = ONE;
+                    try {
+                        target = destination.parameter(name);
+                    } catch (ParameterNotFoundException cause) {
+                        throw (InvalidParameterNameException) new InvalidParameterNameException(Errors.format(
+                                    Errors.Keys.UnexpectedParameter_1, name), name).initCause(cause);
                     }
-                } else if (minimumValue != null || maximumValue != null) {
-                    return new Range(valueClass, minimumValue, true, maximumValue, true);
+                } else {
+                    target = (ParameterValue<?>) getOrCreate(destination, name, occurrence);
+                    occurrence++;
+                }
+                occurrences.put(name, occurrence);
+                final Object  v    = source.getValue();
+                final Unit<?> unit = source.getUnit();
+                if (unit == null) {
+                    target.setValue(v);
+                } else if (v instanceof Number) {
+                    target.setValue(((Number) v).doubleValue(), unit);
+                } else if (v instanceof double[]) {
+                    target.setValue((double[]) v, unit);
+                } else {
+                    throw new InvalidParameterValueException(Errors.format(
+                            Errors.Keys.IllegalArgumentValue_2, name, v), name, v);
                 }
             }
         }
-        return null;
     }
 
     /**
-     * Gets the parameter name as an instance of {@code MemberName}.
-     * This method performs the following checks:
-     *
-     * <ul>
-     *   <li>If the {@linkplain DefaultParameterDescriptor#getName() primary name} is an instance of {@code MemberName},
-     *       returns that primary name.</li>
-     *   <li>Otherwise this method searches for the first {@linkplain DefaultParameterDescriptor#getAlias() alias}
-     *       which is an instance of {@code MemberName}. If found, that alias is returned.</li>
-     *   <li>If no alias is found, then this method tries to build a member name from the primary name and the
-     *       {@linkplain DefaultParameterDescriptor#getValueClass() value class}, using the mapping defined in
-     *       {@link org.apache.sis.util.iso.DefaultTypeName} javadoc.</li>
-     * </ul>
-     *
-     * This method can be used as a bridge between the parameter object
-     * defined by ISO 19111 (namely {@code CC_OperationParameter}) and the one
-     * defined by ISO 19115 (namely {@code SV_Parameter}).
-     *
-     * @param  parameter The parameter from which to get the name (may be {@code null}).
-     * @return The member name, or {@code null} if none.
-     *
-     * @see org.apache.sis.util.iso.Names#createMemberName(CharSequence, String, CharSequence, Class)
-     *
-     * @since 0.5
+     * Returns the <var>n</var>th occurrence of the parameter of the given name.
+     * This method is not public because ISO 19111 does not allow multi-occurrences of parameter values
+     * (this is a SIS-specific flexibility). Current implementation is not very efficient, but it should
+     * not be an issue if this method is rarely invoked.
+     *
+     * @param  values The group from which to get or create a value
+     * @param  name   The name of the parameter to fetch. An exact match will be required.
+     * @param  n      Number of occurrences to skip before to return or create the parameter.
+     * @return The <var>n</var>th occurrence (zero-based) of the parameter of the given name.
+     * @throws IndexOutOfBoundsException if {@code n} is greater than the current number of
+     *         parameters of the given name.
      */
-    public static MemberName getMemberName(final ParameterDescriptor<?> parameter) {
-        return ServiceParameter.getMemberName(parameter);
+    private static GeneralParameterValue getOrCreate(final ParameterValueGroup values, final String name, int n) {
+        for (final GeneralParameterValue value : values.values()) {
+            if (name.equals(value.getDescriptor().getName().getCode())) {
+                if (--n < 0) {
+                    return value;
+                }
+            }
+        }
+        if (n == 0) {
+            final GeneralParameterValue value = values.getDescriptor().descriptor(name).createValue();
+            values.values().add(value);
+            return value;
+        } else {
+            // We do not botter formatting a good error message for now, because
+            // this method is currently invoked only with increasing index values.
+            throw new IndexOutOfBoundsException(name);
+        }
     }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -973,7 +973,7 @@ public class AbstractIdentifiedObject ex
     }
 
     /**
-     * Formats the inner part of this <cite>Well Known Text</cite> (WKT) object into the given formatter.
+     * Formats the inner part of the <cite>Well Known Text</cite> (WKT) representation for this object.
      * The default implementation writes the following elements:
      *
      * <ul>

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -220,7 +220,7 @@ public final class IdentifiedObjects ext
                             if (ns != null) {
                                 final GenericName scope = ns.name();
                                 if (scope != null) {
-                                    if (identifierMatches(authority, scope.toString())) {
+                                    if (identifierMatches(authority, null, scope.toString())) {
                                         final String name = alias.toString();
                                         if (name != null) {
                                             if (addTo == null) {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -415,10 +415,8 @@ public class AbstractCRS extends Abstrac
                            Objects.equals(coordinateSystem, that.coordinateSystem);
                 }
                 default: {
-                    return deepEquals(datum,
-                                      (object instanceof SingleCRS) ? ((SingleCRS) object).getDatum() : null, mode) &&
-                           deepEquals(getCoordinateSystem(),
-                                      ((CoordinateReferenceSystem) object).getCoordinateSystem(), mode);
+                    return deepEquals(datum, (object instanceof SingleCRS) ? ((SingleCRS) object).getDatum() : null, mode) &&
+                           deepEquals(getCoordinateSystem(), ((CoordinateReferenceSystem) object).getCoordinateSystem(), mode);
                 }
             }
         }
@@ -438,7 +436,7 @@ public class AbstractCRS extends Abstrac
     }
 
     /**
-     * Formats the inner part of a <cite>Well Known Text</cite> (WKT) CRS into the given formatter.
+     * Formats the inner part of the <cite>Well Known Text</cite> (WKT) representation of this CRS.
      * The default implementation writes the following elements in WKT 2 format:
      *
      * <ul>

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -416,7 +416,7 @@ public class AbstractCS extends Abstract
     }
 
     /**
-     * Formats the inner part of this <cite>Well Known Text</cite> (WKT) CS into the given formatter.
+     * Formats the inner part of the <cite>Well Known Text</cite> (WKT) representation of this coordinate system.
      * This method does <strong>not</strong> format the axes, because they shall appear outside
      * the {@code CS[…]} element for historical reasons. Axes shall be formatted by the enclosing
      * element (usually an {@link org.apache.sis.referencing.crs.AbstractCRS}).

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -32,6 +32,7 @@ import org.apache.sis.referencing.Identi
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.internal.metadata.MetadataUtilities;
+import org.apache.sis.internal.referencing.OperationMethods;
 
 import static org.apache.sis.util.Utilities.deepEquals;
 import static org.apache.sis.util.collection.Containers.property;
@@ -404,14 +405,21 @@ public class AbstractDatum extends Abstr
             }
             default: {
                 /*
-                 * Tests for name, since datum with different name have completely
-                 * different meaning. We don't perform this comparison if the user
-                 * asked for metadata comparison, because in such case the names
-                 * have already been compared by the subclass.
+                 * Tests for identifiers or name since datum with different identification may have completely
+                 * different meaning. We do not perform this check if the user asked for metadata comparison,
+                 * because in such case the name and identifiers have already been compared by the subclass.
+                 *
+                 * According ISO 19162 (Well Known Text representation of Coordinate Reference Systems),
+                 * identifiers shall have precedence over name at least in the case of operation methods
+                 * and parameters. We extend this rule to datum as well.
                  */
                 final Datum that = (Datum) object;
-                return isHeuristicMatchForName(that. getName().getCode()) ||
-                       IdentifiedObjects.isHeuristicMatchForName(that, getName().getCode());
+                final Boolean match = OperationMethods.hasCommonIdentifier(getIdentifiers(), that.getIdentifiers());
+                if (match != null) {
+                    return match;
+                }
+                return isHeuristicMatchForName(that.getName().getCode())
+                        || IdentifiedObjects.isHeuristicMatchForName(that, getName().getCode());
             }
         }
     }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -258,9 +258,7 @@ public class BursaWolfParameters extends
      * @return {@code true} if the given datum is equal to WGS84 for computational purpose.
      */
     final boolean isToWGS84() {
-        return (targetDatum != null) &&
-               (IdentifiedObjects.isHeuristicMatchForName(targetDatum, "WGS 84") ||
-                IdentifiedObjects.isHeuristicMatchForName(targetDatum, "WGS84"));
+        return (targetDatum != null) && IdentifiedObjects.isHeuristicMatchForName(targetDatum, "WGS84");
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -297,7 +297,7 @@ public class DefaultTemporalDatum extend
     }
 
     /**
-     * The {@code TIMEORIGIN[…]} element inside an {@code TDATUM[…]}.
+     * The {@code TimeOrigin[…]} element inside a {@code TimeDatum[…]}.
      */
     private static final class Origin extends FormattableObject {
         /** The value of the origin to format. */

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -61,6 +61,10 @@ class GeneralMatrix extends MatrixSIS im
      * rounding errors anyway. So we put the threshold to some arbitrary mid-value, which may change in any future
      * SIS version according experience gained. As long as the value is smaller than 1, it still more accurate than
      * {@code double} arithmetic anyway.</p>
+     *
+     * <div class="note"><b>Note:</b>
+     * A similar constant exists in {@code org.apache.sis.math.Plane}.
+     * </div>
      */
     private static final double ZERO_THRESHOLD = 1E-14;
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -870,6 +870,9 @@ public abstract class AbstractMathTransf
      * The default implementation formats all parameter values returned by {@link #getParameterValues()}.
      * The parameter group name is used as the math transform name.
      *
+     * <div class="note"><b>Compatibility note:</b>
+     * {@code Param_MT} is defined in the WKT 1 specification only.</div>
+     *
      * @param  formatter The formatter to use.
      * @return The WKT element name, which is {@code "Param_MT"} in the default implementation.
      */
@@ -880,6 +883,9 @@ public abstract class AbstractMathTransf
             WKTUtilities.appendName(parameters.getDescriptor(), formatter, null);
             WKTUtilities.append(parameters, formatter);
         }
+        if (formatter.getConvention().majorVersion() != 1) {
+            formatter.setInvalidWKT(MathTransform.class, null);
+        }
         return "Param_MT";
     }
 
@@ -1031,6 +1037,9 @@ public abstract class AbstractMathTransf
          * WKT as in the {@linkplain AbstractMathTransform#formatWKT super-class method}.
          * Otherwise this method formats the math transform as an {@code "Inverse_MT"} entity.
          *
+         * <div class="note"><b>Compatibility note:</b>
+         * {@code Param_MT} and {@code Inverse_MT} are defined in the WKT 1 specification only.</div>
+         *
          * @param  formatter The formatter to use.
          * @return The WKT element name, which is {@code "Param_MT"} or
          *         {@code "Inverse_MT"} in the default implementation.

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java?rev=1654882&r1=1654881&r2=1654882&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java [UTF-8] Mon Jan 26 19:48:49 2015
@@ -898,6 +898,9 @@ class ConcatenatedTransform extends Abst
     /**
      * Formats the inner part of a <cite>Well Known Text</cite> version 1 (WKT 1) element.
      *
+     * <div class="note"><b>Compatibility note:</b>
+     * {@code Concat_MT} is defined in the WKT 1 specification only.</div>
+     *
      * @param  formatter The formatter to use.
      * @return The WKT element name, which is {@code "Concat_MT"}.
      */



Mime
View raw message