sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1678265 [1/2] - in /sis/branches/JDK7: ./ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-console/src/test/java/org/apache/sis/console/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/si...
Date Thu, 07 May 2015 21:46:07 GMT
Author: desruisseaux
Date: Thu May  7 21:46:06 2015
New Revision: 1678265

URL: http://svn.apache.org/r1678265
Log:
Merge from the JDK8 branch.

Added:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
      - copied unchanged from r1678264, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/WKTKeywordsTest.java
      - copied unchanged from r1678264, sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/WKTKeywordsTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
      - copied unchanged from r1678264, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java
    sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConicProjection.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCylindricalProjection.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPlanarProjection.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultProjection.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  7 21:46:06 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1677787
+/sis/branches/JDK8:1584960-1678264
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java [UTF-8] Thu May  7 21:46:06 2015
@@ -98,7 +98,7 @@ final class AboutSC extends SubCommand {
                  *
                  * Tutorial: http://docs.oracle.com/javase/tutorial/jmx/remote/custom.html
                  */
-                final String path = toRemoveURL(files.get(0));
+                final String path = toRemoteURL(files.get(0));
                 try {
                     final JMXServiceURL url = new JMXServiceURL(path);
                     try (JMXConnector jmxc = JMXConnectorFactory.connect(url)) {
@@ -121,7 +121,7 @@ final class AboutSC extends SubCommand {
      * Creates a {@code "service:jmx:rmi:///jndi/rmi://host:port/jmxrmi"} URL for the given host name.
      * The host name can optionally be followed by a port number.
      */
-    static String toRemoveURL(final String host) {
+    static String toRemoteURL(final String host) {
         final StringBuilder buffer = new StringBuilder(60).append("service:jmx:rmi:///jndi/rmi://")
                 .append(host, host.regionMatches(true, 0, "localhost", 0, 9) ? 9 : 0, host.length());
         if (host.lastIndexOf(':') < 0) {

Modified: sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java [UTF-8] Thu May  7 21:46:06 2015
@@ -95,15 +95,15 @@ public final strictfp class AboutSCTest
     }
 
     /**
-     * Tests the {@link AboutSC#toRemoveURL(String)} method.
+     * Tests the {@link AboutSC#toRemoteURL(String)} method.
      */
     @Test
-    public void testToRemoveURL() {
-        assertEquals("service:jmx:rmi:///jndi/rmi://myhost:9999/jmxrmi",    AboutSC.toRemoveURL("myhost:9999"));
-        assertEquals("service:jmx:rmi:///jndi/rmi://myhost:1099/jmxrmi",    AboutSC.toRemoveURL("myhost"));
-        assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi",          AboutSC.toRemoveURL("localhost:9999"));
-        assertEquals("service:jmx:rmi:///jndi/rmi://:1099/jmxrmi",          AboutSC.toRemoveURL("localhost"));
-        assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi",          AboutSC.toRemoveURL(":9999"));
-        assertEquals("service:jmx:rmi:///jndi/rmi://localhosx:1099/jmxrmi", AboutSC.toRemoveURL("localhosx"));
+    public void testToRemoteURL() {
+        assertEquals("service:jmx:rmi:///jndi/rmi://myhost:9999/jmxrmi",    AboutSC.toRemoteURL("myhost:9999"));
+        assertEquals("service:jmx:rmi:///jndi/rmi://myhost:1099/jmxrmi",    AboutSC.toRemoteURL("myhost"));
+        assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi",          AboutSC.toRemoteURL("localhost:9999"));
+        assertEquals("service:jmx:rmi:///jndi/rmi://:1099/jmxrmi",          AboutSC.toRemoteURL("localhost"));
+        assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi",          AboutSC.toRemoteURL(":9999"));
+        assertEquals("service:jmx:rmi:///jndi/rmi://localhosx:1099/jmxrmi", AboutSC.toRemoteURL("localhosx"));
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] Thu May  7 21:46:06 2015
@@ -63,6 +63,8 @@ public enum Convention {
      *
      * <p>This is the default convention used by {@link FormattableObject#toWKT()}
      * and for new {@link WKTFormat} instances.</p>
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
      */
     WKT2(false),
 
@@ -114,6 +116,8 @@ public enum Convention {
      *   <tr><td>Geocentric Y</td> <td>Easting</td>    <td>Toward 90°E longitude</td></tr>
      *   <tr><td>Geocentric Z</td> <td>Northing</td>   <td>Toward north pole</td></tr>
      * </table>
+     *
+     * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
      */
     WKT1(true),
 

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] Thu May  7 21:46:06 2015
@@ -61,6 +61,9 @@ import org.apache.sis.internal.util.X364
  * @since   0.4
  * @version 0.4
  * @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
  */
 @XmlTransient
 public abstract class FormattableObject {

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Thu May  7 21:46:06 2015
@@ -66,6 +66,7 @@ import org.apache.sis.util.ArgumentCheck
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.Citations;
 import org.apache.sis.internal.simple.SimpleExtent;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.metadata.ReferencingServices;
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.MeasurementRange;
@@ -91,6 +92,9 @@ import org.apache.sis.metadata.iso.exten
  * @since   0.4
  * @version 0.6
  * @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
  */
 public class Formatter implements Localized {
     /**
@@ -734,7 +738,7 @@ public class Formatter implements Locali
             }
         }
         if (showOthers) {
-            appendOnNewLine("Remarks", object.getRemarks(), ElementKind.REMARKS);
+            appendOnNewLine(WKTKeywords.Remarks, object.getRemarks(), ElementKind.REMARKS);
         }
         isComplement = false;
     }
@@ -761,10 +765,10 @@ public class Formatter implements Locali
         } else {
             return;
         }
-        appendOnNewLine("Anchor", anchor, null);
-        appendOnNewLine("Scope", scope, ElementKind.SCOPE);
+        appendOnNewLine(WKTKeywords.Anchor, anchor, null);
+        appendOnNewLine(WKTKeywords.Scope, scope, ElementKind.SCOPE);
         if (area != null) {
-            appendOnNewLine("Area", area.getDescription(), ElementKind.EXTENT);
+            appendOnNewLine(WKTKeywords.Area, area.getDescription(), ElementKind.EXTENT);
             append(Extents.getGeographicBoundingBox(area), BBOX_ACCURACY);
             appendVerticalExtent(Extents.getVerticalRange(area));
             appendTemporalExtent(Extents.getTimeRange(area));
@@ -787,7 +791,7 @@ public class Formatter implements Locali
      */
     public void append(final GeographicBoundingBox bbox, final int fractionDigits) {
         if (bbox != null) {
-            openElement(isComplement, "BBox");
+            openElement(isComplement, WKTKeywords.BBox);
             setColor(ElementKind.EXTENT);
             numberFormat.setMinimumFractionDigits(fractionDigits);
             numberFormat.setMaximumFractionDigits(fractionDigits);
@@ -822,7 +826,7 @@ public class Formatter implements Locali
                 maximumFractionDigits = VERTICAL_ACCURACY;
                 minimumFractionDigits = 0;
             }
-            openElement(true, "VerticalExtent");
+            openElement(true, WKTKeywords.VerticalExtent);
             setColor(ElementKind.EXTENT);
             numberFormat.setMinimumFractionDigits(minimumFractionDigits);
             numberFormat.setMaximumFractionDigits(maximumFractionDigits);
@@ -862,7 +866,7 @@ public class Formatter implements Locali
                         ((SimpleDateFormat) dateFormat).applyPattern(WKTFormat.SHORT_DATE_PATTERN);
                     }
                 }
-                openElement(true, "TimeExtent");
+                openElement(true, WKTKeywords.TimeExtent);
                 setColor(ElementKind.EXTENT);
                 try {
                     append(min);

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Thu May  7 21:46:06 2015
@@ -81,6 +81,9 @@ import org.apache.sis.util.resources.Err
  * @since   0.4
  * @version 0.6
  * @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
  */
 public class WKTFormat extends CompoundFormat<Object> {
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java [UTF-8] Thu May  7 21:46:06 2015
@@ -37,7 +37,8 @@
  * <div class="section">Referencing WKT</div>
  * Referencing WKT is defined using Extended Backus Naur Form (EBNF) in two versions:
  * <ul>
- *   <li>ISO 19162 defines the current format, also known as “WKT 2”.</li>
+ *   <li>ISO 19162 defines the current format, also known as “WKT 2”. The specification is also made
+ *       <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">available online</a> by OGC.</li>
  *   <li>The previous format — “WKT 1” — was defined in the <a href="http://www.opengeospatial.org/standards/ct">OGC
  *       document 01-009</a>. This definition is
  *       <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">shown on GeoAPI</a>.</li>
@@ -61,5 +62,8 @@
  * @since   0.4
  * @version 0.4
  * @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
  */
 package org.apache.sis.io.wkt;

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Thu May  7 21:46:06 2015
@@ -30,6 +30,7 @@ import org.apache.sis.util.iso.Types;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.util.DefinitionURI;
 import org.apache.sis.internal.metadata.NameMeaning;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.Convention;
@@ -537,6 +538,8 @@ public class ImmutableIdentifier extends
      *
      * @param  formatter The formatter where to format the inner content of this WKT element.
      * @return {@code "Id"} (WKT 2) or {@code "Authority"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#33">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -557,11 +560,11 @@ public class ImmutableIdentifier extends
             if (cs != null) {
                 final Convention convention = formatter.getConvention();
                 if (convention.majorVersion() == 1) {
-                    keyword = "Authority";
+                    keyword = WKTKeywords.Authority;
                     formatter.append(cs,   ElementKind.IDENTIFIER);
                     formatter.append(code, ElementKind.IDENTIFIER);
                 } else {
-                    keyword = "Id";
+                    keyword = WKTKeywords.Id;
                     formatter.append(cs, ElementKind.IDENTIFIER);
                     appendCode(formatter, code);
                     final String version = getVersion();
@@ -644,7 +647,7 @@ public class ImmutableIdentifier extends
         @Override
         protected String formatTo(final Formatter formatter) {
             formatter.append(identifier, ElementKind.CITATION);
-            return "Citation";
+            return WKTKeywords.Citation;
         }
     }
 
@@ -675,7 +678,7 @@ public class ImmutableIdentifier extends
             }
             buffer.append(DefinitionURI.SEPARATOR).append(code);
             formatter.append(buffer.toString(), null);
-            return "URI";
+            return WKTKeywords.URI;
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Thu May  7 21:46:06 2015
@@ -26,10 +26,11 @@ import org.junit.BeforeClass;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.6
  * @module
  */
 @Suite.SuiteClasses({
+    org.apache.sis.internal.metadata.WKTKeywordsTest.class,
     org.apache.sis.internal.metadata.NameMeaningTest.class,
     org.apache.sis.internal.metadata.MetadataUtilitiesTest.class,
     org.apache.sis.internal.metadata.OtherLocalesTest.class,

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java [UTF-8] Thu May  7 21:46:06 2015
@@ -17,10 +17,10 @@
 package org.apache.sis.internal.referencing;
 
 import java.util.Collection;
-import org.opengis.util.Record;
 import javax.measure.unit.SI;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Length;
+import org.opengis.util.Record;
 import org.opengis.metadata.quality.Result;
 import org.opengis.metadata.quality.PositionalAccuracy;
 import org.opengis.metadata.quality.QuantitativeResult;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] Thu May  7 21:46:06 2015
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.referencing;
 
+import org.apache.sis.internal.metadata.WKTKeywords;
 import java.util.Iterator;
 import java.util.Collection;
 
@@ -128,7 +129,7 @@ public final class ServicesForMetadata e
             @Override
             protected String formatTo(final Formatter formatter) {
                 WKTUtilities.appendParamMT(parameters, formatter);
-                return "Param_MT";
+                return WKTKeywords.Param_MT;
             }
         };
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java [UTF-8] Thu May  7 21:46:06 2015
@@ -24,6 +24,7 @@ import org.opengis.parameter.ParameterDe
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.resources.Errors;
@@ -337,7 +338,7 @@ public abstract class AbstractParameterD
                 formatter.newLine();
                 formatter.append((FormattableObject) parameter);
             }
-            return "ParameterGroup";
+            return WKTKeywords.ParameterGroup;
         } else if (this instanceof ParameterDescriptor<?>) {
             final Object defaultValue = ((ParameterDescriptor<?>) this).getDefaultValue();
             if (defaultValue != null) {
@@ -350,6 +351,6 @@ public abstract class AbstractParameterD
                 }
             }
         }
-        return "Parameter";
+        return WKTKeywords.Parameter;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] Thu May  7 21:46:06 2015
@@ -34,6 +34,7 @@ import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.internal.referencing.WKTUtilities;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.ComparisonMode;
@@ -823,7 +824,9 @@ public class DefaultParameterValue<T> ex
      * Instead, the unit was inherited from the enclosing element.</div>
      *
      * @param  formatter The formatter where to format the inner content of this WKT element.
-     * @return {@code "Parameter"}.
+     * @return {@code "Parameter"} or {@code "ParameterFile"}.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#119">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -855,7 +858,7 @@ public class DefaultParameterValue<T> ex
                     || value instanceof File || value instanceof Path))
             {
                 formatter.append(value.toString(), null);
-                return "ParameterFile";
+                return WKTKeywords.ParameterFile;
             }
             formatter.appendAny(value);
         }
@@ -869,6 +872,6 @@ public class DefaultParameterValue<T> ex
             formatter.append(unit);
             // ID will be added by the Formatter itself.
         }
-        return "Parameter";
+        return WKTKeywords.Parameter;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] Thu May  7 21:46:06 2015
@@ -33,6 +33,7 @@ import org.opengis.parameter.ParameterNo
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.operation.matrix.Matrices;
 import org.apache.sis.internal.referencing.WKTUtilities;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
 import org.apache.sis.io.wkt.Formatter;
@@ -465,6 +466,6 @@ final class TensorValues<E> extends Abst
     @Override
     protected String formatTo(final Formatter formatter) {
         WKTUtilities.appendParamMT(this, formatter);
-        return "ParameterGroup";
+        return WKTKeywords.ParameterGroup;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Thu May  7 21:46:06 2015
@@ -1033,6 +1033,8 @@ public class AbstractIdentifiedObject ex
      * @param  formatter The formatter where to format the inner content of this WKT element.
      * @return The {@linkplain org.apache.sis.io.wkt.KeywordCase#CAMEL_CASE CamelCase} keyword
      *         for the WKT element, or {@code null} if unknown.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#21">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -456,10 +456,13 @@ public class AbstractCRS extends Abstrac
      * </ul>
      *
      * @return {@inheritDoc}
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+     * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        final String  keyword = super.formatTo(formatter);
+        final String keyword = super.formatTo(formatter);
         formatter.newLine();
         formatter.append(toFormattable(getDatum()));
         formatter.newLine();

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -33,6 +33,7 @@ import org.apache.sis.referencing.cs.Axe
 import org.apache.sis.referencing.cs.DefaultCompoundCS;
 import org.apache.sis.referencing.AbstractReferenceSystem;
 import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
@@ -75,6 +76,23 @@ import static org.apache.sis.internal.re
  * part (e.g. the EPSG identifier) that would otherwise been lost. Users can obtain the list of their
  * choice by invoking {@link #getSingleComponents()} or {@link #getComponents()} respectively.
  *
+ * <div class="section">Component order</div>
+ * ISO 19162 restricts compound CRS to the following components in that order:
+ * <ul>
+ *   <li>A mandatory horizontal CRS (only one of two-dimensional {@code GeographicCRS} or {@code ProjectedCRS} or {@code EngineeringCRS}).</li>
+ *   <li>Optionally followed by a {@code VerticalCRS} or a {@code ParametricCRS} (but not both).</li>
+ *   <li>Optionally followed by a {@code TemporalCRS}.</li>
+ * </ul>
+ *
+ * SIS currently does not enforce those restrictions. In particular:
+ * <ul>
+ *   <li>Components may appear in different order.
+ *   <li>{@code VerticalCRS} + {@code TemporalCRS} (without horizontal component) is accepted.</li>
+ *   <li>{@code GeocentricCRS} or three-dimensional {@code GeographicCRS} can be combined with {@code TemporalCRS}.</li>
+ * </ul>
+ *
+ * However users are encouraged to follow ISO 19162 restriction for better portability.
+ *
  * <div class="section">Immutability and thread safety</div>
  * This class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
  * and all {@link CoordinateReferenceSystem} instances given to the constructor are also immutable.
@@ -365,6 +383,14 @@ public class DefaultCompoundCRS extends
     }
 
     /**
+     * Should never be invoked since we override {@link AbstractCRS#forConvention(AxesConvention)}.
+     */
+    @Override
+    final AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem cs) {
+        throw new AssertionError();
+    }
+
+    /**
      * Compares this coordinate reference system with the specified object for equality.
      *
      * @param  object The object to compare to {@code this}.
@@ -417,6 +443,8 @@ public class DefaultCompoundCRS extends
      * SIS does not check if this CRS is compliant with the above-cited restrictions.
      *
      * @return {@code "CompoundCRS"} (WKT 2) or {@code "Compd_CS"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#110">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -430,6 +458,6 @@ public class DefaultCompoundCRS extends
             formatter.append(toFormattable(element));
         }
         formatter.newLine(); // For writing the ID[…] element on its own line.
-        return isWKT1 ? "Compd_CS" : "CompoundCRS";
+        return isWKT1 ? WKTKeywords.Compd_CS : WKTKeywords.CompoundCRS;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -20,18 +20,34 @@ import java.util.Map;
 import javax.xml.bind.annotation.XmlTransient;
 import org.opengis.parameter.GeneralParameterValue;
 import org.opengis.referencing.datum.Datum;
+import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.datum.VerticalDatum;
+import org.opengis.referencing.datum.TemporalDatum;
+import org.opengis.referencing.datum.EngineeringDatum;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.DerivedCRS;
+import org.opengis.referencing.crs.GeodeticCRS;
+import org.opengis.referencing.crs.VerticalCRS;
+import org.opengis.referencing.crs.TemporalCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
+import org.opengis.referencing.crs.EngineeringCRS;
 import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.cs.EllipsoidalCS;
+import org.opengis.referencing.cs.VerticalCS;
+import org.opengis.referencing.cs.TimeCS;
 import org.opengis.referencing.operation.Conversion;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.NoninvertibleTransformException;
 import org.opengis.geometry.MismatchedDimensionException;
+import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.referencing.operation.DefaultOperationMethod;
+import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.internal.referencing.WKTUtilities;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.Classes;
 
 
 /**
@@ -41,6 +57,21 @@ import org.apache.sis.util.ComparisonMod
  * can not be {@linkplain DefaultProjectedCRS projected CRS} themselves, but may be derived from a projected CRS
  * (for example in order to use a {@linkplain org.apache.sis.referencing.cs.DefaultPolarCS polar coordinate system}).
  *
+ * <p>A {@code DerivedCRS} instance may also implement one of the interfaces listed below,
+ * provided that the conditions in the right column are meet:</p>
+ *
+ * <table class="sis">
+ *   <caption>Derived CRS types</caption>
+ *   <tr><th>Type</th>                   <th>Conditions</th></tr>
+ *   <tr><td>{@link GeodeticCRS}</td>    <td>Base CRS is also a {@code GeodeticCRS} and is associated to the same type of coordinate system.</td></tr>
+ *   <tr><td>{@link VerticalCRS}</td>    <td>Base CRS is also a {@code VerticalCRS} and coordinate system is a {@code VerticalCS}.</td></tr>
+ *   <tr><td>{@link TemporalCRS}</td>    <td>Base CRS is also a {@code TemporalCRS} and coordinate system is a {@code TimeCS}.</td></tr>
+ *   <tr><td>{@link EngineeringCRS}</td> <td>Base CRS is also a {@code GeodeticCRS}, {@code ProjectedCRS} or {@code EngineeringCRS}.</td></tr>
+ * </table>
+ *
+ * Those specialized subclasses can be inferred automatically by the {@link #create create(…)} static method.
+ * Alternatively, users can create their own {@code DefaultDerivedCRS} subclass implementing the desired interface.
+ *
  * <div class="section">Immutability and thread safety</div>
  * This base class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
  * given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar
@@ -120,6 +151,8 @@ public class DefaultDerivedCRS extends A
      *         must match the target dimension of the {@code baseToDerived} transform.
      * @throws MismatchedDimensionException if the source and target dimension of {@code baseToDerived}
      *         do not match the dimension of {@code base} and {@code derivedCS} respectively.
+     *
+     * @see #create(Map, SingleCRS, Conversion, CoordinateSystem)
      */
     public DefaultDerivedCRS(final Map<String,?>    properties,
                              final SingleCRS        baseCRS,
@@ -146,6 +179,42 @@ public class DefaultDerivedCRS extends A
     }
 
     /**
+     * Creates a derived CRS from a defining conversion and a type inferred from the given arguments.
+     * This method expects the same arguments and performs the same work than the
+     * {@linkplain #DefaultDerivedCRS(Map, SingleCRS, Conversion, CoordinateSystem) above constructor},
+     * except that the {@code DerivedCRS} instance returned by this method may additionally implement
+     * the {@link GeodeticCRS}, {@link VerticalCRS}, {@link TemporalCRS} or {@link EngineeringCRS} interface.
+     * See the class javadoc for more information.
+     *
+     * @param  properties The properties to be given to the new derived CRS object.
+     * @param  baseCRS Coordinate reference system to base the derived CRS on.
+     * @param  conversionFromBase The conversion from the base CRS to this derived CRS.
+     * @param  derivedCS The coordinate system for the derived CRS. The number of axes
+     *         must match the target dimension of the {@code baseToDerived} transform.
+     * @return The newly created derived CRS, potentially implementing an additional CRS interface.
+     * @throws MismatchedDimensionException if the source and target dimension of {@code baseToDerived}
+     *         do not match the dimension of {@code base} and {@code derivedCS} respectively.
+     *
+     * @see #DefaultDerivedCRS(Map, SingleCRS, Conversion, CoordinateSystem)
+     */
+    public static DefaultDerivedCRS create(final Map<String,?>    properties,
+                                           final SingleCRS        baseCRS,
+                                           final Conversion       conversionFromBase,
+                                           final CoordinateSystem derivedCS)
+            throws MismatchedDimensionException
+    {
+        if (baseCRS != null && derivedCS != null) {
+            switch (getType(baseCRS, derivedCS)) {
+                case WKTKeywords.GeodeticCRS:    return new Geodetic   (properties, (GeodeticCRS) baseCRS, conversionFromBase, (EllipsoidalCS) derivedCS);
+                case WKTKeywords.VerticalCRS:    return new Vertical   (properties, (VerticalCRS) baseCRS, conversionFromBase,    (VerticalCS) derivedCS);
+                case WKTKeywords.TimeCRS:        return new Temporal   (properties, (TemporalCRS) baseCRS, conversionFromBase,        (TimeCS) derivedCS);
+                case WKTKeywords.EngineeringCRS: return new Engineering(properties,               baseCRS, conversionFromBase,                 derivedCS);
+            }
+        }
+        return new DefaultDerivedCRS(properties, baseCRS, conversionFromBase, derivedCS);
+    }
+
+    /**
      * Returns a SIS coordinate reference system implementation with the same values than the given
      * arbitrary implementation. If the given object is {@code null}, then this method returns {@code null}.
      * Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
@@ -156,8 +225,17 @@ public class DefaultDerivedCRS extends A
      *         given object itself), or {@code null} if the argument was null.
      */
     public static DefaultDerivedCRS castOrCopy(final DerivedCRS object) {
-        return (object == null) || (object instanceof DefaultDerivedCRS)
-                ? (DefaultDerivedCRS) object : new DefaultDerivedCRS(object);
+        if (object == null || object instanceof DefaultDerivedCRS) {
+            return (DefaultDerivedCRS) object;
+        } else {
+            switch (getType(object.getBaseCRS(), object.getCoordinateSystem())) {
+                case WKTKeywords.GeodeticCRS:    return new Geodetic   (object);
+                case WKTKeywords.VerticalCRS:    return new Vertical   (object);
+                case WKTKeywords.TimeCRS:        return new Temporal   (object);
+                case WKTKeywords.EngineeringCRS: return new Engineering(object);
+                default: return new DefaultDerivedCRS(object);
+            }
+        }
     }
 
     /**
@@ -221,6 +299,25 @@ public class DefaultDerivedCRS extends A
     }
 
     /**
+     * {@inheritDoc}
+     *
+     * @return {@inheritDoc}
+     */
+    @Override
+    public DefaultDerivedCRS forConvention(final AxesConvention convention) {
+        return (DefaultDerivedCRS) super.forConvention(convention);
+    }
+
+    /**
+     * Returns a coordinate reference system of the same type than this CRS but with different axes.
+     */
+    @Override
+    AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem derivedCS) {
+        final Conversion conversionFromBase = super.getConversionFromBase();
+        return new DefaultDerivedCRS(properties, (SingleCRS) conversionFromBase.getSourceCRS(), conversionFromBase, derivedCS);
+    }
+
+    /**
      * Compares this coordinate reference system with the specified object for equality.
      *
      * @param  object The object to compare to {@code this}.
@@ -248,6 +345,8 @@ public class DefaultDerivedCRS extends A
      * Formats the inner part of the <cite>Well Known Text</cite> (WKT) representation of this CRS.
      *
      * @return {@code "Fitted_CS"} (WKT 1) or a type-dependent keyword (WKT 2).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#93">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -272,7 +371,7 @@ public class DefaultDerivedCRS extends A
         formatter.newLine();
         formatter.append(WKTUtilities.toFormattable(getBaseCRS()));
         if (isWKT1) {
-            return "Fitted_CS";
+            return WKTKeywords.Fitted_CS;
         } else {
             formatter.append(new FormattableObject() {     // Format inside a "DefiningConversion" element.
                 @Override protected String formatTo(final Formatter formatter) {
@@ -283,13 +382,223 @@ public class DefaultDerivedCRS extends A
                     for (final GeneralParameterValue param : conversion.getParameterValues().values()) {
                         WKTUtilities.append(param, formatter);
                     }
-                    return "DerivingConversion";
+                    return WKTKeywords.DerivingConversion;
                 }
             });
             if (!isBaseCRS(formatter)) {
                 formatCS(formatter, getCoordinateSystem(), isWKT1);
             }
-            return "EngineeringCRS"; // TODO: may be GeodeticCRS, VerticalCRS, etc.
+            return keyword();
+        }
+    }
+
+    /**
+     * Return the WKT 2 keyword for this {@code DerivedCRS}, or {@code null} if unknown.
+     * Inner subclasses will override this method for returning a constant value instead
+     * than trying to infer it from the components.
+     */
+    String keyword() {
+        return getType(getBaseCRS(), getCoordinateSystem());
+    }
+
+    /**
+     * Returns the WKT 2 keyword for a {@code DerivedCRS} having the given base CRS and derived coordinate system.
+     * Note that an ambiguity exists if the given base CRS is a {@code GeodeticCRS}, as the result could be either
+     * {@code "GeodeticCRS"} or {@code "EngineeringCRS"}. The current implementation returns the former if the
+     * derived coordinate system is of the same kind than the base coordinate system.
+     */
+    static String getType(final SingleCRS baseCRS, final CoordinateSystem derivedCS) {
+        final Class<?> type;
+        if (baseCRS instanceof AbstractIdentifiedObject) {
+            // For avoiding ambiguity if a user chooses to implement more
+            // than 1 CRS interface (not recommended, but may happen).
+            type = ((AbstractIdentifiedObject) baseCRS).getInterface();
+        } else {
+            type = baseCRS.getClass();
+        }
+        if (GeodeticCRS.class.isAssignableFrom(type)) {
+            if (Classes.implementSameInterfaces(derivedCS.getClass(),
+                    baseCRS.getCoordinateSystem().getClass(), CoordinateSystem.class))
+            {
+                return WKTKeywords.GeodeticCRS;
+            } else {
+                return WKTKeywords.EngineeringCRS;
+            }
+        } else if (VerticalCRS.class.isAssignableFrom(type) && derivedCS instanceof VerticalCS) {
+            return WKTKeywords.VerticalCRS;
+        } else if (TemporalCRS.class.isAssignableFrom(type) && derivedCS instanceof TimeCS) {
+            return WKTKeywords.TimeCRS;
+        } else if (ProjectedCRS.class.isAssignableFrom(type) || EngineeringCRS.class.isAssignableFrom(type)) {
+            return WKTKeywords.EngineeringCRS;
+        } else {
+            return null;
+        }
+    }
+
+
+
+
+    /**
+     * A derived geodetic CRS.  Note that base CRS of kind {@link GeodeticCRS} can be used both with this class
+     * and with {@link org.apache.sis.referencing.crs.DefaultDerivedCRS.Engineering}. Consequently an ambiguity
+     * may exist when choosing the kind if {@code DerivedCRS} to create for a given {@code GeodeticCRS}.
+     */
+    @XmlTransient
+    private static final class Geodetic extends DefaultDerivedCRS implements GeodeticCRS {
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = -1263243517380302846L;
+
+        /** Creates a copy of the given CRS. */
+        Geodetic(DerivedCRS other) {
+            super(other);
+        }
+
+        /** Creates a new geodetic CRS derived from the given one. */
+        Geodetic(Map<String,?> properties, GeodeticCRS baseCRS, Conversion conversionFromBase, EllipsoidalCS derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base geodetic CRS. */
+        @Override public GeodeticDatum getDatum() {
+            return (GeodeticDatum) super.getDatum();
+        }
+
+        /** Returns the coordinate system given at construction time. */
+        @Override public EllipsoidalCS getCoordinateSystem() {
+            return (EllipsoidalCS) super.getCoordinateSystem();
+        }
+
+        /** Returns a coordinate reference system of the same type than this CRS but with different axes. */
+        @Override AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem derivedCS) {
+            final Conversion conversionFromBase = getConversionFromBase();
+            return new Geodetic(properties, (GeodeticCRS) conversionFromBase.getSourceCRS(),
+                    conversionFromBase, (EllipsoidalCS) derivedCS);
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return WKTKeywords.GeodeticCRS;
+        }
+    }
+
+    /**
+     * A derived vertical CRS.
+     */
+    @XmlTransient
+    private static final class Vertical extends DefaultDerivedCRS implements VerticalCRS {
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = -5599709829566076972L;
+
+        /** Creates a copy of the given CRS. */
+        Vertical(DerivedCRS other) {
+            super(other);
+        }
+
+        /** Creates a new vertical CRS derived from the given one. */
+        Vertical(Map<String,?> properties, VerticalCRS baseCRS, Conversion conversionFromBase, VerticalCS derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base vertical CRS. */
+        @Override public VerticalDatum getDatum() {
+            return (VerticalDatum) super.getDatum();
+        }
+
+        /** Returns the coordinate system given at construction time. */
+        @Override public VerticalCS getCoordinateSystem() {
+            return (VerticalCS) super.getCoordinateSystem();
+        }
+
+        /** Returns a coordinate reference system of the same type than this CRS but with different axes. */
+        @Override AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem derivedCS) {
+            final Conversion conversionFromBase = getConversionFromBase();
+            return new Vertical(properties, (VerticalCRS) conversionFromBase.getSourceCRS(),
+                    conversionFromBase, (VerticalCS) derivedCS);
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return WKTKeywords.VerticalCRS;
+        }
+    }
+
+    /**
+     * A derived temporal CRS.
+     */
+    @XmlTransient
+    private static final class Temporal extends DefaultDerivedCRS implements TemporalCRS {
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = -4721311735720248819L;
+
+        /** Creates a copy of the given CRS. */
+        Temporal(DerivedCRS other) {
+            super(other);
+        }
+
+        /** Creates a new temporal CRS derived from the given one. */
+        Temporal(Map<String,?> properties, TemporalCRS baseCRS, Conversion conversionFromBase, TimeCS derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base temporal CRS. */
+        @Override public TemporalDatum getDatum() {
+            return (TemporalDatum) super.getDatum();
+        }
+
+        /** Returns the coordinate system given at construction time. */
+        @Override public TimeCS getCoordinateSystem() {
+            return (TimeCS) super.getCoordinateSystem();
+        }
+
+        /** Returns a coordinate reference system of the same type than this CRS but with different axes. */
+        @Override AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem derivedCS) {
+            final Conversion conversionFromBase = getConversionFromBase();
+            return new Temporal(properties, (TemporalCRS) conversionFromBase.getSourceCRS(),
+                    conversionFromBase, (TimeCS) derivedCS);
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return WKTKeywords.TimeCRS;
+        }
+    }
+
+    /**
+     * An derived engineering CRS. ISO 19162 restricts the base CRS to {@code EngineeringCRS}, {@code ProjectedCRS}
+     * or {@code GeodeticCRS}. Note that in the later case, an ambiguity may exist with the
+     * {@link org.apache.sis.referencing.crs.DefaultDerivedCRS.Geodetic} when deciding which {@code DerivedCRS} to
+     * create.
+     */
+    @XmlTransient
+    private static final class Engineering extends DefaultDerivedCRS implements EngineeringCRS {
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = 42334975023270039L;
+
+        /** Creates a copy of the given CRS. */
+        Engineering(DerivedCRS other) {
+            super(other);
+        }
+
+        /** Creates a new temporal CRS derived from the given one. */
+        Engineering(Map<String,?> properties, SingleCRS baseCRS, Conversion conversionFromBase, CoordinateSystem derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base engineering CRS. */
+        @Override public EngineeringDatum getDatum() {
+            final Datum datum = super.getDatum();
+            return (datum instanceof EngineeringDatum) ? (EngineeringDatum) datum : null;
+        }
+
+        /** Returns a coordinate reference system of the same type than this CRS but with different axes. */
+        @Override AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem derivedCS) {
+            final Conversion conversionFromBase = getConversionFromBase();
+            return new Engineering(properties, (SingleCRS) conversionFromBase.getSourceCRS(), conversionFromBase, derivedCS);
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return WKTKeywords.EngineeringCRS;
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -32,13 +32,15 @@ import org.opengis.referencing.cs.UserDe
 import org.opengis.referencing.datum.EngineeringDatum;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.AbstractReferenceSystem;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.Formatter;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 
 /**
- * A contextually local coordinate reference system. It can be divided into two broad categories:
+ * A 1-, 2- or 3-dimensional contextually local coordinate reference system.
+ * It can be divided into two broad categories:
  *
  * <ul>
  *   <li>earth-fixed systems applied to engineering activities on or near the surface of the earth;</li>
@@ -256,11 +258,13 @@ public class DefaultEngineeringCRS exten
      * Formats this CRS as a <cite>Well Known Text</cite> {@code EngineeringCRS[…]} element.
      *
      * @return {@code "EngineeringCRS"} (WKT 2) or {@code "Local_CS"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#74">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
         super.formatTo(formatter);
-        return (formatter.getConvention().majorVersion() == 1) ? "Local_CS"
-               : isBaseCRS(formatter) ? "BaseEngCRS" : "EngineeringCRS";
+        return (formatter.getConvention().majorVersion() == 1) ? WKTKeywords.Local_CS
+               : isBaseCRS(formatter) ? WKTKeywords.BaseEngCRS : WKTKeywords.EngineeringCRS;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -29,8 +29,8 @@ import org.apache.sis.referencing.Abstra
 
 
 /**
- * A 3D coordinate reference system with the origin at the approximate centre of mass of the earth.
- * A geocentric CRS deals with the earth's curvature by taking a 3D spatial view, which obviates
+ * A 3-dimensional coordinate reference system with the origin at the approximate centre of mass of the earth.
+ * A geocentric CRS deals with the earth's curvature by taking a 3-dimensional spatial view, which obviates
  * the need to model the earth's curvature.
  *
  * <p><b>Used with coordinate system type:</b>
@@ -254,6 +254,8 @@ public class DefaultGeocentricCRS extend
      * </div>
      *
      * @return {@code "GeodeticCRS"} (WKT 2) or {@code "GeocCS"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#49">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -29,6 +29,7 @@ import org.opengis.referencing.crs.Geode
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.datum.PrimeMeridian;
 import org.apache.sis.internal.referencing.Legacy;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.referencing.AbstractReferenceSystem;
@@ -40,7 +41,7 @@ import static org.apache.sis.internal.re
 
 
 /**
- * A 2D or 3D coordinate reference system based on a geodetic datum.
+ * A 2- or 3-dimensional coordinate reference system based on a geodetic datum.
  * The CRS is geographic if associated with an ellipsoidal coordinate system,
  * or geocentric if associated with a spherical or Cartesian coordinate system.
  *
@@ -240,9 +241,9 @@ class DefaultGeodeticCRS extends Abstrac
          * have a GeodeticCRS. We need to make the choice in this base class. The CS type is a sufficient criterion.
          */
         if (isWKT1) {
-            return (cs instanceof EllipsoidalCS) ? "GeogCS" : "GeocCS";
+            return (cs instanceof EllipsoidalCS) ? WKTKeywords.GeogCS : WKTKeywords.GeocCS;
         } else {
-            return isBaseCRS ? "BaseGeodCRS" : "GeodeticCRS";
+            return isBaseCRS ? WKTKeywords.BaseGeodCRS : WKTKeywords.GeodeticCRS;
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -43,7 +43,7 @@ import static org.apache.sis.internal.ut
 
 
 /**
- * A coordinate reference system based on an ellipsoidal approximation of the geoid.
+ * A 2- or 3-dimensional coordinate reference system based on an ellipsoidal approximation of the geoid.
  * This provides an accurate representation of the geometry of geographic features
  * for a large portion of the earth's surface.
  *
@@ -301,6 +301,8 @@ public class DefaultGeographicCRS extend
      * </div>
      *
      * @return {@code "GeodeticCRS"} (WKT 2) or {@code "GeogCS"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#49">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -25,6 +25,7 @@ import org.opengis.referencing.cs.Affine
 import org.opengis.referencing.crs.ImageCRS;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.datum.ImageDatum;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.AbstractReferenceSystem;
 import org.apache.sis.io.wkt.Formatter;
@@ -33,9 +34,9 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * An engineering coordinate reference system applied to locations in images. Image coordinate
- * reference systems are treated as a separate sub-type because a separate user community exists
- * for images with its own terms of reference.
+ * A 2-dimensional engineering coordinate reference system applied to locations in images.
+ * Image coordinate reference systems are treated as a separate sub-type because a separate
+ * user community exists for images with its own terms of reference.
  *
  * <p><b>Used with coordinate system types:</b>
  *   {@linkplain org.apache.sis.referencing.cs.DefaultCartesianCS Cartesian} or
@@ -261,6 +262,8 @@ public class DefaultImageCRS extends Abs
      * {@code ImageCRS} are defined in the WKT 2 specification only.</div>
      *
      * @return {@code "ImageCRS"}.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#79">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -268,6 +271,6 @@ public class DefaultImageCRS extends Abs
         if (formatter.getConvention().majorVersion() == 1) {
             formatter.setInvalidWKT(this, null);
         }
-        return "ImageCRS";
+        return WKTKeywords.ImageCRS;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -36,8 +36,10 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.Projection;
 import org.opengis.geometry.MismatchedDimensionException;
 import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.operation.DefaultOperationMethod;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.io.wkt.FormattableObject;
@@ -49,7 +51,7 @@ import static org.apache.sis.internal.re
 
 
 /**
- * A 2D coordinate reference system used to approximate the shape of the earth on a planar surface.
+ * A 2-dimensional coordinate reference system used to approximate the shape of the earth on a planar surface.
  * It is done in such a way that the distortion that is inherent to the approximation is carefully
  * controlled and known. Distortion correction is commonly applied to calculated bearings and
  * distances to produce values that are a close match to actual field values.
@@ -216,7 +218,7 @@ public class DefaultProjectedCRS extends
     @Override
     @XmlElement(name = "baseGeodeticCRS", required = true)  // Note: older GML version used "baseGeographicCRS".
     public GeographicCRS getBaseCRS() {
-        return (GeographicCRS) super.getConversionFromBase().getSourceCRS();
+        return super.getConversionFromBase().getSourceCRS();
     }
 
     /**
@@ -257,6 +259,25 @@ public class DefaultProjectedCRS extends
     }
 
     /**
+     * {@inheritDoc}
+     *
+     * @return {@inheritDoc}
+     */
+    @Override
+    public DefaultProjectedCRS forConvention(final AxesConvention convention) {
+        return (DefaultProjectedCRS) super.forConvention(convention);
+    }
+
+    /**
+     * Returns a coordinate reference system of the same type than this CRS but with different axes.
+     */
+    @Override
+    final AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem cs) {
+        final Projection conversion = super.getConversionFromBase();
+        return new DefaultProjectedCRS(properties, conversion.getSourceCRS(), conversion, (CartesianCS) cs);
+    }
+
+    /**
      * Compares this coordinate reference system with the specified object for equality.
      *
      * @param  object The object to compare to {@code this}.
@@ -331,6 +352,8 @@ public class DefaultProjectedCRS extends
      * </div>
      *
      * @return {@code "ProjectedCRS"} (WKT 2) or {@code "ProjCS"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#57">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -367,7 +390,7 @@ public class DefaultProjectedCRS extends
         }
         formatter.removeContextualUnit(unit);
         formatter.addContextualUnit(oldUnit);
-        return isWKT1 ? "ProjCS" : isBaseCRS ? "BaseProjCRS" : "ProjectedCRS";
+        return isWKT1 ? WKTKeywords.ProjCS : isBaseCRS ? WKTKeywords.BaseProjCRS : WKTKeywords.ProjectedCRS;
     }
 
     /**
@@ -391,7 +414,7 @@ public class DefaultProjectedCRS extends
             WKTUtilities.appendName(conversion, formatter, null);
             formatter.newLine();
             append(formatter);
-            return "Conversion";
+            return WKTKeywords.Conversion;
         }
 
         /** Formats this {@code Conversion} element without the conversion name. */

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -29,6 +29,7 @@ import org.opengis.referencing.crs.Tempo
 import org.opengis.referencing.datum.TemporalDatum;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.AbstractReferenceSystem;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.measure.Units;
 
@@ -36,7 +37,7 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * A 1D coordinate reference system used for the recording of time.
+ * A 1-dimensional coordinate reference system used for the recording of time.
  * The Apache SIS implementation provides the following methods in addition to the OGC/ISO properties:
  *
  * <ul>
@@ -304,6 +305,8 @@ public class DefaultTemporalCRS extends
      * {@code TimeCRS} is defined in the WKT 2 specification only.</div>
      *
      * @return {@code "TimeCRS"}.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#88">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -311,6 +314,6 @@ public class DefaultTemporalCRS extends
         if (formatter.getConvention().majorVersion() == 1) {
             formatter.setInvalidWKT(this, null);
         }
-        return isBaseCRS(formatter) ? "BaseTimeCRS" : "TimeCRS";
+        return isBaseCRS(formatter) ? WKTKeywords.BaseTimeCRS : WKTKeywords.TimeCRS;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -26,13 +26,14 @@ import org.opengis.referencing.crs.Verti
 import org.opengis.referencing.datum.VerticalDatum;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.AbstractReferenceSystem;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.Formatter;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 
 /**
- * A 1D coordinate reference system used for recording heights or depths.
+ * A 1-dimensional coordinate reference system used for recording heights or depths.
  * Vertical CRSs make use of the direction of gravity to define the concept of height or depth,
  * but the relationship with gravity may not be straightforward.
  *
@@ -234,11 +235,13 @@ public class DefaultVerticalCRS extends
      * Formats this CRS as a <cite>Well Known Text</cite> {@code VerticalCRS[…]} element.
      *
      * @return {@code "VerticalCRS"} (WKT 2) or {@code "Vert_CS"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#69">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
         super.formatTo(formatter);
-        return (formatter.getConvention().majorVersion() == 1) ? "Vert_CS"
-               : isBaseCRS(formatter) ? "BaseVertCRS" : "VerticalCRS";
+        return (formatter.getConvention().majorVersion() == 1) ? WKTKeywords.Vert_CS
+               : isBaseCRS(formatter) ? WKTKeywords.BaseVertCRS : WKTKeywords.VerticalCRS;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] Thu May  7 21:46:06 2015
@@ -35,6 +35,7 @@ import org.opengis.referencing.cs.Coordi
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.referencing.AxisDirections;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.resources.Errors;
@@ -438,6 +439,8 @@ public class AbstractCS extends Abstract
      * {@code CS} is defined in the WKT 2 specification only.</div>
      *
      * @return {@code "CS"}.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#36">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -447,6 +450,6 @@ public class AbstractCS extends Abstract
         }
         formatter.append(type, null);
         formatter.append(getDimension());
-        return "CS";
+        return WKTKeywords.CS;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java [UTF-8] Thu May  7 21:46:06 2015
@@ -209,14 +209,16 @@ public final class CoordinateSystems ext
 
     /**
      * Returns an affine transform between two coordinate systems.
-     * The two coordinate systems must implement the same GeoAPI coordinate system interface.
-     * For example if {@code sourceCRS} is a {@link org.opengis.referencing.cs.CartesianCS},
-     * then {@code targetCRS} must be a {@code CartesianCS} too.
      * Only units and axes order (e.g. transforming from
      * ({@linkplain AxisDirection#NORTH North}, {@linkplain AxisDirection#WEST West}) to
      * ({@linkplain AxisDirection#EAST East}, {@linkplain AxisDirection#NORTH North})
      * are taken in account by this method.
      *
+     * <div class="section">Conditions</div>
+     * The two coordinate systems must implement the same GeoAPI coordinate system interface.
+     * For example if {@code sourceCS} is a {@link org.opengis.referencing.cs.CartesianCS},
+     * then {@code targetCS} must be a {@code CartesianCS} too.
+     *
      * <div class="note"><b>Example:</b>
      * If coordinates in {@code sourceCS} are (<var>x</var>,<var>y</var>) tuples in metres
      * and coordinates in {@code targetCS} are (<var>-y</var>,<var>x</var>) tuples in centimetres,

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] Thu May  7 21:46:06 2015
@@ -38,7 +38,9 @@ import org.opengis.referencing.cs.Spheri
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.referencing.AxisDirections;
+import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.NamedIdentifier;
@@ -54,7 +56,6 @@ import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.io.wkt.CharEncoding;
 import org.apache.sis.io.wkt.FormattableObject;
-import org.apache.sis.internal.referencing.ReferencingUtilities;
 
 import static java.lang.Double.doubleToLongBits;
 import static java.lang.Double.NEGATIVE_INFINITY;
@@ -779,6 +780,8 @@ public class DefaultCoordinateSystemAxis
      * {@link org.apache.sis.io.wkt.WKTFormat#setCharEncoding(CharEncoding)}.
      *
      * @return {@code "Axis"}.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#39">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -853,7 +856,7 @@ public class DefaultCoordinateSystemAxis
                 formatter.append(getUnit());
             }
         }
-        return "Axis";
+        return WKTKeywords.Axis;
     }
 
     /**
@@ -906,7 +909,7 @@ public class DefaultCoordinateSystemAxis
         @Override
         protected String formatTo(final Formatter formatter) {
             formatter.append(index);
-            return "Order";
+            return WKTKeywords.Order;
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java [UTF-8] Thu May  7 21:46:06 2015
@@ -24,6 +24,7 @@ import org.apache.sis.util.iso.Types;
 import org.apache.sis.measure.Longitude;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.referencing.AxisDirections;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 
@@ -292,11 +293,13 @@ final class DirectionAlongMeridian exten
      *
      * @param  formatter The formatter where to format the inner content of this WKT element.
      * @return {@code "Meridian"}.
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#40">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
         formatter.append(meridian);
         formatter.append(NonSI.DEGREE_ANGLE);
-        return "Meridian";
+        return WKTKeywords.Meridian;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java [UTF-8] Thu May  7 21:46:06 2015
@@ -29,6 +29,7 @@ import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.util.DoubleDouble;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 
@@ -606,7 +607,7 @@ public class BursaWolfParameters extends
         formatter.append(rZ);
         formatter.append(dS);
         if (isToWGS84()) {
-            return "ToWGS84";
+            return WKTKeywords.ToWGS84;
         }
         formatter.setInvalidWKT(BursaWolfParameters.class, null);
         String name = IdentifiedObjects.getUnicodeIdentifier(getTargetDatum());

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java?rev=1678265&r1=1678264&r2=1678265&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] Thu May  7 21:46:06 2015
@@ -35,6 +35,7 @@ import org.apache.sis.internal.jaxb.gco.
 import org.apache.sis.internal.jaxb.referencing.SecondDefiningParameter;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.referencing.Formulas;
+import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.io.wkt.Formatter;
@@ -757,6 +758,8 @@ public class DefaultEllipsoid extends Ab
      * Formats this ellipsoid as a <cite>Well Known Text</cite> {@code Ellipsoid[…]} element.
      *
      * @return {@code "Ellipsoid"} (WKT 2) or {@code "Spheroid"} (WKT 1).
+     *
+     * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#52">WKT 2 specification</a>
      */
     @Override
     protected String formatTo(final Formatter formatter) {
@@ -772,11 +775,11 @@ public class DefaultEllipsoid extends Ab
         final double inverseFlattening = getInverseFlattening();  // Gives to users a chance to override properties.
         formatter.append(isInfinite(inverseFlattening) ? 0 : inverseFlattening);
         if (isWKT1) {
-            return "Spheroid";
+            return WKTKeywords.Spheroid;
         }
         if (!convention.isSimplified() || !SI.METRE.equals(unit)) {
             formatter.append(unit);
         }
-        return "Ellipsoid";
+        return WKTKeywords.Ellipsoid;
     }
 }



Mime
View raw message