sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1767577 [8/15] - in /sis/trunk: ./ application/ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-openoffice/ application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ core/ core/sis-feature/src/main/j...
Date Tue, 01 Nov 2016 21:03:08 GMT
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -23,9 +23,7 @@ import java.util.Iterator;
 import java.util.Locale;
 import java.text.ParsePosition;
 import java.text.ParseException;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Length;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.cs.*;
@@ -43,6 +41,7 @@ import org.apache.sis.referencing.datum.
 import org.apache.sis.referencing.factory.GeodeticObjectFactory;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
 import org.apache.sis.referencing.operation.transform.LinearTransform;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -61,7 +60,7 @@ import org.opengis.util.Factory;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -94,9 +93,9 @@ public final strictfp class GeodeticObje
     /**
      * Parses the given text. It is caller's responsibility to verify if some warnings have been emitted.
      *
-     * @param  type The expected object type.
-     * @param  text The WKT string to parse.
-     * @return The parsed object.
+     * @param  type  the expected object type.
+     * @param  text  the WKT string to parse.
+     * @return the parsed object.
      * @throws ParseException if an error occurred during the parsing.
      */
     private <T> T parseIgnoreWarnings(final Class<T> type, final String text) throws ParseException {
@@ -114,9 +113,9 @@ public final strictfp class GeodeticObje
     /**
      * Parses the given text and ensure that no warnings have been emitted.
      *
-     * @param  type The expected object type.
-     * @param  text The WKT string to parse.
-     * @return The parsed object.
+     * @param  type  the expected object type.
+     * @param  text  the WKT string to parse.
+     * @return the parsed object.
      * @throws ParseException if an error occurred during the parsing.
      */
     private <T> T parse(final Class<T> type, final String text) throws ParseException {
@@ -133,8 +132,8 @@ public final strictfp class GeodeticObje
      * <p>This method is similar to {@link #assertEpsgNameAndIdentifierEqual(String, int, IdentifiedObject)} except
      * that the given name is not necessarily in the EPSG namespace and the EPSG code is allowed to be absent.</p>
      *
-     * @param name The expected name.
-     * @param epsg The expected EPSG identifier, or {@code 0} if the object shall have no identifier.
+     * @param name  the expected name.
+     * @param epsg  the expected EPSG identifier, or {@code 0} if the object shall have no identifier.
      */
     static void assertNameAndIdentifierEqual(final String name, final int epsg, final IdentifiedObject object) {
         final String message = object.getClass().getSimpleName();
@@ -152,7 +151,7 @@ public final strictfp class GeodeticObje
      * because {@link GeodeticObjectParser} should have done the replacement.
      */
     private static void assertLongitudeAxisEquals(final CoordinateSystemAxis axis) {
-        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST, -180, +180, NonSI.DEGREE_ANGLE, RangeMeaning.WRAPAROUND, axis);
+        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST, -180, +180, Units.DEGREE, RangeMeaning.WRAPAROUND, axis);
     }
 
     /**
@@ -161,7 +160,7 @@ public final strictfp class GeodeticObje
      * because {@link GeodeticObjectParser} should have done the replacement.
      */
     private static void assertLatitudeAxisEquals(final CoordinateSystemAxis axis) {
-        assertAxisEquals(AxisNames.GEODETIC_LATITUDE, "φ", AxisDirection.NORTH, -90, +90, NonSI.DEGREE_ANGLE, RangeMeaning.EXACT, axis);
+        assertAxisEquals(AxisNames.GEODETIC_LATITUDE, "φ", AxisDirection.NORTH, -90, +90, Units.DEGREE, RangeMeaning.EXACT, axis);
     }
 
     /**
@@ -184,37 +183,37 @@ public final strictfp class GeodeticObje
         assertEquals("name", "Y", axis.getName().getCode());
         assertEquals("abbreviation", "Y", axis.getAbbreviation());
         assertEquals("direction", AxisDirection.GEOCENTRIC_Y, axis.getDirection());
-        assertEquals("unit", SI.METRE, axis.getUnit());
+        assertEquals("unit", Units.METRE, axis.getUnit());
 
         axis = parse(CoordinateSystemAxis.class, "AXIS[“latitude”,north,ORDER[1],ANGLEUNIT[“degree”,0.0174532925199433]]");
         assertEquals("name", "Latitude", axis.getName().getCode());
         assertEquals("abbreviation", "φ", axis.getAbbreviation());
         assertEquals("direction", AxisDirection.NORTH, axis.getDirection());
-        assertEquals("unit", NonSI.DEGREE_ANGLE, axis.getUnit());
+        assertEquals("unit", Units.DEGREE, axis.getUnit());
 
         axis = parse(CoordinateSystemAxis.class, "AXIS[“longitude”,EAST,order[2],UNIT[“degree”,0.0174532925199433]]");
         assertEquals("name", "Longitude", axis.getName().getCode());
         assertEquals("abbreviation", "λ", axis.getAbbreviation());
         assertEquals("direction", AxisDirection.EAST, axis.getDirection());
-        assertEquals("unit", NonSI.DEGREE_ANGLE, axis.getUnit());
+        assertEquals("unit", Units.DEGREE, axis.getUnit());
 
         axis = parse(CoordinateSystemAxis.class, "AXIS[“ellipsoidal height (h)”,up,ORDER[3],LengthUnit[“kilometre”,1000]]");
         assertEquals("name", "Ellipsoidal height", axis.getName().getCode());
         assertEquals("abbreviation", "h", axis.getAbbreviation());
         assertEquals("direction", AxisDirection.UP, axis.getDirection());
-        assertEquals("unit", SI.KILOMETRE, axis.getUnit());
+        assertEquals("unit", Units.KILOMETRE, axis.getUnit());
 
         axis = parse(CoordinateSystemAxis.class, "AXIS[“time (t)”,future,TimeUnit[“hour”,3600]]");
         assertEquals("name", "Time", axis.getName().getCode());
         assertEquals("abbreviation", "t", axis.getAbbreviation());
         assertEquals("direction", AxisDirection.FUTURE, axis.getDirection());
-        assertEquals("unit", NonSI.HOUR, axis.getUnit());
+        assertEquals("unit", Units.HOUR, axis.getUnit());
 
         axis = parse(CoordinateSystemAxis.class, "AXIS[“easting (X)”,south,MERIDIAN[90,UNIT[“degree”,0.0174532925199433]]]");
         assertEquals("name", "Easting", axis.getName().getCode());
         assertEquals("abbreviation", "X", axis.getAbbreviation());
         assertEquals("direction", CoordinateSystems.directionAlongMeridian(AxisDirection.SOUTH, 90), axis.getDirection());
-        assertEquals("unit", SI.METRE, axis.getUnit());
+        assertEquals("unit", Units.METRE, axis.getUnit());
     }
 
     /**
@@ -226,7 +225,7 @@ public final strictfp class GeodeticObje
     public void testDatum() throws ParseException {
         final GeodeticDatum datum = parse(GeodeticDatum.class,
                 "DATUM[“Tananarive 1925”,\n" +
-                "  ELLIPSOID[“International 1924”, 6378.388, 297.0, LENGTHUNIT[“km”, 1000]],\n" +
+                "  ELLIPSOID[“International 1924”, 6378.388, 297.0, LENGTHUNIT[“kilometre”, 1000]],\n" +
                 "  ANCHOR[“Tananarive observatory”]]");
 
         assertNameAndIdentifierEqual("Tananarive 1925", 0, datum);
@@ -234,7 +233,7 @@ public final strictfp class GeodeticObje
 
         final Ellipsoid ellipsoid = datum.getEllipsoid();
         assertNameAndIdentifierEqual("International 1924", 0, ellipsoid);
-        assertEquals("unit", SI.KILOMETRE, ellipsoid.getAxisUnit());
+        assertEquals("unit", Units.KILOMETRE, ellipsoid.getAxisUnit());
         assertEquals("semiMajor", 6378.388, ellipsoid.getSemiMajorAxis(), STRICT);
         assertEquals("inverseFlattening", 297, ellipsoid.getInverseFlattening(), STRICT);
         assertEquals("greenwichLongitude", 0, datum.getPrimeMeridian().getGreenwichLongitude(), STRICT);
@@ -275,9 +274,9 @@ public final strictfp class GeodeticObje
         // Verify that the OGC 01-009 axes have been relaced by ISO 19111 axes.
         final CartesianCS cs = (CartesianCS) crs.getCoordinateSystem();
         assertEquals("dimension", 3, cs.getDimension());
-        assertUnboundedAxisEquals(AxisNames.GEOCENTRIC_X, "X", AxisDirection.GEOCENTRIC_X, SI.METRE, cs.getAxis(0));
-        assertUnboundedAxisEquals(AxisNames.GEOCENTRIC_Y, "Y", AxisDirection.GEOCENTRIC_Y, SI.METRE, cs.getAxis(1));
-        assertUnboundedAxisEquals(AxisNames.GEOCENTRIC_Z, "Z", AxisDirection.GEOCENTRIC_Z, SI.METRE, cs.getAxis(2));
+        assertUnboundedAxisEquals(AxisNames.GEOCENTRIC_X, "X", AxisDirection.GEOCENTRIC_X, Units.METRE, cs.getAxis(0));
+        assertUnboundedAxisEquals(AxisNames.GEOCENTRIC_Y, "Y", AxisDirection.GEOCENTRIC_Y, Units.METRE, cs.getAxis(1));
+        assertUnboundedAxisEquals(AxisNames.GEOCENTRIC_Z, "Z", AxisDirection.GEOCENTRIC_Z, Units.METRE, cs.getAxis(2));
     }
 
     /**
@@ -414,24 +413,24 @@ public final strictfp class GeodeticObje
                      "  DATUM[“Nouvelle Triangulation Française (Paris)”,\n" +
                      "    SPHEROID[“Clarke 1880 (IGN)”, 6378249.2, 293.4660212936269]],\n" +
                      "    PRIMEM[“Paris”, 2.5969213, AUTHORITY[“EPSG”, “8903”]],\n" +
-                     "  UNIT[“grade”, 0.015707963267948967],\n" +
+                     "  UNIT[“grad”, 0.015707963267948967],\n" +
                      "  AXIS[“Latitude”, NORTH],\n" +
                      "  AXIS[“Longitude”, EAST]]";
 
         GeographicCRS crs = parse(GeographicCRS.class, wkt);
         assertNameAndIdentifierEqual("NTF (Paris)", 0, crs);
         PrimeMeridian pm = verifyNTF(crs.getDatum(), false);
-        assertEquals("angularUnit", NonSI.GRADE, pm.getAngularUnit());
+        assertEquals("angularUnit", Units.GRAD, pm.getAngularUnit());
         assertEquals("greenwichLongitude", 2.5969213, pm.getGreenwichLongitude(), STRICT);
         EllipsoidalCS cs = crs.getCoordinateSystem();
         assertEquals("dimension", 2, cs.getDimension());
-        assertAxisEquals(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH, -100, +100, NonSI.GRADE, RangeMeaning.EXACT,      cs.getAxis(0));
-        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,  -200, +200, NonSI.GRADE, RangeMeaning.WRAPAROUND, cs.getAxis(1));
+        assertAxisEquals(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH, -100, +100, Units.GRAD, RangeMeaning.EXACT,      cs.getAxis(0));
+        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,  -200, +200, Units.GRAD, RangeMeaning.WRAPAROUND, cs.getAxis(1));
         /*
          * Parse again using Convention.WKT1_COMMON_UNITS and ignoring AXIS[…] elements (but not the UNIT[…] element,
          * which still apply to the axes). When using this convention, the parser does not apply the angular units to
          * the Greenwich longitude value in PRIMEM[…] elements. Instead, the longitude is unconditionally interpreted
-         * as a value in degrees, which is why we convert "2.5969213" grade to "2.33722917" degrees in the WKT before
+         * as a value in degrees,  which is why we convert "2.5969213" grad to "2.33722917" degrees in the WKT before
          * to run the test (but we do NOT change the UNIT[…] element since the purpose of this test is to verify that
          * those units are ignored).
          *
@@ -443,12 +442,12 @@ public final strictfp class GeodeticObje
         crs = parse(GeographicCRS.class, wkt);
         assertNameAndIdentifierEqual("NTF (Paris)", 0, crs);
         pm = verifyNTF(crs.getDatum(), false);
-        assertEquals("angularUnit", NonSI.DEGREE_ANGLE, pm.getAngularUnit());
+        assertEquals("angularUnit", Units.DEGREE, pm.getAngularUnit());
         assertEquals("greenwichLongitude", 2.33722917, pm.getGreenwichLongitude(), STRICT);
         cs = crs.getCoordinateSystem();
         assertEquals("dimension", 2, cs.getDimension());
-        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,  -200, +200, NonSI.GRADE, RangeMeaning.WRAPAROUND, cs.getAxis(0));
-        assertAxisEquals(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH, -100, +100, NonSI.GRADE, RangeMeaning.EXACT,      cs.getAxis(1));
+        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,  -200, +200, Units.GRAD, RangeMeaning.WRAPAROUND, cs.getAxis(0));
+        assertAxisEquals(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH, -100, +100, Units.GRAD, RangeMeaning.EXACT,      cs.getAxis(1));
     }
 
     /**
@@ -459,7 +458,7 @@ public final strictfp class GeodeticObje
      *     the same angular units as those for the horizontal axes of the geographic CRS."
      *
      * Consequently we expect the prime meridian to be in decimal degrees even if the WKT used in this test has
-     * an {@code Unit[“grade”, 0.015707963267948967]} element, because this WK also declare the axis as being in
+     * an {@code Unit[“grad”, 0.015707963267948967]} element, because this WK also declare the axis as being in
      * degrees. Since this can be confusing, we expect the parser to emit a warning.
      *
      * @throws ParseException if the parsing failed.
@@ -474,7 +473,7 @@ public final strictfp class GeodeticObje
                      "  CS[ellipsoidal, 2],\n" +
                      "    Axis[“Latitude (φ)”, NORTH, Unit[“degree”, 0.017453292519943295]],\n" +
                      "    Axis[“Longitude (λ)”, EAST, Unit[“degree”, 0.017453292519943295]],\n" +
-                     "    Unit[“grade”, 0.015707963267948967]\n," +             // Inconsistent with axis units.
+                     "    Unit[“grad”, 0.015707963267948967]\n," +             // Inconsistent with axis units.
                      "  Id[“EPSG”, 4807]]";
 
         GeographicCRS crs = parseIgnoreWarnings(GeographicCRS.class, wkt);
@@ -485,19 +484,19 @@ public final strictfp class GeodeticObje
 
         assertNameAndIdentifierEqual("NTF (Paris)", 4807, crs);
         PrimeMeridian pm = crs.getDatum().getPrimeMeridian();
-        assertEquals("angularUnit", NonSI.DEGREE_ANGLE, pm.getAngularUnit());
+        assertEquals("angularUnit", Units.DEGREE, pm.getAngularUnit());
         assertEquals("greenwichLongitude", 2.33722917, pm.getGreenwichLongitude(), STRICT);
         EllipsoidalCS cs = crs.getCoordinateSystem();
         assertEquals("dimension", 2, cs.getDimension());
-        assertAxisEquals(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH,  -90,  +90, NonSI.DEGREE_ANGLE, RangeMeaning.EXACT,      cs.getAxis(0));
-        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,  -180, +180, NonSI.DEGREE_ANGLE, RangeMeaning.WRAPAROUND, cs.getAxis(1));
+        assertAxisEquals(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH,  -90,  +90, Units.DEGREE, RangeMeaning.EXACT,      cs.getAxis(0));
+        assertAxisEquals(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,  -180, +180, Units.DEGREE, RangeMeaning.WRAPAROUND, cs.getAxis(1));
     }
 
     /**
      * Implementation of {@link #testGeographicCRS()} and {@link #testWithAxisSwapping()}.
      * This test expects no {@code AUTHORITY} element on any component.
      *
-     * @param swap 1 if axes are expected to be swapped, or 0 otherwise.
+     * @param  swap  1 if axes are expected to be swapped, or 0 otherwise.
      */
     private void verifyGeographicCRS(final int swap, final GeographicCRS crs) throws ParseException {
         assertNameAndIdentifierEqual("WGS 84", 0, crs);
@@ -554,7 +553,7 @@ public final strictfp class GeodeticObje
                 "  AXIS[“Northing”, NORTH]]");
 
         assertNameAndIdentifierEqual("Mercator test", 0, crs);
-        verifyProjectedCS(crs.getCoordinateSystem(), SI.METRE);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.METRE);
         verifyGeographicCRS(0, crs.getBaseCRS());
 
         final GeodeticDatum datum = crs.getDatum();
@@ -568,12 +567,12 @@ public final strictfp class GeodeticObje
 
         assertEquals("Mercator (variant A)", crs.getConversionFromBase().getMethod().getName().getCode());
         final ParameterValueGroup param = crs.getConversionFromBase().getParameterValues();
-        assertEquals("semi_major",   6378137.0, param.parameter("semi_major"      ).doubleValue(SI   .METRE),        STRICT);
-        assertEquals("semi_minor",   6356752.3, param.parameter("semi_minor"      ).doubleValue(SI   .METRE),        0.1);
-        assertEquals("central_meridian", -20.0, param.parameter("central_meridian").doubleValue(NonSI.DEGREE_ANGLE), STRICT);
-        assertEquals("scale_factor",       1.0, param.parameter("scale_factor"    ).doubleValue(Unit .ONE),          STRICT);
-        assertEquals("false_easting", 500000.0, param.parameter("false_easting"   ).doubleValue(SI   .METRE),        STRICT);
-        assertEquals("false_northing",     0.0, param.parameter("false_northing"  ).doubleValue(SI   .METRE),        STRICT);
+        assertEquals("semi_major",   6378137.0, param.parameter("semi_major"      ).doubleValue(Units.METRE),  STRICT);
+        assertEquals("semi_minor",   6356752.3, param.parameter("semi_minor"      ).doubleValue(Units.METRE),  0.1);
+        assertEquals("central_meridian", -20.0, param.parameter("central_meridian").doubleValue(Units.DEGREE), STRICT);
+        assertEquals("scale_factor",       1.0, param.parameter("scale_factor"    ).doubleValue(Units.UNITY),    STRICT);
+        assertEquals("false_easting", 500000.0, param.parameter("false_easting"   ).doubleValue(Units.METRE),  STRICT);
+        assertEquals("false_northing",     0.0, param.parameter("false_northing"  ).doubleValue(Units.METRE),  STRICT);
     }
 
     /**
@@ -608,7 +607,7 @@ public final strictfp class GeodeticObje
         assertNameAndIdentifierEqual("OSGB 1936 / British National Grid", 27700, crs);
         assertNameAndIdentifierEqual("OSGB 1936", 4277, crs.getBaseCRS());
         assertNameAndIdentifierEqual("OSGB_1936", 6277, crs.getDatum());
-        verifyProjectedCS(crs.getCoordinateSystem(), SI.METRE);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.METRE);
 
         final ParameterValueGroup param = crs.getConversionFromBase().getParameterValues();
         assertEquals("Transverse Mercator", crs.getConversionFromBase().getMethod().getName().getCode());
@@ -650,14 +649,14 @@ public final strictfp class GeodeticObje
                "  PARAMETER[“scale_factor”, 0.95],\n" +
                "  PARAMETER[“false_easting”, 0.0],\n" +
                "  PARAMETER[“false_northing”, 0.0],\n" +
-               "  UNIT[“feet”, 0.304800609601219],\n" +
+               "  UNIT[“US survey foot”, 0.304800609601219],\n" +
                "  AXIS[“E”, EAST],\n" +
                "  AXIS[“N”, NORTH]]");
 
         assertNameAndIdentifierEqual("TransverseMercator", 0, crs);
         assertNameAndIdentifierEqual("Sphere", 0, crs.getBaseCRS());
         assertNameAndIdentifierEqual("Sphere", 0, crs.getDatum());
-        verifyProjectedCS(crs.getCoordinateSystem(), NonSI.FOOT_SURVEY_US);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.US_SURVEY_FOOT);
 
         final ParameterValueGroup param = crs.getConversionFromBase().getParameterValues();
         assertEquals("Transverse Mercator", crs.getConversionFromBase().getMethod().getName().getCode());
@@ -671,7 +670,7 @@ public final strictfp class GeodeticObje
     }
 
     /**
-     * Tests the parsing of a projected CRS using angular values in grades instead than degrees
+     * Tests the parsing of a projected CRS using angular values in grads instead than degrees
      * and in lengths in kilometres instead than metres.
      *
      * @throws ParseException if the parsing failed.
@@ -684,10 +683,10 @@ public final strictfp class GeodeticObje
                      "    DATUM[“Nouvelle Triangulation Française (Paris)”," +
                      "      SPHEROID[“Clarke 1880 (IGN)”, 6378249.2, 293.4660212936269]," +
                      "      TOWGS84[-168,-60,320,0,0,0,0]]," +
-                     "    PRIMEM[“Paris”, 2.5969213, AUTHORITY[“EPSG”, “8903”]]," +  // In grades.
+                     "    PRIMEM[“Paris”, 2.5969213, AUTHORITY[“EPSG”, “8903”]]," +     // In grads.
                      "    UNIT[“grad”, 0.01570796326794897]]," +
                      "  PROJECTION[“Lambert Conformal Conic (1SP)”]," +  // Intentional swapping of "Conformal" and "Conic".
-                     "  PARAMETER[“latitude_of_origin”, 52.0]," +        // In grades.
+                     "  PARAMETER[“latitude_of_origin”, 52.0]," +        // In grads.
                      "  PARAMETER[“scale_factor”, 0.99987742]," +
                      "  PARAMETER[“false_easting”, 600.0]," +
                      "  PARAMETER[“false_northing”, 2200.0]," +
@@ -707,12 +706,12 @@ public final strictfp class GeodeticObje
         newParser(Convention.WKT1_IGNORE_AXES);
         final ProjectedCRS crs = parse(ProjectedCRS.class, wkt);
         assertNameAndIdentifierEqual("NTF (Paris) / Lambert zone II", 0, crs);
-        verifyProjectedCS(crs.getCoordinateSystem(), SI.KILOMETRE);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.KILOMETRE);
         final PrimeMeridian pm = verifyNTF(crs.getDatum(), true);
-        assertEquals("angularUnit", NonSI.DEGREE_ANGLE, pm.getAngularUnit());
+        assertEquals("angularUnit", Units.DEGREE, pm.getAngularUnit());
         assertEquals("greenwichLongitude", 2.33722917, pm.getGreenwichLongitude(), STRICT);
         final ParameterValue<?> param = verifyNTF(crs.getConversionFromBase().getParameterValues());
-        assertEquals("angularUnit", NonSI.DEGREE_ANGLE, param.getUnit());
+        assertEquals("angularUnit", Units.DEGREE, param.getUnit());
         assertEquals("latitude_of_origin",  46.8, param.doubleValue(), STRICT);
     }
 
@@ -732,11 +731,11 @@ public final strictfp class GeodeticObje
                      "  BaseGeodCRS[“NTF (Paris)”,\n" +
                      "    Datum[“Nouvelle Triangulation Française (Paris)”,\n" +
                      "      Ellipsoid[“Clarke 1880 (IGN)”, 6378249.2, 293.4660212936269]],\n" +
-                     "      PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903]],\n" +
+                     "      PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967], Id[“EPSG”, 8903]],\n" +
                      "    AngleUnit[“degree”, 0.017453292519943295]],\n" +
                      "  Conversion[“Lambert zone II”,\n" +
                      "    Method[“Lambert Conic Conformal (1SP)”],\n" +
-                     "    Parameter[“Latitude of natural origin”, 52.0, AngleUnit[“grade”, 0.015707963267948967]],\n" +
+                     "    Parameter[“Latitude of natural origin”, 52.0, AngleUnit[“grad”, 0.015707963267948967]],\n" +
                      "    Parameter[“Longitude of natural origin”, 0.0],\n" +
                      "    Parameter[“Scale factor at natural origin”, 0.99987742],\n" +
                      "    Parameter[“False easting”, 600.0],\n" +
@@ -744,7 +743,7 @@ public final strictfp class GeodeticObje
                      "  CS[Cartesian, 2],\n" +
                      "    Axis[“Easting (E)”, east],\n" +
                      "    Axis[“Northing (N)”, north],\n" +
-                     "    LengthUnit[“km”, 1000],\n" +
+                     "    LengthUnit[“kilometre”, 1000],\n" +
                      "  Scope[“Large and medium scale topographic mapping and engineering survey.”],\n" +
                      "  Id[“EPSG”, 27572, URI[“urn:ogc:def:crs:EPSG::27572”]]]";
 
@@ -758,12 +757,12 @@ public final strictfp class GeodeticObje
      */
     private static void validateParisFranceII(final ProjectedCRS crs, final int identifier, final boolean hasToWGS84) {
         assertNameAndIdentifierEqual("NTF (Paris) / Lambert zone II", identifier, crs);
-        verifyProjectedCS(crs.getCoordinateSystem(), SI.KILOMETRE);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.KILOMETRE);
         final PrimeMeridian pm = verifyNTF(crs.getDatum(), hasToWGS84);
-        assertEquals("angularUnit", NonSI.GRADE, pm.getAngularUnit());
+        assertEquals("angularUnit", Units.GRAD, pm.getAngularUnit());
         assertEquals("greenwichLongitude", 2.5969213, pm.getGreenwichLongitude(), STRICT);
         final ParameterValue<?> param = verifyNTF(crs.getConversionFromBase().getParameterValues());
-        assertEquals("angularUnit", NonSI.GRADE, param.getUnit());
+        assertEquals("angularUnit", Units.GRAD, param.getUnit());
         assertEquals("latitude_of_origin",  52.0, param.doubleValue(), STRICT);
     }
 
@@ -803,12 +802,12 @@ public final strictfp class GeodeticObje
      */
     private static ParameterValue<?> verifyNTF(final ParameterValueGroup param) {
         assertEquals("Lambert Conic Conformal (1SP)", param.getDescriptor().getName().getCode());
-        assertEquals("semi_major",     6378249.2, param.parameter("semi_major"      ).doubleValue(SI   .METRE),        STRICT);
-        assertEquals("semi_minor",     6356515.0, param.parameter("semi_minor"      ).doubleValue(SI   .METRE),        1E-12);
-        assertEquals("central_meridian",     0.0, param.parameter("central_meridian").doubleValue(NonSI.DEGREE_ANGLE), STRICT);
-        assertEquals("scale_factor",  0.99987742, param.parameter("scale_factor"    ).doubleValue(Unit .ONE),          STRICT);
-        assertEquals("false_easting",   600000.0, param.parameter("false_easting"   ).doubleValue(SI   .METRE),        STRICT);
-        assertEquals("false_northing", 2200000.0, param.parameter("false_northing"  ).doubleValue(SI   .METRE),        STRICT);
+        assertEquals("semi_major",     6378249.2, param.parameter("semi_major"      ).doubleValue(Units.METRE),  STRICT);
+        assertEquals("semi_minor",     6356515.0, param.parameter("semi_minor"      ).doubleValue(Units.METRE),  1E-12);
+        assertEquals("central_meridian",     0.0, param.parameter("central_meridian").doubleValue(Units.DEGREE), STRICT);
+        assertEquals("scale_factor",  0.99987742, param.parameter("scale_factor"    ).doubleValue(Units.UNITY),    STRICT);
+        assertEquals("false_easting",   600000.0, param.parameter("false_easting"   ).doubleValue(Units.METRE),  STRICT);
+        assertEquals("false_northing", 2200000.0, param.parameter("false_northing"  ).doubleValue(Units.METRE),  STRICT);
         return param.parameter("latitude_of_origin");
     }
 
@@ -845,7 +844,7 @@ public final strictfp class GeodeticObje
                 "AXIS[“Easting”,East],AXIS[“Northing”,North]]");
 
         assertNameAndIdentifierEqual("FRANCE/NTF/Lambert III", 0, crs);
-        verifyProjectedCS(crs.getCoordinateSystem(), SI.METRE);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.METRE);
         final GeographicCRS geoCRS = crs.getBaseCRS();
         assertNameAndIdentifierEqual("NTF=GR3DF97A", 0, geoCRS);    // Inherited the datum name.
 
@@ -867,13 +866,13 @@ public final strictfp class GeodeticObje
 
         final ParameterValueGroup param = crs.getConversionFromBase().getParameterValues();
         assertEquals("Lambert Conic Conformal (1SP)", param.getDescriptor().getName().getCode());
-        assertEquals("semi_major",        6378249.2, param.parameter("semi_major"        ).doubleValue(SI   .METRE),        STRICT);
-        assertEquals("semi_minor",        6356515.0, param.parameter("semi_minor"        ).doubleValue(SI   .METRE),        1E-12);
-        assertEquals("latitude_of_origin",     44.1, param.parameter("latitude_of_origin").doubleValue(NonSI.DEGREE_ANGLE), STRICT);
-        assertEquals("central_meridian", 2.33722917, param.parameter("central_meridian"  ).doubleValue(NonSI.DEGREE_ANGLE), STRICT);
-        assertEquals("scale_factor",    0.999877499, param.parameter("scale_factor"      ).doubleValue(Unit .ONE),          STRICT);
-        assertEquals("false_easting",      600000.0, param.parameter("false_easting"     ).doubleValue(SI   .METRE),        STRICT);
-        assertEquals("false_northing",     200000.0, param.parameter("false_northing"    ).doubleValue(SI   .METRE),        STRICT);
+        assertEquals("semi_major",        6378249.2, param.parameter("semi_major"        ).doubleValue(Units.METRE),  STRICT);
+        assertEquals("semi_minor",        6356515.0, param.parameter("semi_minor"        ).doubleValue(Units.METRE),  1E-12);
+        assertEquals("latitude_of_origin",     44.1, param.parameter("latitude_of_origin").doubleValue(Units.DEGREE), STRICT);
+        assertEquals("central_meridian", 2.33722917, param.parameter("central_meridian"  ).doubleValue(Units.DEGREE), STRICT);
+        assertEquals("scale_factor",    0.999877499, param.parameter("scale_factor"      ).doubleValue(Units.UNITY),    STRICT);
+        assertEquals("false_easting",      600000.0, param.parameter("false_easting"     ).doubleValue(Units.METRE),  STRICT);
+        assertEquals("false_northing",     200000.0, param.parameter("false_northing"    ).doubleValue(Units.METRE),  STRICT);
     }
 
     /**
@@ -993,9 +992,9 @@ public final strictfp class GeodeticObje
         assertEquals("dimension", 3, cs.getDimension());
 
         // Axis names are arbitrary and could change in future SIS versions.
-        assertUnboundedAxisEquals("Easting",  "x", AxisDirection.EAST,  SI.METRE, cs.getAxis(0));
-        assertUnboundedAxisEquals("Northing", "y", AxisDirection.NORTH, SI.METRE, cs.getAxis(1));
-        assertUnboundedAxisEquals("z",        "z", AxisDirection.UP,    SI.METRE, cs.getAxis(2));
+        assertUnboundedAxisEquals("Easting",  "x", AxisDirection.EAST,  Units.METRE, cs.getAxis(0));
+        assertUnboundedAxisEquals("Northing", "y", AxisDirection.NORTH, Units.METRE, cs.getAxis(1));
+        assertUnboundedAxisEquals("z",        "z", AxisDirection.UP,    Units.METRE, cs.getAxis(2));
     }
 
     /**
@@ -1051,8 +1050,8 @@ public final strictfp class GeodeticObje
         assertEquals("dimension", 4, cs.getDimension());
         assertLongitudeAxisEquals(cs.getAxis(0));
         assertLatitudeAxisEquals (cs.getAxis(1));
-        assertUnboundedAxisEquals("Gravity-related height", "H", AxisDirection.UP, SI.METRE, cs.getAxis(2));
-        assertUnboundedAxisEquals("Time", "t", AxisDirection.FUTURE, NonSI.DAY, cs.getAxis(3));
+        assertUnboundedAxisEquals("Gravity-related height", "H", AxisDirection.UP, Units.METRE, cs.getAxis(2));
+        assertUnboundedAxisEquals("Time", "t", AxisDirection.FUTURE, Units.DAY, cs.getAxis(3));
     }
 
     /**
@@ -1086,7 +1085,7 @@ public final strictfp class GeodeticObje
         assertEquals("dimension", 3, cs.getDimension());
         assertLongitudeAxisEquals(cs.getAxis(0));
         assertLatitudeAxisEquals (cs.getAxis(1));
-        assertUnboundedAxisEquals("Ellipsoidal height", "h", AxisDirection.UP, SI.METRE, cs.getAxis(2));
+        assertUnboundedAxisEquals("Ellipsoidal height", "h", AxisDirection.UP, Units.METRE, cs.getAxis(2));
     }
 
     /**
@@ -1100,7 +1099,7 @@ public final strictfp class GeodeticObje
                     "  DATUM[“North American Datum 1983”,\n" +
                     "    SPHEROID[“GRS 1980”, 6378137.0, 298.257222]],\n" +
                     "  PRIMEM[“Greenwich”, 0],\n" +
-                    "  UNIT[“km”, 1000]]");                                             // Wrong unit
+                    "  UNIT[“kilometre”, 1000]]");                                      // Wrong unit
             fail("Should not have parsed a CRS with wrong unit of measurement.");
         } catch (ParseException e) {
             final String message = e.getMessage();

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTFormatTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTFormatTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTFormatTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTFormatTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,8 +18,8 @@ package org.apache.sis.io.wkt;
 
 import java.util.Collections;
 import java.text.ParseException;
-import javax.measure.unit.NonSI;
 import org.opengis.referencing.crs.VerticalCRS;
+import org.apache.sis.measure.Units;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.referencing.crs.DefaultProjectedCRS;
 import org.apache.sis.referencing.datum.DefaultPrimeMeridian;
@@ -36,7 +36,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @DependsOn(GeodeticObjectParserTest.class)
@@ -380,7 +380,7 @@ public final strictfp class WKTFormatTes
     @Test
     public void testWarnings() throws ParseException {
         DefaultPrimeMeridian pm = new DefaultPrimeMeridian(Collections.singletonMap(
-                DefaultPrimeMeridian.NAME_KEY, "Invalid “$name” here"), -10, NonSI.DEGREE_ANGLE);
+                DefaultPrimeMeridian.NAME_KEY, "Invalid “$name” here"), -10, Units.DEGREE);
         format = new WKTFormat(null, null);
         final String   wkt      = format.format(pm);
         final Warnings warnings = format.getWarnings();

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,8 +19,7 @@ package org.apache.sis.parameter;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Locale;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.parameter.ParameterDescriptor;
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.NumberRange;
@@ -29,6 +28,7 @@ import org.apache.sis.metadata.iso.Immut
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.io.wkt.Convention;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -43,7 +43,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn(org.apache.sis.referencing.AbstractIdentifiedObjectTest.class)
@@ -213,9 +213,9 @@ public final strictfp class DefaultParam
     @Test
     @SuppressWarnings("UnnecessaryBoxing")
     public void testDoubleType() {
-        final ParameterDescriptor<Double> descriptor = create("Length measure", 4, 20, 12, SI.METRE);
+        final ParameterDescriptor<Double> descriptor = create("Length measure", 4, 20, 12, Units.METRE);
         assertEquals("name",         "Length measure",   descriptor.getName().getCode());
-        assertEquals("unit",         SI.METRE,           descriptor.getUnit());
+        assertEquals("unit",         Units.METRE,           descriptor.getUnit());
         assertEquals("class",        Double.class,       descriptor.getValueClass());
         assertEquals("defaultValue", Double.valueOf(12), descriptor.getDefaultValue());
         assertEquals("minimum",      Double.valueOf( 4), descriptor.getMinimumValue());
@@ -279,10 +279,10 @@ public final strictfp class DefaultParam
     @DependsOnMethod("testDoubleType")
     @SuppressWarnings("UnnecessaryBoxing")
     public void testArrayType() {
-        final DefaultParameterDescriptor<double[]> descriptor = createForArray("Array param", 4, 9, SI.METRE);
+        final DefaultParameterDescriptor<double[]> descriptor = createForArray("Array param", 4, 9, Units.METRE);
         assertEquals("name",       "Array param",  descriptor.getName().getCode());
         assertEquals("valueClass", double[].class, descriptor.getValueClass());
-        assertEquals("unit",       SI.METRE,       descriptor.getUnit());
+        assertEquals("unit",       Units.METRE,       descriptor.getUnit());
         assertNull  ("validValues",                descriptor.getValidValues());
         assertNull  ("defaultValue",               descriptor.getDefaultValue());
         assertNull  ("minimumValue",               descriptor.getMinimumValue());
@@ -312,7 +312,7 @@ public final strictfp class DefaultParam
      */
     @Test
     public void testWKT() {
-        final DefaultParameterDescriptor<Double> descriptor = create("Real number", 4, 8, 5, SI.METRE);
+        final DefaultParameterDescriptor<Double> descriptor = create("Real number", 4, 8, 5, Units.METRE);
         assertWktEquals("PARAMETER[“Integer param”, 5]", create("Integer param", 4, 8, 5));
         assertWktEquals("PARAMETER[“Real number”, 5.0, LENGTHUNIT[“metre”, 1]]", descriptor);
         assertWktEquals(Convention.WKT2_SIMPLIFIED, "Parameter[“Real number”, 5.0, Unit[“metre”, 1]]", descriptor);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,9 +16,7 @@
  */
 package org.apache.sis.parameter;
 
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.datum.VerticalDatumType;
 import org.opengis.parameter.ParameterDescriptor;
@@ -42,7 +40,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @SuppressWarnings("UnnecessaryBoxing")
@@ -141,7 +139,7 @@ public final strictfp class DefaultParam
          * Invalid operation: this parameter does not have unit of measurement.
          */
         try {
-            parameter.doubleValue(SI.METRE);
+            parameter.doubleValue(Units.METRE);
             fail("doubleValue(METRE)");
         } catch (IllegalStateException exception) {
             final String message = exception.getMessage();
@@ -238,7 +236,7 @@ public final strictfp class DefaultParam
          * This shall be an invalid operation since we created a unitless parameter.
          */
         try {
-            parameter.setValue(10.0, SI.METRE);
+            parameter.setValue(10.0, Units.METRE);
             fail("setValue(double,Unit)");
         } catch (InvalidParameterValueException exception) {
             final String message = exception.getMessage();
@@ -252,18 +250,18 @@ public final strictfp class DefaultParam
      */
     @Test
     public void testMeasure() {
-        final Watcher<Double> parameter = create("Numerical param", 3, SI.METRE);
+        final Watcher<Double> parameter = create("Numerical param", 3, Units.METRE);
         final ParameterDescriptor<Double> descriptor = parameter.getDescriptor();
         validate(parameter);
 
         assertEquals("name",        "Numerical param", descriptor.getName().getCode());
-        assertEquals("defaultUnit", SI.METRE,          descriptor.getUnit());
-        assertEquals("unit",        SI.METRE,          parameter .getUnit());
+        assertEquals("defaultUnit", Units.METRE,          descriptor.getUnit());
+        assertEquals("unit",        Units.METRE,          parameter .getUnit());
         assertNull  ("defaultValue",                   descriptor.getDefaultValue());
         assertEquals("value",       Double.valueOf(3), parameter .getValue());
         assertEquals("intValue",      3,               parameter .intValue());
         assertEquals("doubleValue",   3,               parameter .doubleValue(), STRICT);
-        assertEquals("doubleValue", 300,               parameter .doubleValue(SI.CENTIMETRE), STRICT);
+        assertEquals("doubleValue", 300,               parameter .doubleValue(Units.CENTIMETRE), STRICT);
         assertNull  ("minimum",                        descriptor.getMinimumValue());
         assertNull  ("maximum",                        descriptor.getMaximumValue());
         assertNull  ("validValues",                    descriptor.getValidValues());
@@ -283,12 +281,12 @@ public final strictfp class DefaultParam
         /*
          * Sets a value in centimetres.
          */
-        parameter.setValue(400, SI.CENTIMETRE);
+        parameter.setValue(400, Units.CENTIMETRE);
         parameter.assertValueEquals(Double.valueOf(400), Double.valueOf(4));
-        assertEquals("unit",        SI.CENTIMETRE, parameter.getUnit());
-        assertEquals("doubleValue", 400, parameter.doubleValue(),              STRICT);
-        assertEquals("doubleValue", 400, parameter.doubleValue(SI.CENTIMETRE), STRICT);
-        assertEquals("doubleValue",   4, parameter.doubleValue(SI.METRE),      STRICT);
+        assertEquals("unit",        Units.CENTIMETRE, parameter.getUnit());
+        assertEquals("doubleValue", 400, parameter.doubleValue(),                 STRICT);
+        assertEquals("doubleValue", 400, parameter.doubleValue(Units.CENTIMETRE), STRICT);
+        assertEquals("doubleValue",   4, parameter.doubleValue(Units.METRE),      STRICT);
         validate(parameter);
     }
 
@@ -344,18 +342,18 @@ public final strictfp class DefaultParam
     @DependsOnMethod({"testMeasure", "testBoundedDouble"})
     public void testBoundedMeasure() {
         final Watcher<Double> parameter = new Watcher<>(
-                DefaultParameterDescriptorTest.create("Length measure", 4, 20, 12, SI.METRE));
+                DefaultParameterDescriptorTest.create("Length measure", 4, 20, 12, Units.METRE));
         assertEquals("value",    Double.valueOf(12), parameter.getValue());
         assertEquals("intValue", 12,                 parameter.intValue());
-        assertEquals("unit",     SI.METRE,           parameter.getUnit());
+        assertEquals("unit",     Units.METRE,        parameter.getUnit());
         validate(parameter);
 
         for (int i=4; i<=20; i++) {
             parameter.setValue(i);
             parameter.assertValueEquals(Double.valueOf(i));
-            assertEquals("unit",  SI.METRE,          parameter.getUnit());
-            assertEquals("value", i,                 parameter.doubleValue(SI.METRE), STRICT);
-            assertEquals("value", 100*i,             parameter.doubleValue(SI.CENTIMETRE), STRICT);
+            assertEquals("unit",  Units.METRE,  parameter.getUnit());
+            assertEquals("value", i,            parameter.doubleValue(Units.METRE), STRICT);
+            assertEquals("value", 100*i,        parameter.doubleValue(Units.CENTIMETRE), STRICT);
         }
         try {
             parameter.setValue(3.0);
@@ -364,7 +362,7 @@ public final strictfp class DefaultParam
             assertEquals("Length measure", exception.getParameterName());
         }
         try {
-            parameter.setValue(10.0, SI.KILOMETRE); // Out of range only after unit conversion.
+            parameter.setValue(10.0, Units.KILOMETRE);          // Out of range only after unit conversion.
             fail("setValue(> max)");
         } catch (InvalidParameterValueException exception) {
             assertEquals("Length measure", exception.getParameterName());
@@ -377,10 +375,10 @@ public final strictfp class DefaultParam
         }
         for (int i=400; i<=2000; i+=100) {
             final double metres = i / 100.0;
-            parameter.setValue(i, SI.CENTIMETRE);
+            parameter.setValue(i, Units.CENTIMETRE);
             parameter.assertValueEquals(Double.valueOf(i), Double.valueOf(metres));
-            assertEquals("unit",  SI.CENTIMETRE, parameter.getUnit());
-            assertEquals("value", metres,        parameter.doubleValue(SI.METRE), EPS);
+            assertEquals("unit",  Units.CENTIMETRE, parameter.getUnit());
+            assertEquals("value", metres,           parameter.doubleValue(Units.METRE), EPS);
         }
     }
 
@@ -391,32 +389,32 @@ public final strictfp class DefaultParam
     public void testArray() {
         double[] values = {5, 10, 15};
         final Watcher<double[]> parameter = new Watcher<>(
-                DefaultParameterDescriptorTest.createForArray("myValues", 4, 4000, SI.METRE));
+                DefaultParameterDescriptorTest.createForArray("myValues", 4, 4000, Units.METRE));
         parameter.setValue(values);
         assertArrayEquals(values, parameter.getValue(), 0);
         assertArrayEquals(values, parameter.convertedValue, 0);
         assertArrayEquals(values, parameter.doubleValueList(), 0);
-        assertArrayEquals(new double[] {500, 1000, 1500}, parameter.doubleValueList(SI.CENTIMETRE), 0);
+        assertArrayEquals(new double[] {500, 1000, 1500}, parameter.doubleValueList(Units.CENTIMETRE), 0);
         /*
          * New values in kilometres.
          */
         values = new double[] {3, 2, 4};
         final double[] metres = new double[] {3000, 2000, 4000};
-        parameter.setValue(values, SI.KILOMETRE);
+        parameter.setValue(values, Units.KILOMETRE);
         assertArrayEquals(values, parameter.getValue(), 0);
         assertArrayEquals(metres, parameter.convertedValue, 0);
         assertArrayEquals(values, parameter.doubleValueList(), 0);
-        assertArrayEquals(metres, parameter.doubleValueList(SI.METRE), 0);
+        assertArrayEquals(metres, parameter.doubleValueList(Units.METRE), 0);
         /*
          * Values out of range.
          */
         try {
-            parameter.setValue(new double[] {5, 10, -5}, SI.METRE);
+            parameter.setValue(new double[] {5, 10, -5}, Units.METRE);
         } catch (InvalidParameterValueException e) {
             assertTrue(e.getMessage().contains("myValues[2]"));
         }
         try {
-            parameter.setValue(new double[] {4, 5}, SI.KILOMETRE); // Out of range only after unit conversion.
+            parameter.setValue(new double[] {4, 5}, Units.KILOMETRE);   // Out of range only after unit conversion.
         } catch (InvalidParameterValueException e) {
             assertTrue(e.getMessage().contains("myValues[1]"));
         }
@@ -533,7 +531,7 @@ public final strictfp class DefaultParam
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
 
-            p = create("Dimensionless double value", i, Unit.ONE);
+            p = create("Dimensionless double value", i, Units.UNITY);
             d = p.getDescriptor();
             validate(p);
 
@@ -544,11 +542,11 @@ public final strictfp class DefaultParam
             assertNull   ("Expected no enumeration.",     d.getValidValues());
             assertEquals ("Expected double type.",        Double.class, d.getValueClass());
             assertTrue   ("Expected double type.",        p.getValue() instanceof Double);
-            assertEquals ("Expected dimensionless.",      Unit.ONE, p.getUnit());
+            assertEquals ("Expected dimensionless.",      Units.UNITY, p.getUnit());
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
 
-            p = create("Angular double value", i, NonSI.DEGREE_ANGLE);
+            p = create("Angular double value", i, Units.DEGREE);
             d = p.getDescriptor();
             validate(p);
 
@@ -559,10 +557,10 @@ public final strictfp class DefaultParam
             assertNull   ("Expected no enumeration.",     d.getValidValues());
             assertEquals ("Expected double type.",        Double.class, d.getValueClass());
             assertTrue   ("Expected double type.",        p.getValue() instanceof Double);
-            assertEquals ("Expected angular unit.",       NonSI.DEGREE_ANGLE, p.getUnit());
+            assertEquals ("Expected angular unit.",       Units.DEGREE, p.getUnit());
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
-            assertEquals ("Expected unit conversion.", toRadians(i), p.doubleValue(SI.RADIAN), EPS);
+            assertEquals ("Expected unit conversion.",    toRadians(i), p.doubleValue(Units.RADIAN), EPS);
         }
     }
 
@@ -571,7 +569,7 @@ public final strictfp class DefaultParam
      */
     @Test
     public void testClone() {
-        final DefaultParameterValue<Double> parameter = create("Clone test", 3, SI.METRE);
+        final DefaultParameterValue<Double> parameter = create("Clone test", 3, Units.METRE);
         assertEquals("equals(clone)", parameter, parameter.clone());
     }
 
@@ -580,7 +578,7 @@ public final strictfp class DefaultParam
      */
     @Test
     public void testSerialization() {
-        final DefaultParameterValue<Double> parameter = create("Serialization test", 3, SI.METRE);
+        final DefaultParameterValue<Double> parameter = create("Serialization test", 3, Units.METRE);
         assertNotSame(parameter, assertSerializedEquals(parameter));
     }
 
@@ -590,11 +588,11 @@ public final strictfp class DefaultParam
     @Test
     public void testWKT() {
         final DefaultParameterValue<Integer> count  = createOptional("Count", 4);
-        final DefaultParameterValue<Double>  length = create("Length", 30, SI.CENTIMETRE);
+        final DefaultParameterValue<Double>  length = create("Length", 30, Units.CENTIMETRE);
         assertWktEquals(Convention.WKT1, "PARAMETER[“Count”, 4]", count);
         assertWktEquals(Convention.WKT1, "PARAMETER[“Length”, 30.0]", length);
         assertWktEquals(Convention.WKT2, "PARAMETER[“Count”, 4]", count);
-        assertWktEquals(Convention.WKT2, "PARAMETER[“Length”, 30.0, LENGTHUNIT[“cm”, 0.01]]", length);
+        assertWktEquals(Convention.WKT2, "PARAMETER[“Length”, 30.0, LENGTHUNIT[“centimetre”, 0.01]]", length);
     }
 
     /**
@@ -613,7 +611,7 @@ public final strictfp class DefaultParam
         assertWktEquals(Convention.WKT2,     "PARAMETER[“Angle”, 10.5, ANGLEUNIT[“degree”, 0.017453292519943295]]", p);
         assertWktEquals(Convention.INTERNAL, "Parameter[“Angle”, 10.3]", p);   // Value in same unit than descriptor.
 
-        p = create("Angle", 0, NonSI.DEGREE_ANGLE);
+        p = create("Angle", 0, Units.DEGREE);
         p.setValue(10.3, degreesAndMinutes);  // Can not be formatted in WKT1.
         assertWktEquals(Convention.WKT2,     "PARAMETER[“Angle”, 10.5, ANGLEUNIT[“degree”, 0.017453292519943295]]", p);
         assertWktEquals(Convention.INTERNAL, "Parameter[“Angle”, 10.3, Unit[“D.M”, 0.017453292519943295, Id[“EPSG”, 9111]]]", p);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,12 +16,10 @@
  */
 package org.apache.sis.parameter;
 
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import org.opengis.util.GenericName;
 import org.opengis.parameter.ParameterDescriptor;
 import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -35,7 +33,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -50,26 +48,26 @@ public final strictfp class ParameterBui
     @Test
     public void testCreate() {
         final ParameterBuilder builder = new ParameterBuilder();
-        ParameterDescriptor<Double> p = builder.addName("Test 1").create(0, SI.METRE);
+        ParameterDescriptor<Double> p = builder.addName("Test 1").create(0, Units.METRE);
         assertEquals("name", "Test 1",    p.getName().getCode());
         assertEquals("defaultValue", 0.0, p.getDefaultValue(), 0);
         assertNull  ("minimumValue",      p.getMinimumValue());
         assertNull  ("maximumValue",      p.getMaximumValue());
-        assertEquals("unit", SI.METRE,    p.getUnit());
+        assertEquals("unit", Units.METRE,    p.getUnit());
 
-        p = builder.addName("Test 2").create(Double.NaN, SI.METRE);
+        p = builder.addName("Test 2").create(Double.NaN, Units.METRE);
         assertEquals("name", "Test 2",    p.getName().getCode());
         assertNull  ("defaultValue",      p.getDefaultValue());
         assertNull  ("minimumValue",      p.getMinimumValue());
         assertNull  ("maximumValue",      p.getMaximumValue());
-        assertEquals("unit", SI.METRE,    p.getUnit());
+        assertEquals("unit", Units.METRE,    p.getUnit());
 
-        p = builder.addName("Test 3").createBounded(1, 4, 3, SI.METRE);
+        p = builder.addName("Test 3").createBounded(1, 4, 3, Units.METRE);
         assertEquals("name", "Test 3",    p.getName().getCode());
         assertEquals("defaultValue", 3.0, p.getDefaultValue(), 0);
         assertEquals("minimumValue", 1.0, p.getMinimumValue());
         assertEquals("maximumValue", 4.0, p.getMaximumValue());
-        assertEquals("unit", SI.METRE,    p.getUnit());
+        assertEquals("unit", Units.METRE,    p.getUnit());
     }
 
     /**
@@ -85,18 +83,18 @@ public final strictfp class ParameterBui
             builder.addName("Longitude of natural origin")
                    .addName(Citations.OGC, "central_meridian")
                    .addName(Citations.GEOTIFF, "NatOriginLong")
-                   .setRemarks("Some remarks.")               .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE),
-            builder.addName("Latitude of natural origin")     .createBounded( -80,  +84, 0, NonSI.DEGREE_ANGLE),
-            builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Unit.ONE),
-            builder.addName("False easting")                  .create(0, SI.METRE),
-            builder.addName("False northing")                 .create(0, SI.METRE)
+                   .setRemarks("Some remarks.")               .createBounded(-180, +180, 0, Units.DEGREE),
+            builder.addName("Latitude of natural origin")     .createBounded( -80,  +84, 0, Units.DEGREE),
+            builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Units.UNITY),
+            builder.addName("False easting")                  .create(0, Units.METRE),
+            builder.addName("False northing")                 .create(0, Units.METRE)
         };
         // Tests random properties.
         assertEquals("EPSG",             parameters[1].getName().getCodeSpace());
         assertEquals("False easting",    parameters[3].getName().getCode());
         assertEquals("Some remarks.",    parameters[0].getRemarks().toString());
         assertEquals(Double.valueOf(84), parameters[1].getMaximumValue());
-        assertEquals(SI.METRE,           parameters[4].getUnit());
+        assertEquals(Units.METRE,           parameters[4].getUnit());
         assertTrue  (                    parameters[1].getAlias().isEmpty());
 
         final GenericName alias = parameters[0].getAlias().iterator().next();

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,15 +18,13 @@ package org.apache.sis.parameter;
 
 import java.util.List;
 import java.util.Locale;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.unit.Unit;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterValue;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -79,11 +77,11 @@ public final strictfp class ParameterFor
         ParameterDescriptor<?>[] parameters = {
             builder.addIdentifier("8801").addName("Latitude of natural origin").addName(OGC, "latitude_of_origin")
                     .setRemarks("This parameter is shown for completeness, but should never have a value different than 0 for this projection.")
-                    .createBounded( -80,  +84,  40, NonSI.DEGREE_ANGLE),
-            builder.addIdentifier("8802").addName("Longitude of natural origin")     .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE),
-            builder.addIdentifier("8805").addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Unit.ONE),
-            builder.addIdentifier("8806").addName("False easting").setRequired(false).addName(OGC, "false_easting")     .create( 5000, SI.METRE),
-            builder.addIdentifier("8807").addName("False northing")                  .addName(OGC, "false_northing")    .create(10000, SI.METRE)
+                    .createBounded( -80,  +84,  40, Units.DEGREE),
+            builder.addIdentifier("8802").addName("Longitude of natural origin")     .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, Units.DEGREE),
+            builder.addIdentifier("8805").addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Units.UNITY),
+            builder.addIdentifier("8806").addName("False easting").setRequired(false).addName(OGC, "false_easting")     .create( 5000, Units.METRE),
+            builder.addIdentifier("8807").addName("False northing")                  .addName(OGC, "false_northing")    .create(10000, Units.METRE)
         };
         builder.addIdentifier("9804")
                .addName("Mercator (variant A)")
@@ -110,7 +108,7 @@ public final strictfp class ParameterFor
         final ParameterValueGroup group = descriptor.createValue();
         group.parameter("latitude_of_origin").setValue(20);
         group.parameter("scale_factor").setValue(0.997);
-        group.parameter("false_northing").setValue(20, SI.KILOMETRE);
+        group.parameter("false_northing").setValue(20, Units.KILOMETRE);
         return group;
     }
 

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -21,15 +21,14 @@ import java.util.Iterator;
 import java.net.URI;
 import java.net.URISyntaxException;
 import javax.xml.bind.JAXBException;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
 import org.opengis.test.Validators;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterValue;
 import org.opengis.parameter.GeneralParameterDescriptor;
+import org.apache.sis.measure.Units;
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.MeasurementRange;
 import org.apache.sis.test.DependsOn;
@@ -50,7 +49,7 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -246,8 +245,8 @@ public final strictfp class ParameterMar
     @DependsOnMethod("testStringValue")
     public void testDoubleValue() throws JAXBException {
         final DefaultParameterValue<Double> parameter = create(Double.class,
-                new MeasurementRange<Double>(Double.class, null, false, null, false, SI.METRE));
-        parameter.setValue(3000, SI.METRE);
+                new MeasurementRange<>(Double.class, null, false, null, false, Units.METRE));
+        parameter.setValue(3000, Units.METRE);
         testMarshallAndUnmarshall(parameter,
                 "<gml:ParameterValue xmlns:gml=\"" + Namespaces.GML + "\">\n"
               + "  <gml:value uom=\"urn:ogc:def:uom:EPSG::9001\">3000.0</gml:value>\n"
@@ -268,8 +267,8 @@ public final strictfp class ParameterMar
     @DependsOnMethod("testStringValue")
     public void testValueList() throws JAXBException {
         final DefaultParameterValue<double[]> parameter = create(double[].class,
-                new MeasurementRange<Double>(Double.class, null, false, null, false, SI.METRE));
-        parameter.setValue(new double[] {203, 207, 204}, SI.METRE);
+                new MeasurementRange<>(Double.class, null, false, null, false, Units.METRE));
+        parameter.setValue(new double[] {203, 207, 204}, Units.METRE);
         testMarshallAndUnmarshall(parameter,
                 "<gml:ParameterValue xmlns:gml=\"" + Namespaces.GML + "\">\n"
               + "  <gml:valueList uom=\"urn:ogc:def:uom:EPSG::9001\">203.0 207.0 204.0</gml:valueList>\n"
@@ -406,9 +405,9 @@ public final strictfp class ParameterMar
         verifyDescriptorGroup(group.getDescriptor());
         final Iterator<GeneralParameterValue> it = group.values().iterator();
         final Iterator<GeneralParameterDescriptor> itd = group.getDescriptor().descriptors().iterator();
-        verifyParameter(8801, "Latitude of natural origin",     "latitude_of_origin", 40, NonSI.DEGREE_ANGLE, itd.next(), it.next());
-        verifyParameter(8802, "Longitude of natural origin",    "central_meridian",  -60, NonSI.DEGREE_ANGLE, itd.next(), it.next());
-        verifyParameter(8805, "Scale factor at natural origin", "scale_factor",        1, Unit.ONE,           itd.next(), it.next());
+        verifyParameter(8801, "Latitude of natural origin",     "latitude_of_origin", 40, Units.DEGREE, itd.next(), it.next());
+        verifyParameter(8802, "Longitude of natural origin",    "central_meridian",  -60, Units.DEGREE, itd.next(), it.next());
+        verifyParameter(8805, "Scale factor at natural origin", "scale_factor",        1, Units.UNITY,    itd.next(), it.next());
         assertFalse("Unexpected parameter.", it.hasNext());
     }
 }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,8 +19,7 @@ package org.apache.sis.parameter;
 import java.util.Set;
 import java.util.Collection;
 import java.util.Collections;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.referencing.ReferenceIdentifier;
@@ -30,6 +29,7 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.NumberRange;
 import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.TestUtilities;
@@ -43,7 +43,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -95,8 +95,8 @@ public final strictfp class ParametersTe
                 DefaultParameterDescriptorTest.createSimpleOptional("No range", String.class));
         verifyValueDomain(NumberRange.create(1, true, 4, true),
                 DefaultParameterDescriptorTest.create("Integers", 1, 4, 2));
-        verifyValueDomain(MeasurementRange.create(1d, true, 4d, true, SI.METRE),
-                DefaultParameterDescriptorTest.create("Doubles", 1d, 4d, 2d, SI.METRE));
+        verifyValueDomain(MeasurementRange.create(1d, true, 4d, true, Units.METRE),
+                DefaultParameterDescriptorTest.create("Doubles", 1d, 4d, 2d, Units.METRE));
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.referencing;
 
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.extent.GeographicExtent;
@@ -34,6 +32,7 @@ import org.opengis.referencing.cs.Ellips
 import org.opengis.referencing.cs.RangeMeaning;
 import org.opengis.referencing.crs.GeodeticCRS;
 import org.apache.sis.internal.metadata.AxisNames;
+import org.apache.sis.measure.Units;
 
 import static org.apache.sis.test.Assert.*;
 
@@ -44,7 +43,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.8
  * @module
  *
  * @todo Move this class to GeoAPI.
@@ -124,7 +123,7 @@ public final strictfp class GeodeticObje
      * <tr><td>{@linkplain PrimeMeridian#getGreenwichLongitude() Greenwich longitude}</td>
      *     <td>0</td></tr>
      * <tr><td>{@linkplain PrimeMeridian#getAngularUnit() Angular unit}</td>
-     *     <td>{@link NonSI#DEGREE_ANGLE}</td></tr>
+     *     <td>{@link Units#DEGREE}</td></tr>
      * </table>
      *
      * @param meridian The prime meridian to verify.
@@ -132,7 +131,7 @@ public final strictfp class GeodeticObje
     public static void assertIsGreenwich(final PrimeMeridian meridian) {
         assertEquals("name",               "Greenwich",        meridian.getName().getCode());
         assertEquals("greenwichLongitude", 0,                  meridian.getGreenwichLongitude(), STRICT);
-        assertEquals("angularUnit",        NonSI.DEGREE_ANGLE, meridian.getAngularUnit());
+        assertEquals("angularUnit",        Units.DEGREE, meridian.getAngularUnit());
     }
 
     /**
@@ -147,15 +146,15 @@ public final strictfp class GeodeticObje
      * <tr><td>{@linkplain PrimeMeridian#getGreenwichLongitude() Greenwich longitude}</td>
      *     <td>2.5969213</td></tr>
      * <tr><td>{@linkplain PrimeMeridian#getAngularUnit() Angular unit}</td>
-     *     <td>{@link NonSI#GRADE}</td></tr>
+     *     <td>{@link Units#GRAD}</td></tr>
      * </table>
      *
      * @param meridian The prime meridian to verify.
      */
     public static void assertIsParis(final PrimeMeridian meridian) {
-        assertEquals("name",               "Paris",     meridian.getName().getCode());
-        assertEquals("greenwichLongitude", 2.5969213,   meridian.getGreenwichLongitude(), STRICT);
-        assertEquals("angularUnit",        NonSI.GRADE, meridian.getAngularUnit());
+        assertEquals("name",               "Paris",    meridian.getName().getCode());
+        assertEquals("greenwichLongitude", 2.5969213,  meridian.getGreenwichLongitude(), STRICT);
+        assertEquals("angularUnit",        Units.GRAD, meridian.getAngularUnit());
     }
 
     /**
@@ -168,7 +167,7 @@ public final strictfp class GeodeticObje
      * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain Ellipsoid#getName() name}</td>
      *     <td>{@code "WGS 84"}</td></tr>
      * <tr><td>{@linkplain Ellipsoid#getAxisUnit() Axis unit}</td>
-     *     <td>{@link SI#METRE}</td></tr>
+     *     <td>{@link Units#METRE}</td></tr>
      * <tr><td>{@linkplain Ellipsoid#getSemiMajorAxis() Semi-major axis}</td>
      *     <td>6378137</td></tr>
      * <tr><td>{@linkplain Ellipsoid#getSemiMinorAxis() Semi-minor axis}</td>
@@ -183,7 +182,7 @@ public final strictfp class GeodeticObje
      */
     public static void assertIsWGS84(final Ellipsoid ellipsoid) {
         assertEquals("name",              "WGS 84",          ellipsoid.getName().getCode());
-        assertEquals("axisUnit",          SI.METRE,          ellipsoid.getAxisUnit());
+        assertEquals("axisUnit",          Units.METRE,          ellipsoid.getAxisUnit());
         assertEquals("semiMajorAxis",     6378137,           ellipsoid.getSemiMajorAxis(),     STRICT);
         assertEquals("semiMinorAxis",     6356752.314245179, ellipsoid.getSemiMinorAxis(),     0.001);
         assertEquals("inverseFlattening", 298.257223563,     ellipsoid.getInverseFlattening(), STRICT);
@@ -291,8 +290,8 @@ public final strictfp class GeodeticObje
      *     <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>
+     *     <td>{@link Units#METRE}</td>
+     *     <td>{@link Units#METRE}</td></tr>
      * <tr><td>Axes range</td>
      *     <td>[-∞ … ∞]</td>
      *     <td>[-∞ … ∞]</td></tr>
@@ -315,8 +314,8 @@ public final strictfp class GeodeticObje
         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());
+        assertEquals("axis[0].unit",         Units.METRE,            E.getUnit());
+        assertEquals("axis[1].unit",         Units.METRE,            N.getUnit());
         verifyRange(E, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null, true);
         verifyRange(N, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null, true);
     }
@@ -337,8 +336,8 @@ public final strictfp class GeodeticObje
      *     <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>
+     *     <td>{@link Units#DEGREE}</td>
+     *     <td>{@link Units#DEGREE}</td></tr>
      * <tr><td>Axes range</td>
      *     <td>[-90 … 90] (see below)</td>
      *     <td>[-180 … 180] (see below)</td></tr>
@@ -368,8 +367,8 @@ public final strictfp class GeodeticObje
         assertEquals("axis[1].name",       AxisNames.GEODETIC_LONGITUDE, longitude.getName().getCode());
         assertEquals("axis[0].direction",  AxisDirection.NORTH,          latitude .getDirection());
         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());
+        assertEquals("axis[0].unit",       Units.DEGREE,           latitude .getUnit());
+        assertEquals("axis[1].unit",       Units.DEGREE,           longitude.getUnit());
         verifyRange(latitude,   -90,  +90, RangeMeaning.EXACT,           isRangeMandatory);
         verifyRange(longitude, -180, +180, RangeMeaning.WRAPAROUND,      isRangeMandatory);
     }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,8 +18,6 @@ package org.apache.sis.referencing.crs;
 
 import java.util.Collections;
 import javax.xml.bind.JAXBException;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
@@ -33,6 +31,7 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.referencing.operation.DefaultConversionTest;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
 import org.apache.sis.referencing.cs.HardCodedCS;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.XMLTestCase;
@@ -46,7 +45,7 @@ import static org.apache.sis.test.Refere
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -181,7 +180,7 @@ public final strictfp class DefaultDeriv
                 "  BASEGEODCRS[“NTF (Paris)”,\n" +
                 "    DATUM[“Nouvelle Triangulation Francaise”,\n" +
                 "      ELLIPSOID[“NTF”, 6378249.2, 293.4660212936269, LENGTHUNIT[“metre”, 1]]],\n" +
-                "      PRIMEM[“Paris”, 2.5969213, ANGLEUNIT[“grade”, 0.015707963267948967]]],\n" +
+                "      PRIMEM[“Paris”, 2.5969213, ANGLEUNIT[“grad”, 0.015707963267948967]]],\n" +
                 "  DERIVINGCONVERSION[“Paris to Greenwich”,\n" +
                 "    METHOD[“Longitude rotation”, ID[“EPSG”, 9601]],\n" +
                 "    PARAMETER[“Longitude offset”, 2.33722917, ID[“EPSG”, 8602]]],\n" +
@@ -203,7 +202,7 @@ public final strictfp class DefaultDeriv
                 "  BaseGeodCRS[“NTF (Paris)”,\n" +
                 "    Datum[“Nouvelle Triangulation Francaise”,\n" +
                 "      Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" +
-                "      PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967]],\n" +
+                "      PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967]],\n" +
                 "    Unit[“degree”, 0.017453292519943295]],\n" +
                 "  DerivingConversion[“Paris to Greenwich”,\n" +
                 "    Method[“Longitude rotation”],\n" +
@@ -233,9 +232,9 @@ public final strictfp class DefaultDeriv
         final Conversion conversion = crs.getConversionFromBase();
         final ParameterValueGroup pg = conversion.getParameterValues();
         assertEpsgNameAndIdentifierEqual("Geographic/topocentric conversions", 9837, conversion.getMethod());
-        assertEquals("Latitude", 55, pg.parameter("Latitude of topocentric origin" ).doubleValue(NonSI.DEGREE_ANGLE), STRICT);
-        assertEquals("Longitude", 5, pg.parameter("Longitude of topocentric origin").doubleValue(NonSI.DEGREE_ANGLE), STRICT);
-        assertEquals("Height",    0, pg.parameter("Ellipsoidal height of topocentric origin").doubleValue(SI.METRE),  STRICT);
+        assertEquals("Latitude", 55, pg.parameter("Latitude of topocentric origin" ).doubleValue(Units.DEGREE), STRICT);
+        assertEquals("Longitude", 5, pg.parameter("Longitude of topocentric origin").doubleValue(Units.DEGREE), STRICT);
+        assertEquals("Height",    0, pg.parameter("Ellipsoidal height of topocentric origin").doubleValue(Units.METRE),  STRICT);
         /*
          * Test marshalling and compare with the original file.
          */

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.referencing.crs;
 
-import javax.measure.unit.SI;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -24,6 +23,7 @@ import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.internal.referencing.Legacy;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
@@ -38,7 +38,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -117,13 +117,13 @@ public final strictfp class DefaultGeoce
     public void testWKT1_kilometres() {
         DefaultGeocentricCRS crs = HardCodedCRS.GEOCENTRIC;
         crs = new DefaultGeocentricCRS(IdentifiedObjects.getProperties(crs), crs.getDatum(),
-                Legacy.replaceUnit((CartesianCS) crs.getCoordinateSystem(), SI.KILOMETRE));
+                Legacy.replaceUnit((CartesianCS) crs.getCoordinateSystem(), Units.KILOMETRE));
         assertWktEquals(Convention.WKT1,
                 "GEOCCS[“Geocentric”,\n" +
                 "  DATUM[“World Geodetic System 1984”,\n" +
                 "    SPHEROID[“WGS84”, 6378137.0, 298.257223563]],\n" +
                 "    PRIMEM[“Greenwich”, 0.0],\n" +
-                "  UNIT[“km”, 1000],\n" +
+                "  UNIT[“kilometre”, 1000],\n" +
                 "  AXIS[“X”, OTHER],\n" +
                 "  AXIS[“Y”, EAST],\n" +
                 "  AXIS[“Z”, NORTH]]",

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -238,7 +238,7 @@ public final strictfp class DefaultGeogr
      * Tests WKT 2 formatting of a CRS using a prime meridian other than Greenwich.
      *
      * <p>This CRS used in this test is equivalent to {@code EPSG:4807} except for axis order,
-     * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grades.</p>
+     * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grads.</p>
      */
     @Test
     @DependsOnMethod("testWKT2")
@@ -247,11 +247,11 @@ public final strictfp class DefaultGeogr
                 "GeodeticCRS[“NTF (Paris)”,\n" +
                 "  Datum[“Nouvelle Triangulation Francaise”,\n" +           // Formatter should replace "ç" by "c".
                 "    Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" +
-                "    PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967]],\n" +
+                "    PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967]],\n" +
                 "  CS[ellipsoidal, 2],\n" +
                 "    Axis[“Longitude (L)”, east],\n" +                      // See method javadoc.
                 "    Axis[“Latitude (B)”, north],\n" +
-                "    Unit[“grade”, 0.015707963267948967]]",
+                "    Unit[“grad”, 0.015707963267948967]]",
                 HardCodedCRS.NTF);
     }
 
@@ -259,7 +259,7 @@ public final strictfp class DefaultGeogr
      * Tests WKT 1 formatting on a CRS using a prime meridian other than Greenwich.
      *
      * <p>This CRS used in this test is equivalent to {@code EPSG:4807} except for axis order,
-     * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grades.</p>
+     * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grads.</p>
      */
     @Test
     @DependsOnMethod("testWKT2")
@@ -269,7 +269,7 @@ public final strictfp class DefaultGeogr
                 "  DATUM[“Nouvelle Triangulation Francaise”,\n" +   // Formatter should replace "ç" by "c".
                 "    SPHEROID[“NTF”, 6378249.2, 293.4660212936269]],\n" +
                 "    PRIMEM[“Paris”, 2.5969213],\n" +
-                "  UNIT[“grade”, 0.015707963267948967],\n" +
+                "  UNIT[“grad”, 0.015707963267948967],\n" +
                 "  AXIS[“Longitude”, EAST],\n" +
                 "  AXIS[“Latitude”, NORTH]]",
                 HardCodedCRS.NTF);
@@ -288,7 +288,7 @@ public final strictfp class DefaultGeogr
                 "  DATUM[“Nouvelle Triangulation Francaise”,\n" +   // Formatter should replace "ç" by "c".
                 "    SPHEROID[“NTF”, 6378249.2, 293.4660212936269]],\n" +
                 "    PRIMEM[“Paris”, 2.33722917],\n" +              // Would be 2.5969213 in standard-compliant WKT.
-                "  UNIT[“grade”, 0.015707963267948967],\n" +
+                "  UNIT[“grad”, 0.015707963267948967],\n" +
                 "  AXIS[“Longitude”, EAST],\n" +
                 "  AXIS[“Latitude”, NORTH]]",
                 HardCodedCRS.NTF);



Mime
View raw message