sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1724528 [3/15] - in /sis/branches/JDK6: ./ application/sis-console/src/main/artifact/bin/ application/sis-console/src/main/artifact/log/ application/sis-console/src/main/java/org/apache/sis/console/ core/sis-build-helper/src/main/java/org/...
Date Wed, 13 Jan 2016 23:25:42 GMT
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -122,7 +122,7 @@ public final class CRS extends Static {
      *   <tr><td>EPSG:4979</td> <td>{@link CommonCRS#WGS84  WGS84}</td>  <td>Geographic 3D</td> <td>World Geodetic System 1984</td></tr>
      *   <tr><td>EPSG:4984</td> <td>{@link CommonCRS#WGS72  WGS72}</td>  <td>Geocentric</td>    <td>World Geodetic System 1972</td></tr>
      *   <tr><td>EPSG:4985</td> <td>{@link CommonCRS#WGS72  WGS72}</td>  <td>Geographic 3D</td> <td>World Geodetic System 1972</td></tr>
-     *   <tr><td>EPSG:5715</td> <td>{@link CommonCRS.Vertical#DEPTH  DEPTH}</td> <td>Vertical</td> <td>Mean Sea Level depth</td></tr>
+     *   <tr><td>EPSG:5715</td> <td>{@link CommonCRS.Vertical#DEPTH DEPTH}</td> <td>Vertical</td> <td>Mean Sea Level depth</td></tr>
      *   <tr><td>EPSG:5714</td> <td>{@link CommonCRS.Vertical#MEAN_SEA_LEVEL MEAN_SEA_LEVEL}</td> <td>Vertical</td> <td>Mean Sea Level height</td></tr>
      * </table></blockquote>
      *
@@ -138,6 +138,8 @@ public final class CRS extends Static {
      * @throws NoSuchAuthorityCodeException If there is no known CRS associated to the given code.
      * @throws FactoryException if the CRS creation failed for an other reason.
      *
+     * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory
+     *
      * @category factory
      */
     public static CoordinateReferenceSystem forCode(final String code)
@@ -260,7 +262,7 @@ public final class CRS extends Static {
      * CRS as horizontal if it is two-dimensional and comply with one of the following conditions:
      *
      * <ul>
-     *   <li>is an instance of {@link GeographicCRS}, or</li>
+     *   <li>is an instance of {@link GeographicCRS} (or an equivalent {@link GeodeticCRS}), or</li>
      *   <li>is an instance of {@link ProjectedCRS}, or</li>
      *   <li>is an instance of {@link EngineeringCRS} (following
      *     <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#111">ISO 19162 §16.1</a>
@@ -282,8 +284,17 @@ public final class CRS extends Static {
      * @category information
      */
     public static boolean isHorizontalCRS(final CoordinateReferenceSystem crs) {
-        if (crs instanceof GeographicCRS || crs instanceof ProjectedCRS || crs instanceof EngineeringCRS) {
-            return crs.getCoordinateSystem().getDimension() == 2;
+        /*
+         * In order to determine if the CRS is geographic, checking the CoordinateSystem type is more reliable
+         * then checking if the CRS implements the GeographicCRS interface.  This is because the GeographicCRS
+         * interface is GeoAPI-specific, so a CRS may be OGC-compliant without implementing that interface.
+         */
+        final boolean isGeodetic = (crs instanceof GeodeticCRS);
+        if (isGeodetic || crs instanceof ProjectedCRS || crs instanceof EngineeringCRS) {
+            final CoordinateSystem cs = crs.getCoordinateSystem();
+            if (cs.getDimension() == 2) {
+                return !isGeodetic || (cs instanceof EllipsoidalCS);
+            }
         }
         return false;
     }
@@ -307,21 +318,24 @@ public final class CRS extends Static {
         if (isHorizontalCRS(crs)) {
             return (SingleCRS) crs;
         }
-        if (crs instanceof GeographicCRS) {
-            EllipsoidalCS cs = ((GeographicCRS) crs).getCoordinateSystem();
-            final int i = AxisDirections.indexOfColinear(cs, AxisDirection.UP);
-            if (i >= 0) {
-                final CoordinateSystemAxis xAxis = cs.getAxis(i > 0 ? 0 : 1);
-                final CoordinateSystemAxis yAxis = cs.getAxis(i > 1 ? 1 : 2);
-                cs = CommonCRS.DEFAULT.geographic().getCoordinateSystem();
-                if (!Utilities.equalsIgnoreMetadata(cs.getAxis(0), xAxis) ||
-                    !Utilities.equalsIgnoreMetadata(cs.getAxis(1), yAxis))
-                {
-                    // We can not reuse the name of the existing CS, because it typically
-                    // contains text about axes including the axis that we just dropped.
-                    cs = new DefaultEllipsoidalCS(singletonMap(EllipsoidalCS.NAME_KEY, "Ellipsoidal 2D"), xAxis, yAxis);
+        if (crs instanceof GeodeticCRS) {
+            CoordinateSystem cs = crs.getCoordinateSystem();
+            if (cs instanceof EllipsoidalCS) {  // See comment in isHorizontalCRS(…) method.
+                final int i = AxisDirections.indexOfColinear(cs, AxisDirection.UP);
+                if (i >= 0) {
+                    final CoordinateSystemAxis xAxis = cs.getAxis(i > 0 ? 0 : 1);
+                    final CoordinateSystemAxis yAxis = cs.getAxis(i > 1 ? 1 : 2);
+                    cs = CommonCRS.DEFAULT.geographic().getCoordinateSystem();
+                    if (!Utilities.equalsIgnoreMetadata(cs.getAxis(0), xAxis) ||
+                        !Utilities.equalsIgnoreMetadata(cs.getAxis(1), yAxis))
+                    {
+                        // We can not reuse the name of the existing CS, because it typically
+                        // contains text about axes including the axis that we just dropped.
+                        cs = new DefaultEllipsoidalCS(singletonMap(EllipsoidalCS.NAME_KEY, "Ellipsoidal 2D"), xAxis, yAxis);
+                    }
+                    return new DefaultGeographicCRS(IdentifiedObjects.getProperties(crs),
+                            ((GeodeticCRS) crs).getDatum(), (EllipsoidalCS) cs);
                 }
-                return new DefaultGeographicCRS(IdentifiedObjects.getProperties(crs), ((GeographicCRS) crs).getDatum(), cs);
             }
         }
         if (crs instanceof CompoundCRS) {
@@ -384,17 +398,19 @@ public final class CRS extends Static {
                 }
             } while ((a = !a) == allowCreateEllipsoidal);
         }
-        if (allowCreateEllipsoidal && crs instanceof GeographicCRS) {
+        if (allowCreateEllipsoidal && crs instanceof GeodeticCRS) {
             final CoordinateSystem cs = crs.getCoordinateSystem();
-            final int i = AxisDirections.indexOfColinear(cs, AxisDirection.UP);
-            if (i >= 0) {
-                final CoordinateSystemAxis axis = cs.getAxis(i);
-                VerticalCRS c = CommonCRS.Vertical.ELLIPSOIDAL.crs();
-                if (!c.getCoordinateSystem().getAxis(0).equals(axis)) {
-                    final Map<String,?> properties = IdentifiedObjects.getProperties(c);
-                    c = new DefaultVerticalCRS(properties, c.getDatum(), new DefaultVerticalCS(properties, axis));
+            if (cs instanceof EllipsoidalCS) {  // See comment in isHorizontalCRS(…) method.
+                final int i = AxisDirections.indexOfColinear(cs, AxisDirection.UP);
+                if (i >= 0) {
+                    final CoordinateSystemAxis axis = cs.getAxis(i);
+                    VerticalCRS c = CommonCRS.Vertical.ELLIPSOIDAL.crs();
+                    if (!c.getCoordinateSystem().getAxis(0).equals(axis)) {
+                        final Map<String,?> properties = IdentifiedObjects.getProperties(c);
+                        c = new DefaultVerticalCRS(properties, c.getDatum(), new DefaultVerticalCS(properties, axis));
+                    }
+                    return c;
                 }
-                return c;
             }
         }
         return null;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -18,6 +18,8 @@ package org.apache.sis.referencing;
 
 import java.util.Map;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.measure.unit.Unit;
@@ -32,7 +34,9 @@ import org.opengis.referencing.crs.Verti
 import org.opengis.referencing.crs.TemporalCRS;
 import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.referencing.crs.GeocentricCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.crs.CRSAuthorityFactory;
 import org.opengis.referencing.cs.TimeCS;
 import org.opengis.referencing.cs.VerticalCS;
 import org.opengis.referencing.cs.CartesianCS;
@@ -45,7 +49,6 @@ import org.opengis.referencing.datum.Ver
 import org.opengis.referencing.datum.VerticalDatumType;
 import org.opengis.referencing.datum.TemporalDatum;
 import org.opengis.referencing.datum.DatumAuthorityFactory;
-import org.opengis.referencing.crs.CRSAuthorityFactory;
 import org.apache.sis.referencing.datum.DefaultVerticalDatum;
 import org.apache.sis.referencing.datum.DefaultTemporalDatum;
 import org.apache.sis.referencing.cs.AxesConvention;
@@ -56,12 +59,17 @@ import org.apache.sis.referencing.crs.De
 import org.apache.sis.referencing.crs.DefaultVerticalCRS;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.DefaultGeocentricCRS;
+import org.apache.sis.internal.referencing.provider.TransverseMercator;
+import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.system.SystemListener;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.logging.Logging;
+import org.apache.sis.util.ArgumentChecks;
+import org.apache.sis.math.MathFunctions;
+import org.apache.sis.measure.Latitude;
 import org.apache.sis.measure.Units;
 
 import static java.util.Collections.singletonMap;
@@ -72,6 +80,9 @@ import static org.apache.sis.internal.ut
 import static org.apache.sis.internal.util.Constants.CRS83;
 import static org.apache.sis.internal.util.Constants.CRS84;
 
+// Branch-dependent imports
+import org.apache.sis.internal.jdk8.JDK8;
+
 
 /**
  * Frequently-used geodetic CRS and datum that are guaranteed to be available in SIS.
@@ -115,9 +126,12 @@ import static org.apache.sis.internal.ut
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.5
+ * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.CommonAuthorityFactory
  */
+@SuppressWarnings("DoubleCheckedLocking")
 public enum CommonCRS {
     /**
      * World Geodetic System 1984.
@@ -133,9 +147,11 @@ public enum CommonCRS {
      *   <tr><th>Semi-minor axis length:</th>  <td>6356752 <i>(approximative)</i></td></tr>
      *   <tr><th>Inverse flattening:</th>      <td>298.257223563 <i>(definitive)</i></td></tr>
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
+     *   <tr><th>UTM zones:</th>               <td>1 to 60 in North and South hemispheres</td></tr>
      * </table></blockquote>
      */
-    WGS84((short) 4326, (short) 4979, (short) 4978, (short) 6326, (short) 7030),
+    WGS84((short) 4326, (short) 4979, (short) 4978, (short) 6326, (short) 7030,     // Geodetic info
+          (short) 32600, (short) 32700, (byte) 1, (byte) 60),                       // UTM info
 
     /**
      * World Geodetic System 1972.
@@ -149,32 +165,11 @@ public enum CommonCRS {
      *   <tr><th>Semi-minor axis length:</th>  <td>6356751 <i>(approximative)</i></td></tr>
      *   <tr><th>Inverse flattening:</th>      <td>298.26 <i>(definitive)</i></td></tr>
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
+     *   <tr><th>UTM zones:</th>               <td>1 to 60 in North and South hemispheres</td></tr>
      * </table></blockquote>
      */
-    WGS72((short) 4322, (short) 4985, (short) 4984, (short) 6322, (short) 7043),
-
-    /**
-     * European Terrestrial Reference System 1989.
-     * The ellipsoid is <cite>"GRS 1980"</cite>, also known as <cite>"International 1979"</cite>.
-     * This ellipsoid is very close, but not identical, to the {@linkplain #WGS84} one.
-     *
-     * <blockquote><table class="compact" summary="ETRS89 properties.">
-     *   <tr><th>EPSG identifiers:</th>        <td>4258 &nbsp;(<i>datum:</i> 6258, &nbsp;<i>ellipsoid:</i> 7019)</td></tr>
-     *   <tr><th>Primary names:</th>           <td>"ETRS89" &nbsp;(<i>datum:</i> "European Terrestrial Reference System 1989", &nbsp;<i>ellipsoid:</i> "GRS 1980")</td></tr>
-     *   <tr><th>Abbreviations or aliases:</th><td>"ETRF89", "EUREF89", "ETRS89-GRS80" &nbsp;(<i>ellipsoid:</i> "International 1979")</td></tr>
-     *   <tr><th>Prime meridian:</th>          <td>Greenwich</td></tr>
-     *   <tr><th>Semi-major axis length:</th>  <td>6378137</td></tr>
-     *   <tr><th>Semi-minor axis length:</th>  <td>6356752 <i>(approximative)</i></td></tr>
-     *   <tr><th>Inverse flattening:</th>      <td>298.257222101 <i>(definitive)</i></td></tr>
-     *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
-     * </table></blockquote>
-     *
-     * <div class="note"><b>Note:</b>
-     * {@link #NAD83} uses the same ellipsoid for a different datum.
-     * The <cite>Web Map Server</cite> {@code "CRS:83"} authority code uses the NAD83 datum,
-     * while the {@code "IGNF:MILLER"} authority code uses the GRS80 datum.</div>
-     */
-    ETRS89((short) 4258, (short) 4937, (short) 4936, (short) 6258, (short) 7019),
+    WGS72((short) 4322, (short) 4985, (short) 4984, (short) 6322, (short) 7043,     // Geodetic info
+          (short) 32200, (short) 32300, (byte) 1, (byte) 60),                       // UTM info
 
     /**
      * North American Datum 1983.
@@ -191,6 +186,7 @@ public enum CommonCRS {
      *   <tr><th>Semi-minor axis length:</th>  <td>6356752 <i>(approximative)</i></td></tr>
      *   <tr><th>Inverse flattening:</th>      <td>298.257222101 <i>(definitive)</i></td></tr>
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
+     *   <tr><th>UTM zones:</th>               <td>1 to 23 in the North hemisphere</td></tr>
      * </table></blockquote>
      *
      * <div class="note"><b>Note:</b>
@@ -198,7 +194,8 @@ public enum CommonCRS {
      * The <cite>Web Map Server</cite> {@code "CRS:83"} authority code uses the NAD83 datum,
      * while the {@code "IGNF:MILLER"} authority code uses the GRS80 datum.</div>
      */
-    NAD83((short) 4269, (short) 0, (short) 0, (short) 6269, (short) 7019),
+    NAD83((short) 4269, (short) 0, (short) 0, (short) 6269, (short) 7019,           // Geodetic info
+          (short) 26900, (short) 0, (byte) 1, (byte) 23),                           // UTM info
 
     /**
      * North American Datum 1927.
@@ -212,9 +209,36 @@ public enum CommonCRS {
      *   <tr><th>Semi-major axis length:</th>  <td>6378206.4</td></tr>
      *   <tr><th>Semi-minor axis length:</th>  <td>6356583.8 <i>(definitive)</i></td></tr>
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
+     *   <tr><th>UTM zones:</th>               <td>1 to 22 in the North hemisphere</td></tr>
      * </table></blockquote>
      */
-    NAD27((short) 4267, (short) 0, (short) 0, (short) 6267, (short) 7008),
+    NAD27((short) 4267, (short) 0, (short) 0, (short) 6267, (short) 7008,           // Geodetic info
+          (short) 26700, (short) 0, (byte) 1, (byte) 22),                           // UTM info
+
+    /**
+     * European Terrestrial Reference System 1989.
+     * The ellipsoid is <cite>"GRS 1980"</cite>, also known as <cite>"International 1979"</cite>.
+     * This ellipsoid is very close, but not identical, to the {@linkplain #WGS84} one.
+     *
+     * <blockquote><table class="compact" summary="ETRS89 properties.">
+     *   <tr><th>EPSG identifiers:</th>        <td>4258 &nbsp;(<i>datum:</i> 6258, &nbsp;<i>ellipsoid:</i> 7019)</td></tr>
+     *   <tr><th>Primary names:</th>           <td>"ETRS89" &nbsp;(<i>datum:</i> "European Terrestrial Reference System 1989", &nbsp;<i>ellipsoid:</i> "GRS 1980")</td></tr>
+     *   <tr><th>Abbreviations or aliases:</th><td>"ETRF89", "EUREF89", "ETRS89-GRS80" &nbsp;(<i>ellipsoid:</i> "International 1979")</td></tr>
+     *   <tr><th>Prime meridian:</th>          <td>Greenwich</td></tr>
+     *   <tr><th>Semi-major axis length:</th>  <td>6378137</td></tr>
+     *   <tr><th>Semi-minor axis length:</th>  <td>6356752 <i>(approximative)</i></td></tr>
+     *   <tr><th>Inverse flattening:</th>      <td>298.257222101 <i>(definitive)</i></td></tr>
+     *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
+     *   <tr><th>UTM zones:</th>               <td>28 to 38 in the North hemisphere</td></tr>
+     * </table></blockquote>
+     *
+     * <div class="note"><b>Note:</b>
+     * {@link #NAD83} uses the same ellipsoid for a different datum.
+     * The <cite>Web Map Server</cite> {@code "CRS:83"} authority code uses the NAD83 datum,
+     * while the {@code "IGNF:MILLER"} authority code uses the GRS80 datum.</div>
+     */
+    ETRS89((short) 4258, (short) 4937, (short) 4936, (short) 6258, (short) 7019,    // Geodetic info
+           (short) 25800, (short) 0, (byte) 28, (byte) 38),                         // UTM info
 
     /**
      * European Datum 1950.
@@ -228,9 +252,11 @@ public enum CommonCRS {
      *   <tr><th>Semi-minor axis length:</th>  <td>6356912 <i>(approximative)</i></td></tr>
      *   <tr><th>Inverse flattening:</th>      <td>297 <i>(definitive)</i></td></tr>
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
+     *   <tr><th>UTM zones:</th>               <td>28 to 38 in the North hemisphere</td></tr>
      * </table></blockquote>
      */
-    ED50((short) 4230, (short) 0, (short) 0, (short) 6230, (short) 7022),
+    ED50((short) 4230, (short) 0, (short) 0, (short) 6230, (short) 7022,            // Geodetic info
+           (short) 23000, (short) 0, (byte) 28, (byte) 38),                         // UTM info
 
     /**
      * Unspecified datum based upon the GRS 1980 Authalic Sphere. Spheres use a simpler algorithm for
@@ -248,7 +274,8 @@ public enum CommonCRS {
      *
      * @see org.apache.sis.referencing.datum.DefaultEllipsoid#getAuthalicRadius()
      */
-    SPHERE((short) 4047, (short) 0, (short) 0, (short) 6047, (short) 7048);
+    SPHERE((short) 4047, (short) 0, (short) 0, (short) 6047, (short) 7048,          // Geodetic info
+           (short) 0, (short) 0, (byte) 0, (byte) 0);                               // UTM info
 
     /**
      * The enum for the default CRS.
@@ -285,6 +312,16 @@ public enum CommonCRS {
     final short ellipsoid;
 
     /**
+     * EPSG codes of pseudo "UTM zone zero" (North case and South case), or 0 if none.
+     */
+    final short northUTM, southUTM;
+
+    /**
+     * Zone number of the first UTM and last UTM zone defined in the EPSG database, inclusive.
+     */
+    final byte firstZone, lastZone;
+
+    /**
      * The cached object. This is initially {@code null}, then set to various kind of objects depending
      * on which method has been invoked. The kind of object stored in this field may change during the
      * application execution.
@@ -313,6 +350,14 @@ public enum CommonCRS {
     private transient volatile GeocentricCRS cachedGeocentric;
 
     /**
+     * The Universal Transverse Mercator projections, created when first needed.
+     * All accesses to this map shall be synchronized on {@code cachedUTM}.
+     *
+     * @see #UTM(double, double)
+     */
+    private final Map<Integer,ProjectedCRS> cachedUTM;
+
+    /**
      * Creates a new constant for the given EPSG or SIS codes.
      *
      * @param geographic The EPSG code for the two-dimensional geographic CRS.
@@ -321,14 +366,19 @@ public enum CommonCRS {
      * @param datum      The EPSG code for the datum.
      * @param ellipsoid  The EPSG code for the ellipsoid.
      */
-    private CommonCRS(final short geographic, final short geo3D, final short geocentric,
-            final short datum, final short ellipsoid)
+    private CommonCRS(final short geographic, final short geo3D, final short geocentric, final short datum, final short ellipsoid,
+            final short northUTM, final short southUTM, final byte firstZone, final byte lastZone)
     {
         this.geographic = geographic;
         this.geocentric = geocentric;
         this.geo3D      = geo3D;
         this.datum      = datum;
         this.ellipsoid  = ellipsoid;
+        this.northUTM   = northUTM;
+        this.southUTM   = southUTM;
+        this.firstZone  = firstZone;
+        this.lastZone   = lastZone;
+        cachedUTM = new HashMap<Integer,ProjectedCRS>();
     }
 
     /**
@@ -348,11 +398,15 @@ public enum CommonCRS {
     /**
      * Invoked by when the cache needs to be cleared after a classpath change.
      */
+    @SuppressWarnings("NestedSynchronizedStatement")    // Safe because cachedUTM never call any method of 'this'.
     synchronized void clear() {
         cached           = null;
         cachedGeo3D      = null;
         cachedNormalized = null;
         cachedGeocentric = null;
+        synchronized (cachedUTM) {
+            cachedUTM.clear();
+        }
     }
 
     /**
@@ -460,7 +514,7 @@ public enum CommonCRS {
                         failure(this, "geographic", e);
                     }
                     /*
-                     * All constants defined in this enumeration use the same coordinate system, EPSG:6422.
+                     * All constants defined in this enumeration use the same coordinate system, EPSG::6422.
                      * We will arbitrarily create this CS only for the most frequently created CRS,
                      * and share that CS instance for all other constants.
                      */
@@ -517,7 +571,7 @@ public enum CommonCRS {
                         }
                     }
                     /*
-                     * All constants defined in this enumeration use the same coordinate system, EPSG:6423.
+                     * All constants defined in this enumeration use the same coordinate system, EPSG::6423.
                      * We will arbitrarily create this CS only for the most frequently created CRS,
                      * and share that CS instance for all other constants.
                      */
@@ -575,7 +629,7 @@ public enum CommonCRS {
                         }
                     }
                     /*
-                     * All constants defined in this enumeration use the same coordinate system, EPSG:6500.
+                     * All constants defined in this enumeration use the same coordinate system, EPSG::6500.
                      * We will arbitrarily create this CS only for the most frequently created CRS,
                      * and share that CS instance for all other constants.
                      */
@@ -664,7 +718,7 @@ public enum CommonCRS {
                 object = ellipsoid(cached);
                 if (object == null) {
                     if (this == NAD83) {
-                        object = ETRS89.ellipsoid(); // Share the same instance for NAD83 and ETRS89.
+                        object = ETRS89.ellipsoid();            // Share the same instance for NAD83 and ETRS89.
                     } else {
                         final DatumAuthorityFactory factory = datumFactory();
                         if (factory != null) try {
@@ -704,7 +758,7 @@ public enum CommonCRS {
                 object = primeMeridian(cached);
                 if (object == null) {
                     if (this != DEFAULT) {
-                        object = DEFAULT.primeMeridian(); // Share the same instance for all constants.
+                        object = DEFAULT.primeMeridian();           // Share the same instance for all constants.
                     } else {
                         final DatumAuthorityFactory factory = datumFactory();
                         if (factory != null) try {
@@ -764,6 +818,130 @@ public enum CommonCRS {
         return (datum != null) ? datum.getPrimeMeridian() : null;
     }
 
+    /*
+     * NOTE ABOUT MAP PROJECTION CONVENIENCE METHODS:
+     * There is no convenience method for projections other than UTM because this enumeration is not a
+     * factory for arbitrary CRS (the UTM projection has the advantage of being constrained to zones).
+     * World-wide projections like "WGS 84 / World Mercator" are not handled neither because they make
+     * sense only for some datum like WGS84 or WGS72. Application to more regional datum like NAD27 or
+     * ED50 would be more questionable.
+     */
+
+    /**
+     * Returns a Universal Transverse Mercator (UTM) projection for the zone containing the given point.
+     * There is a total of 120 UTM zones, with 60 zones in the North hemisphere and 60 zones in the South hemisphere.
+     * The projection zone is determined from the arguments as below:
+     *
+     * <ul>
+     *   <li>The sign of the <var>latitude</var> argument determines the hemisphere:
+     *       North for positive latitudes (including positive zero) or
+     *       South for negative latitudes (including negative zero).
+     *       The latitude magnitude is ignored, except for ensuring that the latitude is inside the [-90 … 90]° range.</li>
+     *   <li>The value of the <var>longitude</var> argument determines the 6°-width zone,
+     *       numbered from 1 for the zone starting at 180°W up to 60 for the zone finishing at 180°E.
+     *       Longitudes outside the [-180 … 180]° range will be rolled as needed before to compute the zone.</li>
+     * </ul>
+     *
+     * <div class="note"><b>Warning:</b>
+     * be aware of parameter order! For this method, latitude is first.
+     * This order is for consistency with the non-normalized {@linkplain #geographic() geographic} CRS
+     * of all items in this {@code CommonCRS} enumeration.</div>
+     *
+     * The map projection uses the following parameters:
+     *
+     * <blockquote><table class="sis">
+     *   <caption>Universal Transverse Mercator (UTM) parameters</caption>
+     *   <tr><th>Parameter name</th>                 <th>Value</th></tr>
+     *   <tr><td>Latitude of natural origin</td>     <td>0°</td></tr>
+     *   <tr><td>Longitude of natural origin</td>    <td>Central meridian of the UTM zone containing the given longitude</td></tr>
+     *   <tr><td>Scale factor at natural origin</td> <td>0.9996</td></tr>
+     *   <tr><td>False easting</td>                  <td>500000 metres</td></tr>
+     *   <tr><td>False northing</td>                 <td>0 (North hemisphere) or 10000000 (South hemisphere) metres</td></tr>
+     * </table></blockquote>
+     *
+     * The coordinate system axes are (Easting, Northing) in metres.
+     *
+     * @param  latitude  A latitude in the desired UTM projection zone.
+     * @param  longitude A longitude in the desired UTM projection zone.
+     * @return A Universal Transverse Mercator projection for the zone containing the given point.
+     *
+     * @since 0.7
+     */
+    public ProjectedCRS UTM(final double latitude, final double longitude) {
+        ArgumentChecks.ensureBetween("latitude",   Latitude.MIN_VALUE,     Latitude.MAX_VALUE,     latitude);
+        ArgumentChecks.ensureBetween("longitude", -Formulas.LONGITUDE_MAX, Formulas.LONGITUDE_MAX, longitude);
+        final boolean isSouth = MathFunctions.isNegative(latitude);
+        final int zone = TransverseMercator.zone(longitude);
+        final Integer key = isSouth ? -zone : zone;
+        ProjectedCRS crs;
+        synchronized (cachedUTM) {
+            crs = cachedUTM.get(key);
+        }
+        if (crs == null) {
+            int code = 0;
+            if (zone >= firstZone && zone <= lastZone) {
+                code = JDK8.toUnsignedInt(isSouth ? southUTM : northUTM);
+                if (code != 0) {
+                    code += zone;
+                    final CRSAuthorityFactory factory = crsFactory();
+                    if (factory != null) try {
+                        return factory.createProjectedCRS(String.valueOf(code));
+                    } catch (FactoryException e) {
+                        failure(this, "UTM", e);
+                    }
+                }
+            }
+            /*
+             * All constants defined in this enumeration use the same coordinate system, EPSG::4400.
+             * We will arbitrarily create this CS only for a frequently created CRS, and share that
+             * CS instance for all other constants.
+             */
+            CartesianCS cs = null;
+            synchronized (DEFAULT.cachedUTM) {
+                final Iterator<ProjectedCRS> it = DEFAULT.cachedUTM.values().iterator();
+                if (it.hasNext()) {
+                    cs = it.next().getCoordinateSystem();
+                }
+            }
+            if (cs == null) {
+                if (this != DEFAULT) {
+                    cs = DEFAULT.UTM(latitude, longitude).getCoordinateSystem();
+                } else {
+                    cs = (CartesianCS) StandardDefinitions.createCoordinateSystem((short) 4400);
+                }
+            }
+            crs = StandardDefinitions.createUTM(code, geographic(), latitude, longitude, cs);
+            final ProjectedCRS other;
+            synchronized (cachedUTM) {
+                other = JDK8.putIfAbsent(cachedUTM, key, crs);
+            }
+            if (other != null) {
+                return other;
+            }
+        }
+        return crs;
+    }
+
+    /**
+     * Returns the CRS for the given EPSG code, or {@code null} if none.
+     * This is a helper method for {@link #forCode(String, String, FactoryException)} only.
+     */
+    private CoordinateReferenceSystem forCode(final int code) {
+        if (code == geographic) return geographic();
+        if (code == geocentric) return geocentric();
+        if (code == geo3D)      return geographic3D();
+        final double latitude;
+        int zone;
+        if (northUTM != 0 && (zone = code - northUTM) >= firstZone && zone <= lastZone) {
+            latitude = +1;
+        } else if (southUTM != 0 && (zone = code - southUTM) >= firstZone && zone <= lastZone) {
+            latitude = -1;
+        } else {
+            return null;
+        }
+        return UTM(latitude, TransverseMercator.centralMeridian(zone));
+    }
+
 
 
 
@@ -788,13 +966,15 @@ public enum CommonCRS {
      *
      * <blockquote><table class="sis">
      *   <caption>Geodetic objects accessible by enumeration constants</caption>
-     *   <tr><th>Name or alias</th>             <th>Object type</th> <th>Enumeration value</th></tr>
-     *   <tr><td>Barometric altitude</td>       <td>CRS, Datum</td>  <td>{@link #BAROMETRIC}</td></tr>
-     *   <!-- <s>Ellipsoidal height</s> intentionally omitted        <td><s>{@link #ELLIPSOIDAL}</s></td> -->
-     *   <tr><td>Mean Sea Level</td>            <td>Datum</td>       <td>{@link #MEAN_SEA_LEVEL}</td></tr>
-     *   <tr><td>Mean Sea Level depth</td>      <td>CRS</td>         <td>{@link #DEPTH}</td></tr>
-     *   <tr><td>Mean Sea Level height</td>     <td>CRS</td>         <td>{@link #MEAN_SEA_LEVEL}</td></tr>
-     *   <tr><td>Other surface</td>             <td>CRS, Datum</td>  <td>{@link #OTHER_SURFACE}</td></tr>
+     *   <tr><th>Name or alias</th>                      <th>Object type</th> <th>Enumeration value</th></tr>
+     *   <tr><td>Barometric altitude</td>                <td>CRS, Datum</td>  <td>{@link #BAROMETRIC}</td></tr>
+     *   <!-- <s>Ellipsoidal height</s> intentionally omitted                 <td><s>{@link #ELLIPSOIDAL}</s></td> -->
+     *   <tr><td>Mean Sea Level</td>                     <td>Datum</td>       <td>{@link #MEAN_SEA_LEVEL}</td></tr>
+     *   <tr><td>Mean Sea Level depth</td>               <td>CRS</td>         <td>{@link #DEPTH}</td></tr>
+     *   <tr><td>Mean Sea Level height</td>              <td>CRS</td>         <td>{@link #MEAN_SEA_LEVEL}</td></tr>
+     *   <tr><td>NAVD88 height</td>                      <td>CRS</td>         <td>{@link #NAVD88}</td></tr>
+     *   <tr><td>North American Vertical Datum 1988</td> <td>Datum</td>       <td>{@link #NAVD88}</td></tr>
+     *   <tr><td>Other surface</td>                      <td>CRS, Datum</td>  <td>{@link #OTHER_SURFACE}</td></tr>
      * </table></blockquote>
      *
      * <div class="note"><b>Note:</b>
@@ -804,8 +984,10 @@ public enum CommonCRS {
      *
      * @author  Martin Desruisseaux (Geomatys)
      * @since   0.4
-     * @version 0.4
+     * @version 0.7
      * @module
+     *
+     * @see org.apache.sis.referencing.factory.CommonAuthorityFactory
      */
     public static enum Vertical {
         /**
@@ -849,6 +1031,24 @@ public enum CommonCRS {
         DEPTH(true, (short) 5715, (short) 5100),
 
         /**
+         * North American Vertical Datum 1988 height.
+         *
+         * <blockquote><table class="compact" summary="Mean Sea Level properties.">
+         *   <tr><th>WMS identifier:</th>           <td>CRS:88</td></tr>
+         *   <tr><th>EPSG identifiers:</th>         <td>5703 &nbsp;(<i>datum:</i> 5103)</td></tr>
+         *   <tr><th>Primary names:</th>            <td>"NAVD88 height" &nbsp;(<i>datum:</i> "North American Vertical Datum 1988")</td></tr>
+         *   <tr><th>Abbreviations or aliases:</th> <td>" North American Vertical Datum of 1988 height (m)" &nbsp;(<i>datum:</i> "NAVD88")</td></tr>
+         *   <tr><th>Direction:</th>                <td>{@link AxisDirection#UP}</td></tr>
+         *   <tr><th>Unit:</th>                     <td>{@link SI#METRE}</td></tr>
+         * </table></blockquote>
+         *
+         * @see CommonCRS#NAD83
+         *
+         * @since 0.7
+         */
+        NAVD88(true, (short) 5703, (short) 5103),
+
+        /**
          * Height measured along the normal to the ellipsoid used in the definition of horizontal datum.
          * The unit of measurement is metres.
          *
@@ -1377,9 +1577,10 @@ public enum CommonCRS {
                 final int n = Integer.parseInt(code);
                 if (n != 0) { // CommonCRS uses 0 as a sentinel value for "no EPSG code".
                     for (final CommonCRS candidate : CommonCRS.values()) {
-                        if (candidate.geographic == n) return candidate.geographic();
-                        if (candidate.geocentric == n) return candidate.geocentric();
-                        if (candidate.geo3D      == n) return candidate.geographic3D();
+                        final CoordinateReferenceSystem crs = candidate.forCode(n);
+                        if (crs != null) {
+                            return crs;
+                        }
                     }
                     for (final CommonCRS.Vertical candidate : CommonCRS.Vertical.values()) {
                         if (candidate.isEPSG && candidate.crs == n) {

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -88,7 +88,7 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public class NamedIdentifier extends ImmutableIdentifier implements GenericName {
@@ -142,7 +142,59 @@ public class NamedIdentifier extends Imm
 
     /**
      * Constructs an identifier from the given properties. The content of the properties map is used as
-     * described in the {@linkplain ImmutableIdentifier#ImmutableIdentifier(Map) super-class constructor}.
+     * described in the {@linkplain ImmutableIdentifier#ImmutableIdentifier(Map) super-class constructor},
+     * with the addition of an optional {@code "name"} property.
+     *
+     * <table class="sis">
+     *   <caption>Recognized properties</caption>
+     *   <tr>
+     *     <th>Property name</th>
+     *     <th>Value type</th>
+     *     <th>Returned by</th>
+     *   </tr>
+     *   <tr>
+     *     <td>{@code "name"}</td>
+     *     <td>{@link GenericName}</td>
+     *     <td>(none)</td>
+     *   </tr>
+     *   <tr>
+     *     <th colspan="3" class="hsep">Defined in parent class (reminder)</th>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.metadata.Identifier#CODE_KEY}</td>
+     *     <td>{@link String}</td>
+     *     <td>{@link #getCode()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.metadata.Identifier#CODESPACE_KEY}</td>
+     *     <td>{@link String}</td>
+     *     <td>{@link #getCodeSpace()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.metadata.Identifier#AUTHORITY_KEY}</td>
+     *     <td>{@link String} or {@link Citation}</td>
+     *     <td>{@link #getAuthority()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.metadata.Identifier#VERSION_KEY}</td>
+     *     <td>{@link String}</td>
+     *     <td>{@link #getVersion()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.metadata.Identifier#DESCRIPTION_KEY}</td>
+     *     <td>{@link String} or {@link InternationalString}</td>
+     *     <td>{@link #getDescription()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.apache.sis.referencing.AbstractIdentifiedObject#LOCALE_KEY}</td>
+     *     <td>{@link Locale}</td>
+     *     <td>(none)</td>
+     *   </tr>
+     * </table>
+     *
+     * The {@value org.opengis.metadata.Identifier#CODE_KEY} property is mandatory and all other properties
+     * are optional. If a {@code "name"} property is provided, then calls to name-related methods like
+     * {@link #tip()}, {@link #head()} and {@link #scope()} will delegate to the given name.
      *
      * @param  properties The properties to be given to this identifier.
      * @throws InvalidParameterValueException if a property has an invalid value.
@@ -150,6 +202,8 @@ public class NamedIdentifier extends Imm
      */
     public NamedIdentifier(final Map<String,?> properties) throws IllegalArgumentException {
         super(properties);
+        name = (GenericName) properties.get("name");
+        isNameSupplied = (name != null);
     }
 
     /**
@@ -171,7 +225,7 @@ public class NamedIdentifier extends Imm
         super(authority, Citations.getCodeSpace(authority), toString(code));
         if (code instanceof InternationalString) {
             name = createName(authority, super.getCodeSpace(), code);
-            isNameSupplied = true; // Because 'code' is an international string.
+            isNameSupplied = true;      // Because 'code' is an international string.
         }
     }
 
@@ -204,7 +258,7 @@ public class NamedIdentifier extends Imm
         super(authority, codeSpace, toString(code), version, description);
         if (code instanceof InternationalString) {
             name = createName(authority, codeSpace, code);
-            isNameSupplied = true; // Because 'code' is an international string.
+            isNameSupplied = true;      // Because 'code' is an international string.
         }
     }
 
@@ -232,7 +286,7 @@ public class NamedIdentifier extends Imm
     /**
      * Returns the generic name of this identifier.
      * The name will be constructed automatically the first time it will be needed.
-     * The name's scope is inferred from the shortest alternative title (if any).
+     * The name's head is inferred from the shortest alternative title (if any).
      * This heuristic rule is compatible to the ISO 19115 remark saying that the
      * {@linkplain Citation#getAlternateTitles() alternate titles} often contains abbreviation
      * (for example "DCW" as an alternative title for "Digital Chart of the World").
@@ -260,7 +314,7 @@ public class NamedIdentifier extends Imm
      */
     private static GenericName createName(final Citation authority, String codeSpace, final CharSequence code) {
         if (codeSpace == null) {
-            codeSpace = Citations.getCodeSpace(authority);   // Whitespaces trimed by Citations.
+            codeSpace = Citations.getCodeSpace(authority);          // Whitespaces trimed by Citations.
         }
         final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
         if (codeSpace != null) {
@@ -410,7 +464,7 @@ public class NamedIdentifier extends Imm
         }
         if (super.equals(object)) {
             if (!isNameSupplied) {
-                return true; // No need to compare names if they are computed from the same values.
+                return true;            // No need to compare names if they are computed from the same values.
             }
             final NamedIdentifier that = (NamedIdentifier) object;
             return Objects.equals(this.getName(), that.getName());

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -32,9 +32,17 @@ import org.opengis.referencing.cs.AxisDi
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.cs.EllipsoidalCS;
+import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.crs.GeographicCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.crs.VerticalCRS;
+import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.referencing.operation.MathTransformFactory;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.NoSuchIdentifierException;
+import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.metadata.AxisNames;
+import org.apache.sis.internal.referencing.provider.TransverseMercator;
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.referencing.datum.DefaultEllipsoid;
@@ -47,6 +55,9 @@ import org.apache.sis.referencing.cs.Def
 import org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.DefaultVerticalCRS;
+import org.apache.sis.referencing.crs.DefaultProjectedCRS;
+import org.apache.sis.referencing.operation.DefaultConversion;
+import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
 import org.apache.sis.measure.Longitude;
 import org.apache.sis.measure.Latitude;
 
@@ -63,7 +74,7 @@ import static org.apache.sis.internal.me
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
 final class StandardDefinitions {
@@ -81,15 +92,17 @@ final class StandardDefinitions {
     /**
      * Returns a map of properties for the given EPSG code, name and alias.
      *
-     * @param  code  The EPSG code.
+     * @param  code  The EPSG code, or 0 if none.
      * @param  name  The object name.
      * @param  alias The alias, or {@code null} if none.
      * @param  world {@code true} if the properties shall have an entry for the domain of validity.
      * @return The map of properties to give to constructors or factory methods.
      */
-    private static Map<String,Object> properties(final short code, final String name, final String alias, final boolean world) {
+    private static Map<String,Object> properties(final int code, final String name, final String alias, final boolean world) {
         final Map<String,Object> map = new HashMap<String,Object>(8);
-        map.put(IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG, String.valueOf(code)));
+        if (code != 0) {
+            map.put(IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG, String.valueOf(code)));
+        }
         map.put(NAME_KEY, new NamedIdentifier(Citations.EPSG, name));
         map.put(ALIAS_KEY, alias); // May be null, which is okay.
         if (world) {
@@ -99,6 +112,47 @@ final class StandardDefinitions {
     }
 
     /**
+     * Adds to the given properties an additional identifier in the {@code "CRS"} namespace.
+     * This method presume that the only identifier that existed before this method call was the EPSG one.
+     */
+    private static void addWMS(final Map<String,Object> properties, final String code) {
+        properties.put(IDENTIFIERS_KEY, new NamedIdentifier[] {
+            (NamedIdentifier) properties.get(IDENTIFIERS_KEY),
+            new NamedIdentifier(Citations.OGC, code)
+        });
+    }
+
+    /**
+     * Returns the operation method for Transverse Mercator projection using the SIS factory implementation.
+     * This method restricts the factory to SIS implementation instead than arbitrary factory in order to meet
+     * the contract saying that {@link CommonCRS} methods should never fail.
+     *
+     * @param code       The EPSG code, or 0 if none.
+     * @param baseCRS    The geographic CRS on which the projected CRS is based.
+     * @param latitude   A latitude in the zone of the desired projection, to be snapped to 0°.
+     * @param longitude  A longitude in the zone of the desired projection, to be snapped to UTM central meridian.
+     * @param derivedCS  The projected coordinate system.
+     */
+    static ProjectedCRS createUTM(final int code, final GeographicCRS baseCRS,
+            final double latitude, final double longitude, final CartesianCS derivedCS)
+    {
+        final OperationMethod method;
+        try {
+            method = DefaultFactories.forBuildin(MathTransformFactory.class,
+                                          DefaultMathTransformFactory.class)
+                    .getOperationMethod(TransverseMercator.NAME);
+        } catch (NoSuchIdentifierException e) {
+            throw new IllegalStateException(e);     // Should not happen with SIS implementation.
+        }
+        final ParameterValueGroup parameters = method.getParameters().createValue();
+        String name = TransverseMercator.setParameters(parameters, true, latitude, longitude);
+        final DefaultConversion conversion = new DefaultConversion(properties(0, name, null, false), method, null, parameters);
+
+        name = baseCRS.getName().getCode() + " / " + name;
+        return new DefaultProjectedCRS(properties(code, name, null, false), baseCRS, conversion, derivedCS);
+    }
+
+    /**
      * Creates a geodetic CRS from hard-coded values for the given code.
      *
      * @param  code  The EPSG code.
@@ -197,15 +251,32 @@ final class StandardDefinitions {
      * @return The vertical CRS for the given code.
      */
     static VerticalCRS createVerticalCRS(final short code, final VerticalDatum datum) {
-        final String name, alias, cs;
-        final short c, axis;
+        String cs   = "Vertical CS. Axis: height (H).";   // Default coordinate system
+        short  c    = 6499;                               // EPSG code of above coordinate system.
+        short  axis = 114;                                // Axis of above coordinate system.
+        String wms  = null;
+        final  String name, alias;
         switch (code) {
-            case 5714: name = "MSL height"; alias = "mean sea level height"; cs = "Vertical CS. Axis: height (H)."; c = 6499; axis = 114; break;
-            case 5715: name = "MSL depth";  alias = "mean sea level depth";  cs = "Vertical CS. Axis: depth (D).";  c = 6498; axis = 113; break;
+            case 5703: wms   = "88";
+                       name  = "NAVD88 height";
+                       alias = "North American Vertical Datum of 1988 height (m)";
+                       break;
+            case 5714: name  = "MSL height";
+                       alias = "mean sea level height";
+                       break;
+            case 5715: name  = "MSL depth";
+                       alias = "mean sea level depth";
+                       cs    = "Vertical CS. Axis: depth (D).";
+                       c     = 6498;
+                       axis  = 113;
+                       break;
             default:   throw new AssertionError(code);
         }
-        return new DefaultVerticalCRS(properties(code, name, alias, true), datum,
-                new DefaultVerticalCS(properties(c, cs, null, false), createAxis(axis)));
+        final Map<String,Object> properties = properties(code, name, alias, true);
+        if (wms != null) {
+            addWMS(properties, wms);
+        }
+        return new DefaultVerticalCRS(properties, datum, new DefaultVerticalCS(properties(c, cs, null, false), createAxis(axis)));
     }
 
     /**
@@ -218,7 +289,8 @@ final class StandardDefinitions {
         final String name;
         final String alias;
         switch (code) {
-            case 5100: name = "Mean Sea Level"; alias = "MSL"; break;
+            case 5100: name = "Mean Sea Level";                     alias = "MSL";    break;
+            case 5103: name = "North American Vertical Datum 1988"; alias = "NAVD88"; break;
             default:   throw new AssertionError(code);
         }
         return new DefaultVerticalDatum(properties(code, name, alias, true), VerticalDatumType.GEOIDAL);
@@ -242,6 +314,7 @@ final class StandardDefinitions {
             case 6422: name = "Ellipsoidal 2D"; dim = 2; axisCode = 108; break;
             case 6423: name = "Ellipsoidal 3D"; dim = 3; axisCode = 111; break;
             case 6500: name = "Earth centred";  dim = 3; axisCode = 118; isCartesian = true; break;
+            case 4400: name = "Cartesian 2D";   dim = 2; axisCode =   3; isCartesian = true; break;
             default:   throw new AssertionError(code);
         }
         final Map<String,?> properties = properties(code, name, null, false);
@@ -254,12 +327,17 @@ final class StandardDefinitions {
             case 0:  break;
         }
         if (isCartesian) {
-            return new DefaultCartesianCS(properties, xAxis, yAxis, zAxis);
-        }
-        if (zAxis != null) {
-            return new DefaultEllipsoidalCS(properties, xAxis, yAxis, zAxis);
+            if (zAxis != null) {
+                return new DefaultCartesianCS(properties, xAxis, yAxis, zAxis);
+            } else {
+                return new DefaultCartesianCS(properties, xAxis, yAxis);
+            }
         } else {
-            return new DefaultEllipsoidalCS(properties, xAxis, yAxis);
+            if (zAxis != null) {
+                return new DefaultEllipsoidalCS(properties, xAxis, yAxis, zAxis);
+            } else {
+                return new DefaultEllipsoidalCS(properties, xAxis, yAxis);
+            }
         }
     }
 
@@ -277,6 +355,16 @@ final class StandardDefinitions {
         RangeMeaning rm = null;
         final AxisDirection dir;
         switch (code) {
+            case 1:    name = "Easting";
+                       abrv = "E";
+                       unit = SI.METRE;
+                       dir  = AxisDirection.EAST;
+                       break;
+            case 2:    name = "Northing";
+                       abrv = "N";
+                       unit = SI.METRE;
+                       dir  = AxisDirection.NORTH;
+                       break;
             case 108:  // Used in Ellipsoidal 3D.
             case 106:  name = AxisNames.GEODETIC_LATITUDE;
                        abrv = "φ";

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -217,20 +217,30 @@ abstract class AbstractDerivedCRS<C exte
      */
     @Override
     public boolean equals(final Object object, final ComparisonMode mode) {
+        if (object == this) {
+            return true;
+        }
         if (super.equals(object, mode)) {
             final boolean strict = (mode == ComparisonMode.STRICT);
             /*
              * Avoid never-ending recursivity: Conversion has a 'targetCRS' field (inherited from
              * the AbstractCoordinateOperation super-class) that is set to this AbstractDerivedCRS.
+             *
+             * Do NOT compare the baseCRS explicitely. This is done implicitely in the comparison of the Conversion
+             * objects, since (this.baseCRS == Conversion.sourceCRS) in Apache SIS.  The reason why we delegate the
+             * comparison of that CRS to the Conversion object is because we want to ignore the baseCRS axes if the
+             * mode said to ignore metadata, but ignoring axis order and units has implication on the MathTransform
+             * instances to compare.  The AbstractCoordinateOperation.equals(…) method implementation handles those
+             * cases.
              */
-            if (Semaphores.queryAndSet(Semaphores.COMPARING)) {
+            if (Semaphores.queryAndSet(Semaphores.CONVERSION_AND_CRS)) {
                 return true;
             } else try {
                 return deepEquals(strict ? conversionFromBase : getConversionFromBase(),
                                   strict ? ((AbstractDerivedCRS) object).conversionFromBase
                                          :  ((GeneralDerivedCRS) object).getConversionFromBase(), mode);
             } finally {
-                Semaphores.clear(Semaphores.COMPARING);
+                Semaphores.clear(Semaphores.CONVERSION_AND_CRS);
             }
         }
         return false;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -112,6 +112,8 @@ import static org.apache.sis.internal.re
  * @since   0.4
  * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createCompoundCRS(String)
  */
 @XmlType(name = "CompoundCRSType")
 @XmlRootElement(name = "CompoundCRS")
@@ -183,6 +185,8 @@ public class DefaultCompoundCRS extends
      *
      * @param properties The properties to be given to the coordinate reference system.
      * @param components The sequence of coordinate reference systems making this compound CRS.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createCompoundCRS(Map, CoordinateReferenceSystem...)
      */
     public DefaultCompoundCRS(final Map<String,?> properties, final CoordinateReferenceSystem... components) {
         super(properties, createCoordinateSystem(properties, components));

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -94,6 +94,8 @@ import org.apache.sis.util.Classes;
  * @since   0.6
  * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createDerivedCRS(String)
  */
 @XmlType(name="DerivedCRSType", propOrder = {
     "baseCRS",
@@ -275,6 +277,7 @@ public class DefaultDerivedCRS extends A
      *         do not match the dimensions of {@code base} and {@code derivedCS} respectively.
      *
      * @see #DefaultDerivedCRS(Map, SingleCRS, Conversion, CoordinateSystem)
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createDerivedCRS(Map, CoordinateReferenceSystem, Conversion, CoordinateSystem)
      */
     public static DefaultDerivedCRS create(final Map<String,?>    properties,
                                            final SingleCRS        baseCRS,
@@ -479,6 +482,12 @@ public class DefaultDerivedCRS extends A
 
     /**
      * Compares this coordinate reference system with the specified object for equality.
+     * In addition to the metadata documented in the
+     * {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#equals(Object, ComparisonMode) parent class},
+     * this method considers coordinate system axes of the {@linkplain #getBaseCRS() base CRS} as metadata.
+     * This means that if the given {@code ComparisonMode} is {@code IGNORE_METADATA} or {@code APPROXIMATIVE},
+     * then axis order of the base CRS are ignored
+     * (but <strong>not</strong> axis order of <strong>this</strong> derived CRS).
      *
      * @param  object The object to compare to {@code this}.
      * @param  mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or
@@ -488,7 +497,7 @@ public class DefaultDerivedCRS extends A
      */
     @Override
     public boolean equals(final Object object, final ComparisonMode mode) {
-        return (object == this) || super.equals(object, mode);
+        return super.equals(object, mode);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -61,6 +61,9 @@ import static org.apache.sis.util.Argume
  * @since   0.4
  * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.referencing.datum.DefaultEngineeringDatum
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createEngineeringCRS(String)
  */
 @XmlType(name = "EngineeringCRSType", propOrder = {
     "coordinateSystem",
@@ -131,6 +134,8 @@ public class DefaultEngineeringCRS exten
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The coordinate system.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createEngineeringCRS(Map, EngineeringDatum, CoordinateSystem)
      */
     public DefaultEngineeringCRS(final Map<String,?> properties,
                                  final EngineeringDatum   datum,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -48,7 +48,7 @@ import org.apache.sis.referencing.Abstra
  *   <li>Create a {@code GeocentricCRS} from one of the static convenience shortcuts listed in
  *       {@link org.apache.sis.referencing.CommonCRS#geocentric()}.</li>
  *   <li>Create a {@code GeocentricCRS} from an identifier in a database by invoking
- *       {@link org.opengis.referencing.crs.CRSAuthorityFactory#createGeocentricCRS(String)}.</li>
+ *       {@link org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createGeocentricCRS(String)}.</li>
  *   <li>Create a {@code GeocentricCRS} by invoking the {@code CRSFactory.createGeocentricCRS(…)} method
  *       (implemented for example by {@link org.apache.sis.referencing.factory.GeodeticObjectFactory}).</li>
  *   <li>Create a {@code GeocentricCRS} by invoking the
@@ -70,6 +70,8 @@ import org.apache.sis.referencing.Abstra
  * @since   0.4
  * @version 0.4
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createGeocentricCRS(String)
  */
 @XmlTransient
 public class DefaultGeocentricCRS extends DefaultGeodeticCRS implements GeocentricCRS {
@@ -137,6 +139,8 @@ public class DefaultGeocentricCRS extend
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The coordinate system, which must be three-dimensional.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createGeocentricCRS(Map, GeodeticDatum, CartesianCS)
      */
     public DefaultGeocentricCRS(final Map<String,?> properties,
                                 final GeodeticDatum datum,
@@ -153,6 +157,8 @@ public class DefaultGeocentricCRS extend
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The coordinate system.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createGeocentricCRS(Map, GeodeticDatum, SphericalCS)
      */
     public DefaultGeocentricCRS(final Map<String,?> properties,
                                 final GeodeticDatum datum,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -62,7 +62,7 @@ import static org.apache.sis.internal.ut
  *       {@link org.apache.sis.referencing.CommonCRS#geographic()} or
  *       {@link org.apache.sis.referencing.CommonCRS#geographic3D()}.</li>
  *   <li>Create a {@code GeographicCRS} from an identifier in a database by invoking
- *       {@link org.opengis.referencing.crs.CRSAuthorityFactory#createGeographicCRS(String)}.</li>
+ *       {@link org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createGeographicCRS(String)}.</li>
  *   <li>Create a {@code GeographicCRS} by invoking the {@code CRSFactory.createGeographicCRS(…)} method
  *       (implemented for example by {@link org.apache.sis.referencing.factory.GeodeticObjectFactory}).</li>
  *   <li>Create a {@code GeographicCRS} by invoking the
@@ -85,6 +85,8 @@ import static org.apache.sis.internal.ut
  * @since   0.4
  * @version 0.6
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createGeographicCRS(String)
  */
 @XmlTransient
 public class DefaultGeographicCRS extends DefaultGeodeticCRS implements GeographicCRS {
@@ -151,6 +153,8 @@ public class DefaultGeographicCRS extend
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The two- or three-dimensional coordinate system.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createGeographicCRS(Map, GeodeticDatum, EllipsoidalCS)
      */
     public DefaultGeographicCRS(final Map<String,?> properties,
                                 final GeodeticDatum datum,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -53,6 +53,9 @@ import static org.apache.sis.util.Argume
  * @since   0.4
  * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.referencing.datum.DefaultImageDatum
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createImageCRS(String)
  */
 @XmlType(name = "ImageCRSType", propOrder = {
     "cartesianCS",
@@ -124,6 +127,8 @@ public class DefaultImageCRS extends Abs
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The coordinate system.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createImageCRS(Map, ImageDatum, AffineCS)
      */
     public DefaultImageCRS(final Map<String,?> properties,
                            final ImageDatum    datum,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -55,9 +55,9 @@ import static org.apache.sis.internal.re
 
 /**
  * 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.
+ * 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.
  *
  * <p><b>Used with coordinate system type:</b>
  *   {@linkplain org.apache.sis.referencing.cs.DefaultCartesianCS Cartesian}.
@@ -72,6 +72,8 @@ import static org.apache.sis.internal.re
  * @since   0.6
  * @version 0.6
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createProjectedCRS(String)
  */
 @XmlType(name="ProjectedCRSType", propOrder = {
     "baseCRS",
@@ -141,6 +143,8 @@ public class DefaultProjectedCRS extends
      *         must match the target dimension of the {@code baseToDerived} transform.
      * @throws MismatchedDimensionException if the source and target dimensions of {@code baseToDerived}
      *         do not match the dimensions of {@code base} and {@code derivedCS} respectively.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createProjectedCRS(Map, GeographicCRS, Conversion, CartesianCS)
      */
     public DefaultProjectedCRS(final Map<String,?> properties,
                                final GeographicCRS baseCRS,
@@ -284,6 +288,12 @@ public class DefaultProjectedCRS extends
 
     /**
      * Compares this coordinate reference system with the specified object for equality.
+     * In addition to the metadata documented in the
+     * {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#equals(Object, ComparisonMode) parent class},
+     * this method considers coordinate system axes of the {@linkplain #getBaseCRS() base CRS} as metadata.
+     * This means that if the given {@code ComparisonMode} is {@code IGNORE_METADATA} or {@code APPROXIMATIVE},
+     * then axis order of the base geographic CRS are ignored
+     * (but <strong>not</strong> axis order of <strong>this</strong> projected CRS).
      *
      * @param  object The object to compare to {@code this}.
      * @param  mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or
@@ -293,7 +303,7 @@ public class DefaultProjectedCRS extends
      */
     @Override
     public boolean equals(final Object object, final ComparisonMode mode) {
-        return (object == this) || super.equals(object, mode);
+        return super.equals(object, mode);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -62,6 +62,7 @@ import static org.apache.sis.util.Argume
  *
  * @see org.apache.sis.referencing.datum.DefaultTemporalDatum
  * @see org.apache.sis.referencing.cs.DefaultTimeCS
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createTemporalCRS(String)
  */
 @XmlType(name = "TemporalCRSType", propOrder = {
     "coordinateSystem",
@@ -145,6 +146,8 @@ public class DefaultTemporalCRS extends
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The coordinate system.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createTemporalCRS(Map, TemporalDatum, TimeCS)
      */
     public DefaultTemporalCRS(final Map<String,?> properties,
                               final TemporalDatum datum,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -54,6 +54,7 @@ import static org.apache.sis.util.Argume
  *
  * @see org.apache.sis.referencing.datum.DefaultVerticalDatum
  * @see org.apache.sis.referencing.cs.DefaultVerticalCS
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createVerticalCRS(String)
  */
 @XmlType(name = "VerticalCRSType", propOrder = {
     "coordinateSystem",
@@ -124,6 +125,8 @@ public class DefaultVerticalCRS extends
      * @param properties The properties to be given to the coordinate reference system.
      * @param datum The datum.
      * @param cs The coordinate system.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createVerticalCRS(Map, VerticalDatum, VerticalCS)
      */
     public DefaultVerticalCRS(final Map<String,?> properties,
                               final VerticalDatum datum,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -408,9 +408,11 @@ public class AbstractCS extends Abstract
                 if (dimension != that.getDimension()) {
                     return false;
                 }
-                for (int i=0; i<dimension; i++) {
-                    if (!deepEquals(getAxis(i), that.getAxis(i), mode)) {
-                        return false;
+                if (mode != ComparisonMode.ALLOW_VARIANT) {
+                    for (int i=0; i<dimension; i++) {
+                        if (!deepEquals(getAxis(i), that.getAxis(i), mode)) {
+                            return false;
+                        }
                     }
                 }
                 return true;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -287,10 +287,10 @@ public final class CoordinateSystems ext
         if (!Classes.implementSameInterfaces(sourceCS.getClass(), targetCS.getClass(), CoordinateSystem.class)) {
             throw new IllegalArgumentException(Errors.format(Errors.Keys.IncompatibleCoordinateSystemTypes));
         }
-        final AxisDirection[] sourceAxis = getAxisDirections(sourceCS);
-        final AxisDirection[] targetAxis = getAxisDirections(targetCS);
-        final MatrixSIS matrix = Matrices.createTransform(sourceAxis, targetAxis);
-        assert Arrays.equals(sourceAxis, targetAxis) == matrix.isIdentity() : matrix;
+        final AxisDirection[] srcAxes = getAxisDirections(sourceCS);
+        final AxisDirection[] dstAxes = getAxisDirections(targetCS);
+        final MatrixSIS matrix = Matrices.createTransform(srcAxes, dstAxes);
+        assert Arrays.equals(srcAxes, dstAxes) == matrix.isIdentity() : matrix;
         /*
          * The previous code computed a matrix for swapping axes. Usually, this
          * matrix contains only 0 and 1 values with only one "1" value by row.

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -109,6 +109,8 @@ public class DefaultAffineCS extends Abs
      * @param properties The properties to be given to the identified object.
      * @param axis0 The first axis.
      * @param axis1 The second axis.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createAffineCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultAffineCS(final Map<String,?>   properties,
                            final CoordinateSystemAxis axis0,
@@ -125,6 +127,8 @@ public class DefaultAffineCS extends Abs
      * @param axis0 The first axis.
      * @param axis1 The second axis.
      * @param axis2 The third axis.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createAffineCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultAffineCS(final Map<String,?>   properties,
                            final CoordinateSystemAxis axis0,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -59,6 +59,8 @@ import org.apache.sis.measure.Angle;
  * @since   0.4
  * @version 0.4
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createCartesianCS(String)
  */
 @XmlType(name = "CartesianCSType")
 @XmlRootElement(name = "CartesianCS")
@@ -115,6 +117,8 @@ public class DefaultCartesianCS extends
      * @param properties The properties to be given to the identified object.
      * @param axis0 The first  axis (e.g. “Easting”).
      * @param axis1 The second axis (e.g. “Northing”).
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createCartesianCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultCartesianCS(final Map<String,?>   properties,
                               final CoordinateSystemAxis axis0,
@@ -133,6 +137,8 @@ public class DefaultCartesianCS extends
      * @param axis0 The first  axis (e.g. “Geocentric X”).
      * @param axis1 The second axis (e.g. “Geocentric Y”).
      * @param axis2 The third  axis (e.g. “Geocentric Z”).
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createCartesianCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultCartesianCS(final Map<String,?>   properties,
                               final CoordinateSystemAxis axis0,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -292,6 +292,8 @@ public class DefaultCoordinateSystemAxis
      * @param abbreviation The {@linkplain #getAbbreviation() abbreviation} used for this coordinate system axis.
      * @param direction    The {@linkplain #getDirection() direction} of this coordinate system axis.
      * @param unit         The {@linkplain #getUnit() unit of measure} used for this coordinate system axis.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
      */
     public DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                        final String        abbreviation,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -53,6 +53,7 @@ import org.apache.sis.measure.Units;
  * @module
  *
  * @see DefaultPolarCS
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createCylindricalCS(String)
  */
 @XmlType(name = "CylindricalCSType")
 @XmlRootElement(name = "CylindricalCS")
@@ -110,6 +111,8 @@ public class DefaultCylindricalCS extend
      * @param axis0 The first axis.
      * @param axis1 The second axis.
      * @param axis2 The third axis.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createCylindricalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultCylindricalCS(final Map<String,?>   properties,
                                 final CoordinateSystemAxis axis0,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -51,6 +51,8 @@ import org.apache.sis.measure.Units;
  * @since   0.4
  * @version 0.4
  * @module
+ *
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createEllipsoidalCS(String)
  */
 @XmlType(name = "EllipsoidalCSType")
 @XmlRootElement(name = "EllipsoidalCS")
@@ -108,6 +110,8 @@ public class DefaultEllipsoidalCS extend
      * @param properties The properties to be given to the identified object.
      * @param axis0 The first  axis (e.g. “Geodetic latitude”).
      * @param axis1 The second axis (e.g. “Geodetic longitude”).
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createEllipsoidalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultEllipsoidalCS(final Map<String,?>   properties,
                                 final CoordinateSystemAxis axis0,
@@ -126,6 +130,8 @@ public class DefaultEllipsoidalCS extend
      * @param axis0 The first  axis (e.g. “Geodetic latitude”).
      * @param axis1 The second axis (e.g. “Geodetic longitude”).
      * @param axis2 The third  axis (e.g. “Ellipsoidal height”).
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createEllipsoidalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultEllipsoidalCS(final Map<String,?>   properties,
                                 final CoordinateSystemAxis axis0,

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -107,6 +107,8 @@ public class DefaultLinearCS extends Abs
      *
      * @param properties The properties to be given to the identified object.
      * @param axis       The axis.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createLinearCS(Map, CoordinateSystemAxis)
      */
     public DefaultLinearCS(final Map<String,?> properties, final CoordinateSystemAxis axis) {
         super(properties, axis);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java?rev=1724528&r1=1724527&r2=1724528&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java [UTF-8] Wed Jan 13 23:25:38 2016
@@ -51,6 +51,9 @@ import org.apache.sis.measure.Units;
  * @since   0.4
  * @version 0.4
  * @module
+ *
+ * @see DefaultCylindricalCS
+ * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createPolarCS(String)
  */
 @XmlType(name = "PolarCSType")
 @XmlRootElement(name = "PolarCS")
@@ -107,6 +110,8 @@ public class DefaultPolarCS extends Abst
      * @param properties The properties to be given to the identified object.
      * @param axis0 The first axis.
      * @param axis1 The second axis.
+     *
+     * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createPolarCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
      */
     public DefaultPolarCS(final Map<String,?>   properties,
                           final CoordinateSystemAxis axis0,




Mime
View raw message