sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1555262 - in /sis/branches/JDK7/core: sis-metadata/src/site/ sis-referencing/src/main/java/org/apache/sis/referencing/cs/ sis-referencing/src/test/java/org/apache/sis/referencing/ sis-referencing/src/test/java/org/apache/sis/referencing/cs...
Date Fri, 03 Jan 2014 21:52:25 GMT
Author: desruisseaux
Date: Fri Jan  3 21:52:24 2014
New Revision: 1555262

URL: http://svn.apache.org/r1555262
Log:
Complete JAXB annotations in the Coordinate System package and add tests.

Added:
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml   (with props)
Modified:
    sis/branches/JDK7/core/sis-metadata/src/site/site.xml
    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/DefaultAffineCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/package-info.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CommonAxes.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java

Modified: sis/branches/JDK7/core/sis-metadata/src/site/site.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/site/site.xml?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/site/site.xml (original)
+++ sis/branches/JDK7/core/sis-metadata/src/site/site.xml Fri Jan  3 21:52:24 2014
@@ -30,7 +30,7 @@
   <body>
     <menu name="Quick links">
       <item name="Apache SIS home" href="http://sis.apache.org"/>
-      <item name="Package Javadoc" href="../apidocs/org/apache/sis/metadata/iso/package-summary.html"/>
+      <item name="Package Javadoc" href="../apidocs/org/apache/sis/metadata/package-summary.html"/>
       <item name="FAQ"             href="http://sis.apache.org/faq.html#metadata"/>
     </menu>
 

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=1555262&r1=1555261&r2=1555262&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] Fri Jan  3 21:52:24 2014
@@ -69,7 +69,16 @@ import static org.apache.sis.util.Utilit
  */
 @XmlType(name = "AbstractCoordinateSystemType")
 @XmlSeeAlso({
-    DefaultEllipsoidalCS.class
+    DefaultAffineCS.class,
+    DefaultCartesianCS.class, // Not an AffineCS subclass in GML schema.
+    DefaultSphericalCS.class,
+    DefaultEllipsoidalCS.class,
+    DefaultCylindricalCS.class,
+    DefaultPolarCS.class,
+    DefaultLinearCS.class,
+    DefaultVerticalCS.class,
+    DefaultTimeCS.class,
+    DefaultUserDefinedCS.class
 })
 public class AbstractCS extends AbstractIdentifiedObject implements CoordinateSystem {
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,6 +18,8 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.AffineCS;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.AxisDirection;
@@ -51,6 +53,8 @@ import org.apache.sis.measure.Units;
  * @version 0.4
  * @module
  */
+@XmlType(name = "AffineCSType")
+@XmlRootElement(name = "AffineCS")
 public class DefaultAffineCS extends AbstractCS implements AffineCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -17,6 +17,8 @@
 package org.apache.sis.referencing.cs;
 
 import java.util.Map;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -56,6 +58,8 @@ import org.apache.sis.util.resources.Err
  * @version 0.4
  * @module
  */
+@XmlType(name = "CartesianCSType")
+@XmlRootElement(name = "CartesianCS")
 public class DefaultCartesianCS extends DefaultAffineCS implements CartesianCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,6 +18,8 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.CylindricalCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -50,6 +52,8 @@ import org.apache.sis.measure.Units;
  *
  * @see DefaultPolarCS
  */
+@XmlType(name = "CylindricalCSType")
+@XmlRootElement(name = "CylindricalCS")
 public class DefaultCylindricalCS extends AbstractCS implements CylindricalCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,6 +18,8 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.LinearCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -49,6 +51,8 @@ import org.apache.sis.measure.Units;
  * @version 0.4
  * @module
  */
+@XmlType(name = "LinearCSType")
+@XmlRootElement(name = "LinearCS")
 public class DefaultLinearCS extends AbstractCS implements LinearCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,6 +18,8 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.PolarCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -48,6 +50,8 @@ import org.apache.sis.measure.Units;
  * @version 0.4
  * @module
  */
+@XmlType(name = "PolarCSType")
+@XmlRootElement(name = "PolarCS")
 public class DefaultPolarCS extends AbstractCS implements PolarCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,6 +18,8 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.SphericalCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -52,6 +54,8 @@ import org.apache.sis.measure.Units;
  * @version 0.4
  * @module
  */
+@XmlType(name = "SphericalCSType")
+@XmlRootElement(name = "SphericalCS")
 public class DefaultSphericalCS extends AbstractCS implements SphericalCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -19,6 +19,8 @@ package org.apache.sis.referencing.cs;
 import java.util.Map;
 import javax.measure.unit.SI;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.TimeCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -48,6 +50,8 @@ import org.apache.sis.measure.Units;
  * @version 0.4
  * @module
  */
+@XmlType(name = "TimeCSType")
+@XmlRootElement(name = "TimeCS")
 public class DefaultTimeCS extends AbstractCS implements TimeCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -17,6 +17,8 @@
 package org.apache.sis.referencing.cs;
 
 import java.util.Map;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.UserDefinedCS;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 
@@ -35,6 +37,8 @@ import org.opengis.referencing.cs.Coordi
  * @version 0.4
  * @module
  */
+@XmlType(name = "UserDefinedCSType")
+@XmlRootElement(name = "UserDefinedCS")
 public class DefaultUserDefinedCS extends AbstractCS implements UserDefinedCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,6 +18,8 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.cs.VerticalCS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -60,6 +62,8 @@ import org.apache.sis.internal.referenci
  * @version 0.4
  * @module
  */
+@XmlType(name = "VerticalCSType")
+@XmlRootElement(name = "VerticalCS")
 public class DefaultVerticalCS extends AbstractCS implements VerticalCS {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/package-info.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/package-info.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -38,7 +38,7 @@
     @XmlJavaTypeAdapter(CS_AxisDirection.class),
     @XmlJavaTypeAdapter(CS_CoordinateSystemAxis.class),
     @XmlJavaTypeAdapter(CS_RangeMeaning.class),
-    @XmlJavaTypeAdapter(UnitAdapter.AsURN.class)
+    @XmlJavaTypeAdapter(UnitAdapter.ForCS.class)
 })
 package org.apache.sis.referencing.cs;
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -27,8 +27,9 @@ import org.opengis.referencing.datum.Pri
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.datum.VerticalDatum;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
-import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.cs.CartesianCS;
+import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.cs.RangeMeaning;
 
 import static org.apache.sis.test.Assert.*;
@@ -65,15 +66,20 @@ public final strictfp class GeodeticObje
      * for example a polygon encompassing the world.</p>
      *
      * @param extent The extent to verify, or {@code null} if none.
+     * @param isMandatory {@code true} if an absence of world extent is a failure.
      */
-    private static void assertIsWorld(final Extent extent) {
+    private static void assertIsWorld(final Extent extent, boolean isMandatory) {
         if (extent != null) {
             for (final GeographicExtent element : extent.getGeographicElements()) {
                 if (element instanceof GeographicBoundingBox) {
                     assertIsWorld((GeographicBoundingBox) element);
+                    isMandatory = false;
                 }
             }
         }
+        if (isMandatory) {
+            fail("Expected a world extent element.");
+        }
     }
 
     /**
@@ -194,10 +200,12 @@ public final strictfp class GeodeticObje
      * </table>
      *
      * @param datum The datum to verify.
+     * @param isExtentMandatory {@code true} if the domain of validity is required to contain an {@code Extent} element
+     *        for the world, or {@code false} if optional.
      */
-    public static void assertIsWGS84(final GeodeticDatum datum) {
+    public static void assertIsWGS84(final GeodeticDatum datum, final boolean isExtentMandatory) {
         assertEquals("name", "World Geodetic System 1984", datum.getName().getCode());
-        assertIsWorld    (datum.getDomainOfValidity());
+        assertIsWorld    (datum.getDomainOfValidity(), isExtentMandatory);
         assertIsGreenwich(datum.getPrimeMeridian());
         assertIsWGS84    (datum.getEllipsoid());
     }
@@ -215,39 +223,99 @@ public final strictfp class GeodeticObje
      * </table>
      *
      * @param datum The datum to verify.
+     * @param isExtentMandatory {@code true} if the domain of validity is required to contain an {@code Extent} element
+     *        for the world, or {@code false} if optional.
      */
-    public static void assertIsMeanSeaLevel(final VerticalDatum datum) {
+    public static void assertIsMeanSeaLevel(final VerticalDatum datum, final boolean isExtentMandatory) {
         assertEquals("name", "Mean Sea Level", datum.getName().getCode());
-        assertIsWorld(datum.getDomainOfValidity());
+        assertIsWorld(datum.getDomainOfValidity(), isExtentMandatory);
     }
 
     /**
-     * Asserts that the given coordinate system contains the geodetic (latitude, longitude) axes.
+     * Asserts that the given coordinate system contains the (easting, northing) axes in metres.
      * This method verifies the following properties:
      *
      * <table class="sis">
-     * <tr><th>Property</th> <th>Expected value</th></tr>
+     * <tr><th>Property</th> <th colspan="2">Expected value</th></tr>
+     * <tr><td>{@linkplain CartesianCS#getDimension() Dimension}</td>
+     *     <td colspan="2">2</td></tr>
+     * <tr><td>Axes {@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
+     *     <td>{@code "Easting"}</td>
+     *     <td>{@code "Northing"}</td></tr>
+     * <tr><td>Axes {@linkplain CoordinateSystemAxis#getAbbreviation() abbreviation}</td>
+     *     <td>{@code "E"}</td>
+     *     <td>{@code "N"}</td></tr>
+     * <tr><td>Axes {@linkplain CoordinateSystemAxis#getDirection() direction}</td>
+     *     <td>{@link AxisDirection#EAST EAST}</td>
+     *     <td>{@link AxisDirection#NORTH NORTH}</td></tr>
+     * <tr><td>Axes {@linkplain CoordinateSystemAxis#getUnit() units}</td>
+     *     <td>{@link SI#METRE}</td>
+     *     <td>{@link SI#METRE}</td></tr>
+     * <tr><td>Axes range</td>
+     *     <td>[-∞ … ∞]</td>
+     *     <td>[-∞ … ∞]</td></tr>
+     * <tr><td>Axes range meaning</td>
+     *     <td>{@code null}</td>
+     *     <td>{@code null}</td>
+     * </table>
+     *
+     * @param cs The coordinate system to verify.
+     */
+    public static void assertIsProjected2D(final CartesianCS cs) {
+        assertEquals("dimension", 2, cs.getDimension());
+        final CoordinateSystemAxis E = cs.getAxis(0);
+        final CoordinateSystemAxis N = cs.getAxis(1);
+        assertNotNull("axis", E);
+        assertNotNull("axis", N);
+        assertEquals("axis[0].name",         "Easting",           E.getName().getCode());
+        assertEquals("axis[1].name",         "Northing",          N.getName().getCode());
+        assertEquals("axis[0].abbreviation", "E",                 E.getAbbreviation());
+        assertEquals("axis[1].abbreviation", "N",                 N.getAbbreviation());
+        assertEquals("axis[0].direction",    AxisDirection.EAST,  E.getDirection());
+        assertEquals("axis[1].direction",    AxisDirection.NORTH, N.getDirection());
+        assertEquals("axis[0].unit",         SI.METRE,            E.getUnit());
+        assertEquals("axis[1].unit",         SI.METRE,            N.getUnit());
+        verifyRange(E, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null, true);
+        verifyRange(N, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null, true);
+    }
+
+    /**
+     * Asserts that the given coordinate system contains the geodetic (latitude, longitude) axes in degrees.
+     * This method verifies the following properties:
+     *
+     * <table class="sis">
+     * <tr><th>Property</th> <th colspan="2">Expected value</th></tr>
      * <tr><td>{@linkplain EllipsoidalCS#getDimension() Dimension}</td>
-     *     <td>2</td></tr>
-     * <tr><td>Axis[0] name code</td>
-     *     <td>{@code "Geodetic latitude"}</td></tr>
-     * <tr><td>Axis[1] name code</td>
+     *     <td colspan="2">2</td></tr>
+     * <tr><td>Axes {@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
+     *     <td>{@code "Geodetic latitude"}</td>
      *     <td>{@code "Geodetic longitude"}</td></tr>
-     * <tr><td>Axis[0] {@linkplain CoordinateSystemAxis#getDirection() direction}</td>
-     *     <td>{@link AxisDirection#NORTH NORTH}</td></tr>
-     * <tr><td>Axis[1] {@linkplain CoordinateSystemAxis#getDirection() direction}</td>
+     * <tr><td>Axes {@linkplain CoordinateSystemAxis#getDirection() direction}</td>
+     *     <td>{@link AxisDirection#NORTH NORTH}</td>
      *     <td>{@link AxisDirection#EAST EAST}</td></tr>
      * <tr><td>Axes {@linkplain CoordinateSystemAxis#getUnit() units}</td>
+     *     <td>{@link NonSI#DEGREE_ANGLE}</td>
      *     <td>{@link NonSI#DEGREE_ANGLE}</td></tr>
-     * <tr><td>Axis[0] range</td>
-     *     <td>[-90 … 90] with {@link RangeMeaning#EXACT}, or all range properties missing</td></tr>
-     * <tr><td>Axis[1] range</td>
-     *     <td>[-180 … 180] with {@link RangeMeaning#WRAPAROUND}, or all range properties missing</td></tr>
+     * <tr><td>Axes range</td>
+     *     <td>[-90 … 90] (see below)</td>
+     *     <td>[-180 … 180] (see below)</td></tr>
+     * <tr><td>Axes range meaning</td>
+     *     <td>{@link RangeMeaning#EXACT} or missing</td>
+     *     <td>{@link RangeMeaning#WRAPAROUND} or missing</td></tr>
      * </table>
      *
+     * <b>Notes:</b>
+     * <ul>
+     *   <li>The axes range may be missing if and only if the range meaning is also missing.</li>
+     *   <li>This method does not verify {@linkplain CoordinateSystemAxis#getAbbreviation() abbreviations}
+     *       because the classical symbols (φ,λ) are often replaced by (lat,long).</li>
+     * </ul>
+     *
      * @param cs The coordinate system to verify.
+     * @param rangeIsMandatory {@code true} if the axes range and range meaning properties shall be defined,
+     *        or {@code false} if they are optional.
      */
-    public static void assertIsGeodetic2D(final EllipsoidalCS cs) {
+    public static void assertIsGeodetic2D(final EllipsoidalCS cs, final boolean rangeIsMandatory) {
         assertEquals("dimension", 2, cs.getDimension());
         final CoordinateSystemAxis latitude  = cs.getAxis(0);
         final CoordinateSystemAxis longitude = cs.getAxis(1);
@@ -259,23 +327,26 @@ public final strictfp class GeodeticObje
         assertEquals("axis[1].direction", AxisDirection.EAST,   longitude.getDirection());
         assertEquals("axis[0].unit",      NonSI.DEGREE_ANGLE,   latitude .getUnit());
         assertEquals("axis[1].unit",      NonSI.DEGREE_ANGLE,   longitude.getUnit());
-        verifyRange(latitude,   -90,  +90, RangeMeaning.EXACT);
-        verifyRange(longitude, -180, +180, RangeMeaning.WRAPAROUND);
+        verifyRange(latitude,   -90,  +90, RangeMeaning.EXACT, rangeIsMandatory);
+        verifyRange(longitude, -180, +180, RangeMeaning.WRAPAROUND, rangeIsMandatory);
     }
 
     /**
      * Asserts that the axis range is either fully missing, or defined to exactly the given properties.
      */
     private static void verifyRange(final CoordinateSystemAxis axis,
-            final double min, final double max, final RangeMeaning rm)
+            final double min, final double max, final RangeMeaning expected, final boolean isMandatory)
     {
         final double       minimumValue = axis.getMinimumValue();
         final double       maximumValue = axis.getMaximumValue();
         final RangeMeaning rangeMeaning = axis.getRangeMeaning();
-        if (minimumValue != Double.NEGATIVE_INFINITY || maximumValue != Double.POSITIVE_INFINITY || rangeMeaning != null) {
+        if (isMandatory || rangeMeaning != null ||
+                minimumValue != Double.NEGATIVE_INFINITY ||
+                maximumValue != Double.POSITIVE_INFINITY)
+        {
             assertEquals("axis.minimumValue", min, minimumValue, STRICT);
             assertEquals("axis.maximumValue", max, maximumValue, STRICT);
-            assertEquals("axis.rangeMeaning", rm,  rangeMeaning);
+            assertEquals("axis.rangeMeaning", expected, rangeMeaning);
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CommonAxes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CommonAxes.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CommonAxes.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CommonAxes.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -50,7 +50,7 @@ public final strictfp class CommonAxes {
      * @see #GEODETIC_LATITUDE
      */
     public static final DefaultCoordinateSystemAxis GEODETIC_LONGITUDE = create("Geodetic longitude", "λ",
-            AxisDirection.EAST, 180, NonSI.DEGREE_ANGLE);
+            AxisDirection.EAST, -180, 180, NonSI.DEGREE_ANGLE, RangeMeaning.WRAPAROUND);
 
     /**
      * Default axis info for geodetic latitudes in a
@@ -67,7 +67,7 @@ public final strictfp class CommonAxes {
      * @see #GEODETIC_LONGITUDE
      */
     public static final DefaultCoordinateSystemAxis GEODETIC_LATITUDE = create("Geodetic latitude", "φ",
-            AxisDirection.NORTH, 90, NonSI.DEGREE_ANGLE);
+            AxisDirection.NORTH, -90, 90, NonSI.DEGREE_ANGLE, RangeMeaning.EXACT);
 
     /**
      * Default axis info for longitudes.
@@ -82,7 +82,7 @@ public final strictfp class CommonAxes {
      * @see #LATITUDE
      */
     public static final DefaultCoordinateSystemAxis LONGITUDE = create("Longitude", "λ",
-            AxisDirection.EAST, 180, NonSI.DEGREE_ANGLE);
+            AxisDirection.EAST, -180, 180, NonSI.DEGREE_ANGLE, RangeMeaning.WRAPAROUND);
 
     /**
      * Default axis info for latitudes.
@@ -97,7 +97,7 @@ public final strictfp class CommonAxes {
      * @see #LONGITUDE
      */
     public static final DefaultCoordinateSystemAxis LATITUDE = create("Latitude", "φ",
-            AxisDirection.NORTH, 90, NonSI.DEGREE_ANGLE);
+            AxisDirection.NORTH, -90, 90, NonSI.DEGREE_ANGLE, RangeMeaning.EXACT);
 
     /**
      * The default axis for height values above the ellipsoid in a
@@ -114,7 +114,7 @@ public final strictfp class CommonAxes {
      * @see #DEPTH
      */
     public static final DefaultCoordinateSystemAxis ELLIPSOIDAL_HEIGHT = create("Ellipsoidal height", "h",
-            AxisDirection.UP, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.UP, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * The default axis for height values measured from gravity.
@@ -127,13 +127,13 @@ public final strictfp class CommonAxes {
      * @see #DEPTH
      */
     public static final DefaultCoordinateSystemAxis GRAVITY_RELATED_HEIGHT = create("Gravity-related height", "H",
-            AxisDirection.UP, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.UP, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * A height in centimetres, for {@link CoordinateSystemsTest} only.
      */
     static final DefaultCoordinateSystemAxis HEIGHT_cm = create("Height", "h",
-            AxisDirection.UP, Double.POSITIVE_INFINITY, SI.CENTIMETRE);
+            AxisDirection.UP, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.CENTIMETRE, null);
 
     /**
      * The default axis for altitude values.
@@ -148,7 +148,7 @@ public final strictfp class CommonAxes {
      * @see #DEPTH
      */
     public static final DefaultCoordinateSystemAxis ALTITUDE = create("Altitude", "h",
-            AxisDirection.UP, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.UP, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * The default axis for depth.
@@ -161,7 +161,7 @@ public final strictfp class CommonAxes {
      * @see #GRAVITY_RELATED_HEIGHT
      */
     public static final DefaultCoordinateSystemAxis DEPTH = create("Depth", "d",
-            AxisDirection.DOWN, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.DOWN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for radius in a
@@ -179,7 +179,7 @@ public final strictfp class CommonAxes {
      * @see #DEPTH
      */
     public static final DefaultCoordinateSystemAxis GEOCENTRIC_RADIUS = create("Geocentric radius", "r",
-            AxisDirection.UP, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.UP, 0, Double.POSITIVE_INFINITY, SI.METRE, RangeMeaning.EXACT);
 
     /**
      * Default axis info for longitudes in a
@@ -197,7 +197,7 @@ public final strictfp class CommonAxes {
      * @see #SPHERICAL_LATITUDE
      */
     public static final DefaultCoordinateSystemAxis SPHERICAL_LONGITUDE = create("Spherical longitude", "Ω",
-            AxisDirection.EAST, 180, NonSI.DEGREE_ANGLE);
+            AxisDirection.EAST, -180, 180, NonSI.DEGREE_ANGLE, RangeMeaning.WRAPAROUND);
 
     /**
      * Default axis info for latitudes in a
@@ -215,7 +215,7 @@ public final strictfp class CommonAxes {
      * @see #SPHERICAL_LONGITUDE
      */
     public static final DefaultCoordinateSystemAxis SPHERICAL_LATITUDE = create("Spherical latitude", "Θ",
-            AxisDirection.NORTH, 90, NonSI.DEGREE_ANGLE);
+            AxisDirection.NORTH, -90, 90, NonSI.DEGREE_ANGLE, RangeMeaning.EXACT);
 
     /**
      * Default axis info for <var>x</var> values in a
@@ -233,7 +233,7 @@ public final strictfp class CommonAxes {
      * @see #COLUMN
      */
     public static final DefaultCoordinateSystemAxis X = create("x", "x",
-            AxisDirection.EAST, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.EAST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for <var>y</var> values in a
@@ -251,7 +251,7 @@ public final strictfp class CommonAxes {
      * @see #ROW
      */
     public static final DefaultCoordinateSystemAxis Y = create("y", "y",
-            AxisDirection.NORTH, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.NORTH, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for <var>z</var> values in a
@@ -263,7 +263,7 @@ public final strictfp class CommonAxes {
      * <p>This axis is usually part of a {@link #X}, {@link #Y}, {@link #Z} set.</p>
      */
     public static final DefaultCoordinateSystemAxis Z = create("z", "z",
-            AxisDirection.UP, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.UP, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for <var>x</var> values in a
@@ -279,7 +279,7 @@ public final strictfp class CommonAxes {
      * <p>This axis is usually part of a {@link #GEOCENTRIC_X}, {@link #GEOCENTRIC_Y}, {@link #GEOCENTRIC_Z} set.</p>
      */
     public static final DefaultCoordinateSystemAxis GEOCENTRIC_X = create("X", "X",
-            AxisDirection.GEOCENTRIC_X, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.GEOCENTRIC_X, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for <var>y</var> values in a
@@ -295,7 +295,7 @@ public final strictfp class CommonAxes {
      * <p>This axis is usually part of a {@link #GEOCENTRIC_X}, {@link #GEOCENTRIC_Y}, {@link #GEOCENTRIC_Z} set.</p>
      */
     public static final DefaultCoordinateSystemAxis GEOCENTRIC_Y = create("Y", "Y",
-            AxisDirection.GEOCENTRIC_Y, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.GEOCENTRIC_Y, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for <var>z</var> values in a
@@ -311,7 +311,7 @@ public final strictfp class CommonAxes {
      * <p>This axis is usually part of a {@link #GEOCENTRIC_X}, {@link #GEOCENTRIC_Y}, {@link #GEOCENTRIC_Z} set.</p>
      */
     public static final DefaultCoordinateSystemAxis GEOCENTRIC_Z = create("Z", "Z",
-            AxisDirection.GEOCENTRIC_Z, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.GEOCENTRIC_Z, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for Easting values in a
@@ -326,7 +326,7 @@ public final strictfp class CommonAxes {
      * @see #WESTING
      */
     public static final DefaultCoordinateSystemAxis EASTING = create("Easting", "E",
-            AxisDirection.EAST, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.EAST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for Westing values in a
@@ -339,7 +339,7 @@ public final strictfp class CommonAxes {
      * @see #WESTING
      */
     public static final DefaultCoordinateSystemAxis WESTING = create("Westing", "W",
-            AxisDirection.WEST, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.WEST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for Northing values in a
@@ -354,7 +354,7 @@ public final strictfp class CommonAxes {
      * @see #SOUTHING
      */
     public static final DefaultCoordinateSystemAxis NORTHING = create("Northing", "N",
-            AxisDirection.NORTH, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.NORTH, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * Default axis info for Southing values in a
@@ -367,19 +367,19 @@ public final strictfp class CommonAxes {
      * @see #SOUTHING
      */
     public static final DefaultCoordinateSystemAxis SOUTHING = create("Southing", "S",
-            AxisDirection.SOUTH, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.SOUTH, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * An axis with North-East orientation.
      */
     static final DefaultCoordinateSystemAxis NORTH_EAST = create("NORTH_EAST", "NE",
-            AxisDirection.NORTH_EAST, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.NORTH_EAST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * An axis with South-East orientation.
      */
     static final DefaultCoordinateSystemAxis SOUTH_EAST = create("SOUTH_EAST", "SE",
-            AxisDirection.SOUTH_EAST, Double.POSITIVE_INFINITY, SI.METRE);
+            AxisDirection.SOUTH_EAST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null);
 
     /**
      * A default axis for time values in a {@linkplain org.opengis.referencing.cs.TimeCS time CS}.
@@ -387,7 +387,7 @@ public final strictfp class CommonAxes {
      * The abbreviation is lower case "<var>t</var>".
      */
     public static final DefaultCoordinateSystemAxis TIME = create("Time", "t",
-            AxisDirection.FUTURE, Double.POSITIVE_INFINITY, NonSI.DAY);
+            AxisDirection.FUTURE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, NonSI.DAY, null);
 
     /**
      * A default axis for column indices in a {@linkplain org.opengis.coverage.grid.GridCoverage grid coverage}.
@@ -395,7 +395,7 @@ public final strictfp class CommonAxes {
      * The abbreviation is lower case "<var>i</var>".
      */
     public static final DefaultCoordinateSystemAxis COLUMN = create("Column", "i",
-            AxisDirection.COLUMN_POSITIVE, Double.POSITIVE_INFINITY, Unit.ONE);
+            AxisDirection.COLUMN_POSITIVE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Unit.ONE, null);
 
     /**
      * A default axis for row indices in a {@linkplain org.opengis.coverage.grid.GridCoverage grid coverage}.
@@ -403,7 +403,7 @@ public final strictfp class CommonAxes {
      * The abbreviation is lower case "<var>j</var>".
      */
     public static final DefaultCoordinateSystemAxis ROW = create("Row", "j",
-            AxisDirection.ROW_POSITIVE, Double.POSITIVE_INFINITY, Unit.ONE);
+            AxisDirection.ROW_POSITIVE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Unit.ONE, null);
 
     /**
      * A default axis for <var>x</var> values in a display device. Increasing values go toward
@@ -411,7 +411,7 @@ public final strictfp class CommonAxes {
      * The abbreviation is lower case "<var>x</var>".
      */
     public static final DefaultCoordinateSystemAxis DISPLAY_X = create("x", "x",
-            AxisDirection.DISPLAY_RIGHT, Double.POSITIVE_INFINITY, Unit.ONE);
+            AxisDirection.DISPLAY_RIGHT, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Unit.ONE, null);
 
     /**
      * A default axis for <var>y</var> values in a display device. Increasing values go toward
@@ -419,7 +419,7 @@ public final strictfp class CommonAxes {
      * The abbreviation is lower case "<var>y</var>".
      */
     public static final DefaultCoordinateSystemAxis DISPLAY_Y = create("y", "y",
-            AxisDirection.DISPLAY_DOWN, Double.POSITIVE_INFINITY, Unit.ONE);
+            AxisDirection.DISPLAY_DOWN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Unit.ONE, null);
 
     /**
      * Undefined or unknown axis. Axis direction is {@link AxisDirection#OTHER OTHER}
@@ -427,17 +427,17 @@ public final strictfp class CommonAxes {
      * for axes that were not properly defined.
      */
     public static final DefaultCoordinateSystemAxis UNDEFINED = create("Undefined", "?",
-            AxisDirection.OTHER, Double.POSITIVE_INFINITY, Unit.ONE);
+            AxisDirection.OTHER, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Unit.ONE, null);
 
     /**
      * Creates a new axis of the given name, abbreviation, direction and unit.
      */
     private static DefaultCoordinateSystemAxis create(final String name, final String abbreviation,
-            final AxisDirection direction, final double maximum, final Unit<?> unit)
+            final AxisDirection direction, final double minimum, final double maximum, final Unit<?> unit,
+            final RangeMeaning meaning)
     {
         return new DefaultCoordinateSystemAxis(singletonMap(DefaultCoordinateSystemAxis.NAME_KEY, name),
-                abbreviation, direction, unit, name.endsWith("radius") ? 0 : -maximum, maximum,
-                name.endsWith("longitude") ? RangeMeaning.WRAPAROUND : RangeMeaning.EXACT);
+                abbreviation, direction, unit, minimum, maximum, meaning);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -17,13 +17,17 @@
 package org.apache.sis.referencing.cs;
 
 import java.util.Map;
+import javax.xml.bind.JAXBException;
 import org.opengis.test.Validators;
-import org.apache.sis.test.TestCase;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.apache.sis.referencing.GeodeticObjectVerifier;
+import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
 import static java.util.Collections.singletonMap;
+import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
 /**
@@ -35,7 +39,12 @@ import static java.util.Collections.sing
  * @module
  */
 @DependsOn(DefaultCoordinateSystemAxisTest.class)
-public final strictfp class DefaultCartesianCSTest extends TestCase {
+public final strictfp class DefaultCartesianCSTest extends XMLTestCase {
+    /**
+     * An XML file in this package containing a Cartesian coordinate system definition.
+     */
+    private static final String XML_FILE = "CartesianCS.xml";
+
     /**
      * Tests the creation of a Cartesian CS with legal axes.
      */
@@ -103,4 +112,31 @@ public final strictfp class DefaultCarte
             assertFalse(e.getMessage().isEmpty());
         }
     }
+
+    /**
+     * Tests (un)marshalling of a Cartesian coordinate system.
+     *
+     * @throws JAXBException If an error occurred during unmarshalling.
+     */
+    @Test
+    public void testXML() throws JAXBException {
+        final DefaultCartesianCS cs = unmarshalFile(DefaultCartesianCS.class, XML_FILE);
+        Validators.validate(cs);
+        GeodeticObjectVerifier.assertIsProjected2D(cs);
+        /*
+         * Values in the following tests are specific to our XML file.
+         * The actual texts in the EPSG database are more descriptive.
+         */
+        final CoordinateSystemAxis E = cs.getAxis(0);
+        final CoordinateSystemAxis N = cs.getAxis(1);
+        assertEquals("name",    "Easting, northing (E,N)", cs.getName().getCode());
+        assertEquals("remarks", "Used in ProjectedCRS.", cs.getRemarks().toString());
+        assertIdentifierEquals(        "identifier", "OGP", "EPSG", null, "4400", getSingleton(cs.getIdentifiers()));
+        assertIdentifierEquals("axis[0].identifier", "OGP", "EPSG", null, "1",    getSingleton(E.getIdentifiers()));
+        assertIdentifierEquals("axis[1].identifier", "OGP", "EPSG", null, "2",    getSingleton(N.getIdentifiers()));
+        /*
+         * Marshal and compare with the original file.
+         */
+        assertMarshalEqualsFile(XML_FILE, cs, "xmlns:*", "xsi:schemaLocation");
+    }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -19,7 +19,6 @@ package org.apache.sis.referencing.cs;
 import javax.xml.bind.JAXBException;
 import org.opengis.test.Validators;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
-import org.opengis.referencing.cs.RangeMeaning;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.referencing.GeodeticObjectVerifier;
@@ -45,34 +44,31 @@ public final strictfp class DefaultEllip
     private static final String XML_FILE = "EllipsoidalCS.xml";
 
     /**
-     * Tests unmarshalling of an ellipsoidal coordinate system.
+     * Tests (un)marshalling of an ellipsoidal coordinate system.
      *
      * @throws JAXBException If an error occurred during unmarshalling.
      */
     @Test
-    public void testUnmarshalling() throws JAXBException {
+    public void testXML() throws JAXBException {
         final DefaultEllipsoidalCS cs = unmarshalFile(DefaultEllipsoidalCS.class, XML_FILE);
         Validators.validate(cs);
-        GeodeticObjectVerifier.assertIsGeodetic2D(cs);
+        GeodeticObjectVerifier.assertIsGeodetic2D(cs, true);
         /*
          * Values in the following tests are specific to our XML file.
          * The actual texts in the EPSG database are more descriptive.
          */
+        final CoordinateSystemAxis φ = cs.getAxis(0);
+        final CoordinateSystemAxis λ = cs.getAxis(1);
         assertEquals("name",    "Latitude (north), Longitude (east)",     cs.getName().getCode());
         assertEquals("remarks", "Used in two-dimensional GeographicCRS.", cs.getRemarks().toString());
-        assertIdentifierEquals("identifier", "OGP", "EPSG", null, "6422", getSingleton(cs.getIdentifiers()));
-
-        final CoordinateSystemAxis latitude  = cs.getAxis(0);
-        final CoordinateSystemAxis longitude = cs.getAxis(1);
-        assertIdentifierEquals("axis[0].identifier", "OGP", "EPSG", null, "106", getSingleton(latitude.getIdentifiers()));
-        assertIdentifierEquals("axis[1].identifier", "OGP", "EPSG", null, "107", getSingleton(longitude.getIdentifiers()));
-        assertEquals("axis[0].abbreviation", "Lat",                   latitude .getAbbreviation());
-        assertEquals("axis[1].abbreviation", "Long",                  longitude.getAbbreviation());
-        assertEquals("axis[0].rangeMeaning", RangeMeaning.EXACT,      latitude .getRangeMeaning());
-        assertEquals("axis[1].abbreviation", RangeMeaning.WRAPAROUND, longitude.getRangeMeaning());
+        assertIdentifierEquals(        "identifier", "OGP", "EPSG", null, "6422", getSingleton(cs.getIdentifiers()));
+        assertIdentifierEquals("axis[0].identifier", "OGP", "EPSG", null, "106",  getSingleton(φ.getIdentifiers()));
+        assertIdentifierEquals("axis[1].identifier", "OGP", "EPSG", null, "107",  getSingleton(λ.getIdentifiers()));
+        assertEquals("axis[0].abbreviation", "φ", φ.getAbbreviation());
+        assertEquals("axis[1].abbreviation", "λ", λ.getAbbreviation());
         /*
-         * Minimum and maximum values have been verified by GeodeticObjectVerifier.assertIsGeodetic2D(cs)
-         * if range meanings were not null.
+         * Marshal and compare with the original file.
          */
+        assertMarshalEqualsFile(XML_FILE, cs, "xmlns:*", "xsi:schemaLocation");
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -23,7 +23,6 @@ import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.xml.bind.JAXBException;
 import org.opengis.metadata.extent.Extent;
-import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.test.Validators;
@@ -36,7 +35,6 @@ import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
 import static org.apache.sis.referencing.Assert.*;
-import static org.apache.sis.test.TestUtilities.getSingleton;
 import static org.apache.sis.test.mock.GeodeticDatumMock.*;
 import static org.apache.sis.referencing.GeodeticObjectVerifier.*;
 
@@ -227,8 +225,7 @@ public final strictfp class DefaultGeode
     @Test
     public void testUnmarshalling() throws JAXBException {
         final DefaultGeodeticDatum datum = unmarshalFile(DefaultGeodeticDatum.class, XML_FILE);
-        assertIsWGS84(datum);
-        assertIsWorld((GeographicBoundingBox) getSingleton(datum.getDomainOfValidity().getGeographicElements()));
+        assertIsWGS84(datum, true);
         /*
          * Values in the following tests are specific to our XML file.
          * The actual texts in the EPSG database are more descriptive.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -18,7 +18,6 @@ package org.apache.sis.referencing.datum
 
 import java.lang.reflect.Field;
 import javax.xml.bind.JAXBException;
-import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.referencing.datum.VerticalDatumType;
 import org.apache.sis.internal.referencing.VerticalDatumTypes;
 import org.apache.sis.test.XMLTestCase;
@@ -27,7 +26,6 @@ import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
 import static org.apache.sis.referencing.Assert.*;
-import static org.apache.sis.test.TestUtilities.getSingleton;
 import static org.apache.sis.referencing.GeodeticObjectVerifier.*;
 
 
@@ -94,8 +92,7 @@ public final strictfp class DefaultVerti
     @Test
     public void testUnmarshalling() throws JAXBException {
         final DefaultVerticalDatum datum = unmarshalFile(DefaultVerticalDatum.class, XML_FILE);
-        assertIsMeanSeaLevel(datum);
-        assertIsWorld((GeographicBoundingBox) getSingleton(datum.getDomainOfValidity().getGeographicElements()));
+        assertIsMeanSeaLevel(datum, true);
         /*
          * Values in the following tests are specific to our XML file.
          * The actual texts in the EPSG database are more descriptive.

Added: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml?rev=1555262&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml (added)
+++ sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml Fri Jan  3 21:52:24 2014
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<gml:CartesianCS xsi:schemaLocation = "http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/coordinateSystems.xsd"
+                 xmlns:gml          = "http://www.opengis.net/gml/3.2"
+                 xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
+                 gml:id             = "epsg-cs-4400">
+  <gml:identifier codeSpace="OGP">urn:ogc:def:cs:EPSG::4400</gml:identifier>
+  <gml:name>Easting, northing (E,N)</gml:name>
+  <gml:remarks>Used in ProjectedCRS.</gml:remarks>
+  <gml:axis>
+    <gml:CoordinateSystemAxis gml:id="epsg-axis-1" uom="urn:ogc:def:uom:EPSG::9001">
+      <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::1</gml:identifier>
+      <gml:name>Easting</gml:name>
+      <gml:axisAbbrev>E</gml:axisAbbrev>
+      <gml:axisDirection codeSpace="EPSG">east</gml:axisDirection>
+    </gml:CoordinateSystemAxis>
+  </gml:axis>
+  <gml:axis>
+    <gml:CoordinateSystemAxis gml:id="epsg-axis-2" uom="urn:ogc:def:uom:EPSG::9001">
+      <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::2</gml:identifier>
+      <gml:name>Northing</gml:name>
+      <gml:axisAbbrev>N</gml:axisAbbrev>
+      <gml:axisDirection codeSpace="EPSG">north</gml:axisDirection>
+    </gml:CoordinateSystemAxis>
+  </gml:axis>
+</gml:CartesianCS>

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml Fri Jan  3 21:52:24 2014
@@ -29,7 +29,7 @@
     <gml:CoordinateSystemAxis gml:id="epsg-axis-106" uom="urn:ogc:def:uom:EPSG::9122">
       <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::106</gml:identifier>
       <gml:name>Geodetic latitude</gml:name>
-      <gml:axisAbbrev>Lat</gml:axisAbbrev>
+      <gml:axisAbbrev>φ</gml:axisAbbrev>
       <gml:axisDirection codeSpace="EPSG">north</gml:axisDirection>
       <gml:minimumValue>-90</gml:minimumValue>
       <gml:maximumValue>+90</gml:maximumValue>
@@ -40,7 +40,7 @@
     <gml:CoordinateSystemAxis gml:id="epsg-axis-107" uom="urn:ogc:def:uom:EPSG::9122">
       <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::107</gml:identifier>
       <gml:name>Geodetic longitude</gml:name>
-      <gml:axisAbbrev>Long</gml:axisAbbrev>
+      <gml:axisAbbrev>λ</gml:axisAbbrev>
       <gml:axisDirection codeSpace="EPSG">east</gml:axisDirection>
       <gml:minimumValue>-180</gml:minimumValue>
       <gml:maximumValue>+180</gml:maximumValue>

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -125,7 +125,7 @@ public final class Measure {
      */
     @XmlAttribute(name = "uom", required = true)
     public String getUOM() {
-        return getUOM(unit, asXPointer);
+        return getUOM(unit, asXPointer, false);
     }
 
     /**
@@ -135,11 +135,12 @@ public final class Measure {
      *
      * @param  unit The unit to format.
      * @param  asXPointer {@code true} if the units shall be formatted as {@code xpointer}.
-     * @return
+     * @param  inAxis {@code true} for a unit used in Coordinate System Axis definition.
+     * @return The string representation of the unit of measure.
      */
-    static String getUOM(final Unit<?> unit, final boolean asXPointer) {
+    static String getUOM(final Unit<?> unit, final boolean asXPointer, final boolean inAxis) {
         if (!asXPointer) {
-            final Integer code = Units.getEpsgCode(unit);
+            final Integer code = Units.getEpsgCode(unit, inAxis);
             if (code != null) {
                 return "urn:ogc:def:uom:EPSG::" + code;
             }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -58,13 +58,16 @@ public class UnitAdapter extends XmlAdap
     }
 
     /**
-     * A variant of {@link UnitAdapter} which marshal units as an URN.
+     * A variant of {@link UnitAdapter} which marshal units as an URN for Coordinate System (CS) axes.
      * Example: {@code "urn:ogc:def:uom:EPSG::9001"}.
+     *
+     * The difference between coordinate system axis and other uses (prime meridian, etc.) is in the choice of EPSG
+     * code for the degrees. See {@link org.apache.sis.measure.Units#getEpsgCode(Unit, boolean)} for more information.
      */
-    public static final class AsURN extends UnitAdapter {
+    public static final class ForCS extends UnitAdapter {
         @Override
         public String marshal(final Unit<?> value) {
-            return Measure.getUOM(value, false);
+            return Measure.getUOM(value, false, true);
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -439,7 +439,7 @@ public final class Units extends Static 
     /**
      * Returns {@code true} if the given unit seems to be an URI. Example:
      * <ul>
-     *   <li>{@code "urn:ogc:def:uom:EPSG::9102"}</li>
+     *   <li>{@code "urn:ogc:def:uom:EPSG::9001"}</li>
      *   <li>{@code "http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"}</li>
      * </ul>
      */
@@ -460,17 +460,17 @@ public final class Units extends Static 
      * {@code null}.
      *
      * <p>The list of units recognized by this method is not exhaustive. This method recognizes
-     * the base units declared in the {@code [TARGET_UOM_CODE]} column of the above-cited table,
+     * the base units declared in the {@code TARGET_UOM_CODE} column of the above-cited table,
      * and some frequently-used units. The list of recognized units may be updated in any future
      * version of SIS.</p>
      *
      * <p>The {@link org.apache.sis.referencing.factory.epsg.DirectEpsgFactory} uses this method
      * for fetching the base units, and derives automatically other units from the information
-     * found in the EPSG database. This method is also used by other code not directly related
+     * found in the EPSG database. This method is also used by other classes not directly related
      * to the EPSG database, like {@link org.apache.sis.referencing.factory.web.AutoCRSFactory}
      * which uses EPSG code for identifying units.</p>
      *
-     * <p>The values currently recognized are:</p>
+     * <p>The currently recognized values are:</p>
      * <table class="sis">
      *   <tr>
      *     <th>Linear units</th>
@@ -507,6 +507,10 @@ public final class Units extends Static 
      *   </tr>
      * </table>
      *
+     * <b>Note:</b> EPSG uses code 9102 (<cite>degree</cite>) for prime meridian and coordinate operation parameters,
+     * and code 9122 (<cite>degree (supplier to define representation)</cite>) for coordinate system axes.
+     * But Apache SIS considers those two codes as synonymous.
+     *
      * @param  code The EPSG code for a unit of measurement.
      * @return The unit, or {@code null} if the code is unrecognized.
      */
@@ -538,12 +542,26 @@ public final class Units extends Static 
      * Returns the EPSG code of the given units, or {@code null} if unknown.
      * This method is the converse of {@link #valueOfEPSG(int)}.
      *
+     * <p>The same unit may be represented by different EPSG codes depending on the context:</p>
+     * <ul>
+     *   <li>EPSG:9102 – <cite>degree</cite> – is used for prime meridian and coordinate operation parameters.</li>
+     *   <li>EPSG:9122 – <cite>degree (supplier to define representation)</cite> – is used for coordinate system axes.</li>
+     * </ul>
+     *
+     * When such choice exists, the code to return is determined by the {@code inAxis} argument,
+     * which specifies whether the code will be used for axis definition or in other context.
+     *
      * @param  unit The unit for which to get the EPSG code.
+     * @param  inAxis {@code true} for a unit used in Coordinate System Axis definition.
      * @return The EPSG code of the given units, or {@code null} if unknown.
      *
      * @since 0.4
      */
-    public static Integer getEpsgCode(final Unit<?> unit) {
-        return UnitsMap.EPSG_CODES.get(unit);
+    public static Integer getEpsgCode(final Unit<?> unit, final boolean inAxis) {
+        Integer code = UnitsMap.EPSG_CODES.get(unit);
+        if (inAxis && code != null && code.intValue() == 9102) {
+            code = UnitsMap.I9122;
+        }
+        return code;
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -46,6 +46,12 @@ final class UnitsMap extends Static {
     }
 
     /**
+     * The 9122 integer, used as an alternative code for the degrees unit.
+     * See {@link Units#getEpsgCode(Unit, boolean)} for more information.
+     */
+    static final Integer I9122 = 9122;
+
+    /**
      * EPSG codes of some units. This map is the reverse of {@link Units#valueOfEPSG(int)}.
      * The map is defined in this class rather than in the {@code Units} class in order to
      * avoid loading the {@code SexagesimalConverter} class before needed, since their

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java?rev=1555262&r1=1555261&r2=1555262&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java [UTF-8] Fri Jan  3 21:52:24 2014
@@ -255,7 +255,8 @@ public final strictfp class UnitsTest ex
     @Test
     public void testValueOfEPSG() {
         assertSame(METRE,        valueOfEPSG(9001));
-        assertSame(DEGREE_ANGLE, valueOfEPSG(9102));
+        assertSame(DEGREE_ANGLE, valueOfEPSG(9102)); // Used in prime meridian and operation parameters.
+        assertSame(DEGREE_ANGLE, valueOfEPSG(9122)); // Used in coordinate system axes.
         assertSame(METRE,        valueOf("EPSG:9001"));
         assertSame(DEGREE_ANGLE, valueOf(" epsg : 9102"));
         assertSame(DEGREE_ANGLE, valueOf("urn:ogc:def:uom:EPSG::9102"));
@@ -264,12 +265,14 @@ public final strictfp class UnitsTest ex
     }
 
     /**
-     * Tests {@link Units#getEpsgCode(Unit)}.
+     * Tests {@link Units#getEpsgCode(Unit, boolean)}.
      */
     @Test
     public void testGetEpsgCode() {
-        assertEquals(Integer.valueOf(9001), getEpsgCode(METRE));
-        assertEquals(Integer.valueOf(9102), getEpsgCode(DEGREE_ANGLE));
-        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS));
+        assertEquals(Integer.valueOf(9001), getEpsgCode(METRE, false));
+        assertEquals(Integer.valueOf(9102), getEpsgCode(DEGREE_ANGLE, false));
+        assertEquals(Integer.valueOf(9122), getEpsgCode(DEGREE_ANGLE, true));
+        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS, false));
+        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS, true));
     }
 }



Mime
View raw message