sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1767577 [15/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/...
Date Tue, 01 Nov 2016 21:03:08 GMT
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,34 +16,20 @@
  */
 package org.apache.sis.measure;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
+import javax.measure.quantity.Angle;
+import javax.measure.quantity.Area;
+import javax.measure.quantity.Dimensionless;
+import javax.measure.quantity.Length;
+import javax.measure.quantity.Mass;
+import javax.measure.quantity.Speed;
+import javax.measure.quantity.Temperature;
+import javax.measure.quantity.Time;
+import javax.measure.quantity.Volume;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static javax.measure.unit.Unit.ONE;
-import static javax.measure.unit.SI.CELSIUS;
-import static javax.measure.unit.SI.KELVIN;
-import static javax.measure.unit.SI.METRE;
-import static javax.measure.unit.SI.METRES_PER_SECOND;
-import static javax.measure.unit.SI.SQUARE_METRE;
-import static javax.measure.unit.SI.KILOMETRE;
-import static javax.measure.unit.SI.KILOGRAM;
-import static javax.measure.unit.SI.JOULE;
-import static javax.measure.unit.SI.PASCAL;
-import static javax.measure.unit.SI.SECOND;
-import static javax.measure.unit.SI.HERTZ;
-import static javax.measure.unit.SI.RADIAN;
-import static javax.measure.unit.NonSI.CENTIRADIAN;
-import static javax.measure.unit.NonSI.DEGREE_ANGLE;
-import static javax.measure.unit.NonSI.MINUTE_ANGLE;
-import static javax.measure.unit.NonSI.SECOND_ANGLE;
-import static javax.measure.unit.NonSI.GRADE;
-import static javax.measure.unit.NonSI.DAY;
-import static javax.measure.unit.NonSI.SPHERE;
-import static javax.measure.unit.NonSI.ATMOSPHERE;
-import static javax.measure.unit.NonSI.NAUTICAL_MILE;
-import static javax.measure.unit.NonSI.PERCENT;
 import static org.apache.sis.measure.SexagesimalConverter.*;
 import static org.apache.sis.measure.Units.*;
 import static org.apache.sis.test.Assert.*;
@@ -54,36 +40,33 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 @DependsOn({
+    UnitFormatTest.class,
     SexagesimalConverterTest.class,
     org.apache.sis.internal.util.DefinitionURITest.class,
     org.apache.sis.internal.util.XPathsTest.class
 })
 public final strictfp class UnitsTest extends TestCase {
     /**
-     * Sanity check of {@link UnitsMap}. This test fail if at least one code in the
-     * {@link UnitsMap#EPSG_CODES} static initializer is invalid.
+     * Verifies that the {@link Units#initialized} flag has been set.
      */
     @Test
-    public void testUnitsMap() {
-        assertFalse(UnitsMap.EPSG_CODES.containsKey(null));
+    public void testInitialized() {
+        assertTrue(Units.initialized);
     }
 
     /**
      * Tests serialization of units.
-     *
-     * @todo The {@code assertEquals} in this method should actually be {@code assertSame},
-     *       but JSR-275 0.9.3 does not resolve units on deserialization.
      */
     @Test
     public void testSerialization() {
-        assertEquals(DEGREE_ANGLE,         assertSerializedEquals(DEGREE_ANGLE));
-        assertEquals(DMS,      assertSerializedEquals(DMS));
+        assertSame  (DEGREE,     assertSerializedEquals(DEGREE));
+        assertEquals(DMS,        assertSerializedEquals(DMS));
         assertEquals(DMS_SCALED, assertSerializedEquals(DMS_SCALED));
-        assertEquals(PPM,                  assertSerializedEquals(PPM));
+        assertSame  (PPM,        assertSerializedEquals(PPM));
     }
 
     /**
@@ -93,17 +76,14 @@ public final strictfp class UnitsTest ex
     public void testIsTemporal() {
         // Standard units
         assertFalse(isTemporal(null));
-        assertFalse(isTemporal(ONE));
+        assertFalse(isTemporal(UNITY));
         assertFalse(isTemporal(METRE));
         assertFalse(isTemporal(RADIAN));
-        assertFalse(isTemporal(CENTIRADIAN));
-        assertFalse(isTemporal(DEGREE_ANGLE));
-        assertFalse(isTemporal(MINUTE_ANGLE));
-        assertFalse(isTemporal(SECOND_ANGLE));
-        assertFalse(isTemporal(GRADE));
+        assertFalse(isTemporal(DEGREE));
+        assertFalse(isTemporal(ARC_MINUTE));
+        assertFalse(isTemporal(ARC_SECOND));
+        assertFalse(isTemporal(GRAD));
         assertTrue (isTemporal(DAY));
-        assertFalse(isTemporal(SPHERE));
-        assertFalse(isTemporal(ATMOSPHERE));
         assertFalse(isTemporal(NAUTICAL_MILE));
 
         // Additional units
@@ -120,17 +100,14 @@ public final strictfp class UnitsTest ex
     public void testIsLinear() {
         // Standard units
         assertFalse(isLinear(null));
-        assertFalse(isLinear(ONE));
+        assertFalse(isLinear(UNITY));
         assertTrue (isLinear(METRE));
         assertFalse(isLinear(RADIAN));
-        assertFalse(isLinear(CENTIRADIAN));
-        assertFalse(isLinear(DEGREE_ANGLE));
-        assertFalse(isLinear(MINUTE_ANGLE));
-        assertFalse(isLinear(SECOND_ANGLE));
-        assertFalse(isLinear(GRADE));
+        assertFalse(isLinear(DEGREE));
+        assertFalse(isLinear(ARC_MINUTE));
+        assertFalse(isLinear(ARC_SECOND));
+        assertFalse(isLinear(GRAD));
         assertFalse(isLinear(DAY));
-        assertFalse(isLinear(SPHERE));
-        assertFalse(isLinear(ATMOSPHERE));
         assertTrue (isLinear(NAUTICAL_MILE));
 
         // Additional units
@@ -147,17 +124,14 @@ public final strictfp class UnitsTest ex
     public void testIsAngular() {
         // Standard units
         assertFalse(isAngular(null));
-        assertFalse(isAngular(ONE));
+        assertFalse(isAngular(UNITY));
         assertFalse(isAngular(METRE));
         assertTrue (isAngular(RADIAN));
-        assertTrue (isAngular(CENTIRADIAN));
-        assertTrue (isAngular(DEGREE_ANGLE));
-        assertTrue (isAngular(MINUTE_ANGLE));
-        assertTrue (isAngular(SECOND_ANGLE));
-        assertTrue (isAngular(GRADE));
+        assertTrue (isAngular(DEGREE));
+        assertTrue (isAngular(ARC_MINUTE));
+        assertTrue (isAngular(ARC_SECOND));
+        assertTrue (isAngular(GRAD));
         assertFalse(isAngular(DAY));
-        assertFalse(isAngular(SPHERE));
-        assertFalse(isAngular(ATMOSPHERE));
         assertFalse(isAngular(NAUTICAL_MILE));
 
         // Additional units
@@ -174,17 +148,14 @@ public final strictfp class UnitsTest ex
     public void testIsScale() {
         // Standard units
         assertFalse(isScale(null));
-        assertTrue (isScale(ONE));
+        assertTrue (isScale(UNITY));
         assertFalse(isScale(METRE));
         assertFalse(isScale(RADIAN));
-        assertFalse(isScale(CENTIRADIAN));
-        assertFalse(isScale(DEGREE_ANGLE));
-        assertFalse(isScale(MINUTE_ANGLE));
-        assertFalse(isScale(SECOND_ANGLE));
-        assertFalse(isScale(GRADE));
+        assertFalse(isScale(DEGREE));
+        assertFalse(isScale(ARC_MINUTE));
+        assertFalse(isScale(ARC_SECOND));
+        assertFalse(isScale(GRAD));
         assertFalse(isScale(DAY));
-        assertFalse(isScale(SPHERE));
-        assertFalse(isScale(ATMOSPHERE));
         assertFalse(isScale(NAUTICAL_MILE));
 
         // Additional units
@@ -201,7 +172,6 @@ public final strictfp class UnitsTest ex
     public void testIsPressure() {
         assertFalse(isPressure(null));
         assertFalse(isPressure(METRE));
-        assertTrue (isPressure(ATMOSPHERE));
     }
 
     /**
@@ -210,16 +180,23 @@ public final strictfp class UnitsTest ex
     @Test
     public void testToStandardUnit() {
         assertEquals(1000.0,               toStandardUnit(KILOMETRE),    1E-15);
-        assertEquals(0.017453292519943295, toStandardUnit(DEGREE_ANGLE), 1E-15);
+        assertEquals(0.017453292519943295, toStandardUnit(DEGREE), 1E-15);
     }
 
     /**
-     * Tests {@link Units#multiply(Unit, double)}.
+     * Tests getting a unit for a given quantity type.
      */
     @Test
-    public void testMultiply() {
-        assertSame(KILOMETRE,    multiply(METRE,  1000));
-        assertSame(DEGREE_ANGLE, multiply(RADIAN, 0.017453292519943295));
+    public void testGetForQuantity() {
+        assertSame("Length",        Units.METRE,             Units.get(Length.class));
+        assertSame("Mass",          Units.KILOGRAM,          Units.get(Mass.class));
+        assertSame("Time",          Units.SECOND,            Units.get(Time.class));
+        assertSame("Temperature",   Units.KELVIN,            Units.get(Temperature.class));
+        assertSame("Area",          Units.SQUARE_METRE,      Units.get(Area.class));
+        assertSame("Volume",        Units.CUBIC_METRE,       Units.get(Volume.class));
+        assertSame("Speed",         Units.METRES_PER_SECOND, Units.get(Speed.class));
+        assertSame("Angle",         Units.RADIAN,            Units.get(Angle.class));
+        assertSame("Dimensionless", Units.UNITY,             Units.get(Dimensionless.class));
     }
 
     /**
@@ -227,18 +204,18 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testValueOf() {
-        assertSame(DEGREE_ANGLE, valueOf("°"));
-        assertSame(DEGREE_ANGLE, valueOf("deg"));
-        assertSame(DEGREE_ANGLE, valueOf("degree"));
-        assertSame(DEGREE_ANGLE, valueOf("degrees"));
-        assertSame(DEGREE_ANGLE, valueOf("degrées"));
-        assertSame(DEGREE_ANGLE, valueOf("DEGREES"));
-        assertSame(DEGREE_ANGLE, valueOf("DEGRÉES"));
-        assertSame(DEGREE_ANGLE, valueOf("degrees_east"));
-        assertSame(DEGREE_ANGLE, valueOf("degrees_north"));
-        assertSame(DEGREE_ANGLE, valueOf("degrées_north"));
-        assertSame(DEGREE_ANGLE, valueOf("decimal_degree"));
-        assertSame(SECOND_ANGLE, valueOf("arcsec"));
+        assertSame(DEGREE,       valueOf("°"));
+        assertSame(DEGREE,       valueOf("deg"));
+        assertSame(DEGREE,       valueOf("degree"));
+        assertSame(DEGREE,       valueOf("degrees"));
+        assertSame(DEGREE,       valueOf("degrées"));
+        assertSame(DEGREE,       valueOf("DEGREES"));
+        assertSame(DEGREE,       valueOf("DEGRÉES"));
+        assertSame(DEGREE,       valueOf("degrees_east"));
+        assertSame(DEGREE,       valueOf("degrees_north"));
+        assertSame(DEGREE,       valueOf("degrées_north"));
+        assertSame(DEGREE,       valueOf("decimal_degree"));
+        assertSame(ARC_SECOND,   valueOf("arcsec"));
         assertSame(RADIAN,       valueOf("rad"));
         assertSame(RADIAN,       valueOf("radian"));
         assertSame(RADIAN,       valueOf("radians"));
@@ -269,7 +246,7 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testAdvancedValueOf() {
-        assertSame  (Units.MILLISECOND,             valueOf("ms"));
+        assertSame  (MILLISECOND,                   valueOf("ms"));
         assertEquals(METRES_PER_SECOND,             valueOf("m/s"));
         assertEquals(METRES_PER_SECOND,             valueOf("m.s-1"));
         assertEquals(SQUARE_METRE.divide(SECOND),   valueOf("m2.s-1"));
@@ -279,14 +256,14 @@ public final strictfp class UnitsTest ex
         assertSame  (HERTZ,                         valueOf("1/s"));
         assertSame  (HERTZ,                         valueOf("s-1"));
         assertSame  (PERCENT,                       valueOf("%"));
-        assertSame  (Unit.ONE,                      valueOf("kg/kg"));
-        assertSame  (Unit.ONE,                      valueOf("kg.kg-1"));
-        assertSame  (Units.PPM,                     valueOf("ppm")); // Parts per million
-        assertSame  (Units.PSU,                     valueOf("psu")); // Pratical Salinity Unit
-        assertSame  (Units.SIGMA,                   valueOf("sigma"));
+        assertSame  (UNITY,                         valueOf("kg/kg"));
+        assertSame  (UNITY,                         valueOf("kg.kg-1"));
+        assertSame  (PPM,                           valueOf("ppm"));            // Parts per million
+        assertSame  (PSU,                           valueOf("psu"));            // Pratical Salinity Unit
+        assertSame  (SIGMA,                         valueOf("sigma"));
 
         // Potential vorticity surface
-        assertEquals(KELVIN.times(SQUARE_METRE).divide(KILOGRAM.times(SECOND)), valueOf("K.m2.kg-1.s-1"));
+        assertEquals(KELVIN.multiply(SQUARE_METRE).divide(KILOGRAM.multiply(SECOND)), valueOf("K.m2.kg-1.s-1"));
     }
 
     /**
@@ -294,14 +271,33 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testValueOfEPSG() {
-        assertSame(METRE,        valueOfEPSG(9001));
-        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"));
-        assertSame(METRE,        valueOf("http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"));
-        assertSame(METRE,        valueOf("gmxUom.xml#m"));
+        assertSame(METRE,  valueOfEPSG(9001));
+        assertSame(DEGREE, valueOfEPSG(9102));              // Used in prime meridian and operation parameters.
+        assertSame(DEGREE, valueOfEPSG(9122));              // Used in coordinate system axes.
+        assertSame(METRE,  valueOf("EPSG:9001"));
+        assertSame(DEGREE, valueOf(" epsg : 9102"));
+        assertSame(DEGREE, valueOf("urn:ogc:def:uom:EPSG::9102"));
+        assertSame(METRE,  valueOf("http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"));
+        assertSame(METRE,  valueOf("gmxUom.xml#m"));
+
+        assertSame(TROPICAL_YEAR,   valueOfEPSG(1029));
+        assertSame(SECOND,          valueOfEPSG(1040));
+        assertSame(FOOT,            valueOfEPSG(9002));
+        assertSame(US_SURVEY_FOOT,  valueOfEPSG(9003));
+        assertSame(NAUTICAL_MILE,   valueOfEPSG(9030));
+        assertSame(KILOMETRE,       valueOfEPSG(9036));
+        assertSame(RADIAN,          valueOfEPSG(9101));
+        assertSame(ARC_MINUTE,      valueOfEPSG(9103));
+        assertSame(ARC_SECOND,      valueOfEPSG(9104));
+        assertSame(GRAD,            valueOfEPSG(9105));
+        assertSame(MICRORADIAN,     valueOfEPSG(9109));
+        assertSame(SexagesimalConverter.DMS_SCALED, valueOfEPSG(9107));
+        assertSame(SexagesimalConverter.DMS_SCALED, valueOfEPSG(9108));
+        assertSame(SexagesimalConverter.DMS,        valueOfEPSG(9110));
+        assertSame(SexagesimalConverter.DM,         valueOfEPSG(9111));
+        assertSame(UNITY,           valueOfEPSG(9203));
+        assertSame(UNITY,           valueOfEPSG(9201));
+        assertSame(PPM,             valueOfEPSG(9202));
     }
 
     /**
@@ -309,10 +305,25 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testGetEpsgCode() {
-        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));
+        assertEquals(Integer.valueOf(9001), getEpsgCode(METRE,          false));
+        assertEquals(Integer.valueOf(9102), getEpsgCode(DEGREE,         false));
+        assertEquals(Integer.valueOf(9122), getEpsgCode(DEGREE,         true));
+        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS,            false));
+        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS,            true));
+        assertEquals(Integer.valueOf(9107), getEpsgCode(DMS_SCALED,     false));
+        assertEquals(Integer.valueOf(9111), getEpsgCode(DM,             false));
+        assertEquals(Integer.valueOf(1029), getEpsgCode(TROPICAL_YEAR,  false));
+        assertEquals(Integer.valueOf(1040), getEpsgCode(SECOND,         false));
+        assertEquals(Integer.valueOf(9002), getEpsgCode(FOOT,           false));
+        assertEquals(Integer.valueOf(9003), getEpsgCode(US_SURVEY_FOOT, false));
+        assertEquals(Integer.valueOf(9030), getEpsgCode(NAUTICAL_MILE,  false));
+        assertEquals(Integer.valueOf(9036), getEpsgCode(KILOMETRE,      false));
+        assertEquals(Integer.valueOf(9101), getEpsgCode(RADIAN,         false));
+        assertEquals(Integer.valueOf(9103), getEpsgCode(ARC_MINUTE,     false));
+        assertEquals(Integer.valueOf(9104), getEpsgCode(ARC_SECOND,     false));
+        assertEquals(Integer.valueOf(9105), getEpsgCode(GRAD,           false));
+        assertEquals(Integer.valueOf(9109), getEpsgCode(MICRORADIAN,    false));
+        assertEquals(Integer.valueOf(9201), getEpsgCode(UNITY,          false));
+        assertEquals(Integer.valueOf(9202), getEpsgCode(PPM,            false));
     }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.test.mock;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,9 +17,7 @@
 package org.apache.sis.test.mock;
 
 import java.util.Date;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.referencing.crs.VerticalCRS;
 import org.opengis.referencing.cs.AxisDirection;
@@ -29,6 +27,7 @@ import org.opengis.referencing.cs.Vertic
 import org.opengis.referencing.datum.VerticalDatum;
 import org.opengis.referencing.datum.VerticalDatumType;
 import org.opengis.util.InternationalString;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -36,7 +35,7 @@ import org.opengis.util.InternationalStr
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @SuppressWarnings("serial")
@@ -47,31 +46,31 @@ public final strictfp class VerticalCRSM
      * Height in metres.
      */
     public static final VerticalCRS HEIGHT = new VerticalCRSMock("Height",
-            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, true);
+            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Units.METRE, true);
 
     /**
      * Height in feet.
      */
     public static final VerticalCRS HEIGHT_ft = new VerticalCRSMock("Height",
-            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, NonSI.FOOT, true);
+            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Units.FOOT, true);
 
     /**
      * Height estimated from hPa.
      */
     public static final VerticalCRS BAROMETRIC_HEIGHT = new VerticalCRSMock("Barometric height",
-            VerticalDatumType.BAROMETRIC, 0, Double.POSITIVE_INFINITY, SI.MetricPrefix.HECTO(SI.PASCAL), true);
+            VerticalDatumType.BAROMETRIC, 0, Double.POSITIVE_INFINITY, Units.HECTOPASCAL, true);
 
     /**
      * Depth in metres.
      */
     public static final VerticalCRS DEPTH = new VerticalCRSMock("Depth",
-            VerticalDatumType.DEPTH, 0, Double.POSITIVE_INFINITY, SI.METRE, false);
+            VerticalDatumType.DEPTH, 0, Double.POSITIVE_INFINITY, Units.METRE, false);
 
     /**
      * Depth as a fraction of the sea floor depth at the location of the point for which the depth is evaluated.
      */
     public static final VerticalCRS SIGMA_LEVEL = new VerticalCRSMock("Sigma level",
-            VerticalDatumType.OTHER_SURFACE, 0, 1, Unit.ONE, false);
+            VerticalDatumType.OTHER_SURFACE, 0, 1, Units.UNITY, false);
 
     /**
      * The datum type (geoidal, barometric, etc.).

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -51,11 +51,12 @@ import org.junit.BeforeClass;
     org.apache.sis.util.LocalesTest.class,
     org.apache.sis.util.resources.LoaderTest.class,
     org.apache.sis.util.resources.IndexedResourceBundleTest.class,
-    org.apache.sis.util.ArgumentChecksTest.class, // Uses resources.
+    org.apache.sis.util.ArgumentChecksTest.class,                       // Uses resources.
     org.apache.sis.util.logging.PerformanceLevelTest.class,
     org.apache.sis.util.logging.WarningListenersTest.class,
     org.apache.sis.util.logging.MonolineFormatterTest.class,
     org.apache.sis.util.logging.LoggerAdapterTest.class,
+    org.apache.sis.math.FractionTest.class,
     org.apache.sis.math.VectorTest.class,
     org.apache.sis.math.MathFunctionsTest.class,
     org.apache.sis.math.DecimalFunctionsTest.class,
@@ -102,7 +103,13 @@ import org.junit.BeforeClass;
 
     // Measurements and formatting.
     org.apache.sis.measure.SexagesimalConverterTest.class,
+    org.apache.sis.measure.LinearConverterTest.class,
+    org.apache.sis.measure.UnitDimensionTest.class,
+    org.apache.sis.measure.SystemUnitTest.class,
+    org.apache.sis.measure.ConventionalUnitTest.class,
+    org.apache.sis.measure.UnitFormatTest.class,
     org.apache.sis.measure.UnitsTest.class,
+    org.apache.sis.measure.UnitServicesTest.class,
     org.apache.sis.measure.RangeTest.class,
     org.apache.sis.measure.DateRangeTest.class,
     org.apache.sis.measure.NumberRangeTest.class,
@@ -132,7 +139,7 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.converter.ArrayConverterTest.class,
     org.apache.sis.internal.converter.ConverterRegistryTest.class,
     org.apache.sis.internal.converter.SystemRegistryTest.class,
-    org.apache.sis.internal.converter.NumberConverterTest.class, // Shall be after SystemRegistryTest.
+    org.apache.sis.internal.converter.NumberConverterTest.class,        // Shall be after SystemRegistryTest.
 
     // XML most basic types.
     org.apache.sis.xml.XLinkTest.class,

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -34,7 +34,7 @@ import static org.apache.sis.util.CharSe
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -233,6 +233,8 @@ public final strictfp class CharSequence
 
     /**
      * Tests the {@link CharSequences#toASCII(CharSequence)} method.
+     *
+     * @see StringBuildersTest#testToASCII()
      */
     @Test
     public void testToASCII() {
@@ -240,6 +242,8 @@ public final strictfp class CharSequence
         assertSame  (metre, toASCII(metre));
         assertEquals(metre, toASCII("mètre").toString());
         assertNull  (       toASCII(null));
+        assertEquals("kg, mg, cm, km, km2, km3, ml, m/s, Pa, Hz, mol, ms, μs, m3, rad",
+                toASCII("㎏, ㎎, ㎝, ㎞, ㎢, ㎦, ㎖, ㎧, ㎩, ㎐, ㏖, ㎳, ㎲, ㎥, ㎭").toString());
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -29,7 +29,7 @@ import static org.apache.sis.util.String
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 public final strictfp class StringBuildersTest extends TestCase {
@@ -87,13 +87,15 @@ public final strictfp class StringBuilde
         final StringBuilder buffer = new StringBuilder("4.10");
         trimFractionalPart(buffer);
         assertEquals("4.10", buffer.toString());
-        buffer.setCharAt(2, '0'); // Replace the '1' by '0'.
+        buffer.setCharAt(2, '0');                                   // Replace the '1' by '0'.
         trimFractionalPart(buffer);
         assertEquals("4", buffer.toString());
     }
 
     /**
      * Tests the {@link StringBuilders#toASCII(StringBuilder)} method.
+     *
+     * @see CharSequencesTest#testToASCII()
      */
     @Test
     public void testToASCII() {
@@ -102,5 +104,26 @@ public final strictfp class StringBuilde
                 " ‘single’, “double”, \"ascii' 30°20′10″.");
         toASCII(s);
         assertEquals("metres\n 'single', \"double\", \"ascii' 30°20'10\".", s.toString());
+        /*
+         * Characters below are in the Unicode CJK compatibility block. They are not intended for normal use.
+         * Note that in the decomposition form of ㎲, the first character is the Greek letter μ (U+03BC) instead
+         * of the micro sign µ (U+0085).
+         */
+        s.setLength(0);
+        toASCII(s.append("㎏, ㎎, ㎝, ㎞, ㎢, ㎦, ㎖, ㎧, ㎩, ㎐, ㏖, ㎳, ㎲, ㎥, ㎭"));
+        assertEquals("kg, mg, cm, km, km2, km3, ml, m/s, Pa, Hz, mol, ms, μs, m3, rad", s.toString());
+        /*
+         * Characters below are not from Unicode compatibility block, but nevertheless need decomposition or
+         * replacement. Note that the first K is the Kelvin sign (U+212A), to be replaced by the K letter.
+         */
+        s.setLength(0);
+        toASCII(s.append("℃, K, m⋅s"));
+        assertEquals("°C, K, m*s", s.toString());
+        /*
+         * Tests the shortcut code path.
+         */
+        s.setLength(0);
+        toASCII(s.append("ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"));
+        assertEquals(    "AAAAAAÆCEEEEIIIIDNOOOOO*OUUUUYÞsaaaaaaæceeeeiiiionooooo/ouuuuyþy", s.toString());
     }
 }

Modified: sis/trunk/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/build.xml?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/build.xml (original)
+++ sis/trunk/ide-project/NetBeans/build.xml Tue Nov  1 21:03:06 2016
@@ -82,6 +82,13 @@
       </fileset>
     </concat>
 
+    <!-- Units of Measurement implementations to be loaded by ServiceLoader. -->
+    <concat destfile="${build.classes.dir}/META-INF/services/javax.measure.spi.ServiceProvider" encoding="UTF-8" fixlastline="yes">
+      <fileset dir="${project.root}">
+        <include name="*/*/src/main/resources/META-INF/services/javax.measure.spi.ServiceProvider"/>
+      </fileset>
+    </concat>
+
 
 
     <!-- ==== GeoAPI service providers ============================================================================= -->

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.properties?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Tue Nov  1 21:03:06 2016
@@ -75,9 +75,8 @@ test.fra-profile.dir = ${project.root}/p
 # Those dependencies must exist in the local Maven repository.
 # Those numbers should match the ones declared in the pom.xml files.
 #
-geoapi.version       = 3.0.0
-unit-api.version     = 0.6.1
-jsr275.version       = 0.9.3
+geoapi.version       = 3.0.1-RC1
+jsr363.version       = 1.0
 jama.version         = 1.0.3
 geometry.version     = 1.2.1
 georss.version       = 0.9.8
@@ -102,7 +101,7 @@ maven.repository   = ${user.home}/.m2/re
 endorsed.classpath=
 javac.classpath=\
     ${maven.repository}/org/opengis/geoapi/${geoapi.version}/geoapi-${geoapi.version}.jar:\
-    ${maven.repository}/javax/measure/jsr-275/${jsr275.version}/jsr-275-${jsr275.version}.jar:\
+    ${maven.repository}/javax/measure/unit-api/${jsr363.version}/unit-api-${jsr363.version}.jar:\
     ${maven.repository}/com/esri/geometry/esri-geometry-api/${geometry.version}/esri-geometry-api-${geometry.version}.jar:\
     ${maven.repository}/org/geonames/georss-rome/${georss.version}/georss-rome-${georss.version}.jar:\
     ${maven.repository}/rome/rome/${rome.version}/rome-${rome.version}.jar:\

Modified: sis/trunk/ide-project/eclipse/classpath
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/eclipse/classpath?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/ide-project/eclipse/classpath (original)
+++ sis/trunk/ide-project/eclipse/classpath Tue Nov  1 21:03:06 2016
@@ -20,7 +20,6 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="var" path="M2_REPO/org/opengis/geoapi/3.0.0/geoapi-3.0.0.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/opengis/geoapi-conformance/3.0.0/geoapi-conformance-3.0.0.jar"/>
-	<classpathentry kind="var" path="M2_REPO/javax/measure/jsr-275/0.9.3/jsr-275-0.9.3.jar"/>
 	<classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.core/5.0.0/org.osgi.core-5.0.0.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-core/3.0.4/maven-core-3.0.4.jar"/>

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Tue Nov  1 21:03:06 2016
@@ -418,6 +418,7 @@ Apache SIS is a free software, Java lang
         <groupId>gov.nist.math</groupId>
         <artifactId>jama</artifactId>
         <version>1.0.3</version>
+        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>javax</groupId>
@@ -482,7 +483,7 @@ Apache SIS is a free software, Java lang
     <maven.compile.source>1.7</maven.compile.source>
     <maven.compile.target>1.7</maven.compile.target>
     <sis.plugin.version>${project.version}</sis.plugin.version>
-    <geoapi.version>3.0.0</geoapi.version>
+    <geoapi.version>3.0.1-RC1</geoapi.version>
   </properties>
 
   <profiles>
@@ -825,6 +826,16 @@ Apache SIS is a free software, Java lang
     </pluginRepository>
   </pluginRepositories>
 
+  <!-- Temporary repository for GeoAPI 3.0.1-RC1.
+       Shall be removed after GeoAPI release. -->
+  <repositories>
+    <repository>
+      <id>geotoolkit</id>
+      <name>Geotoolkit.org repository</name>
+      <url>http://maven.geotoolkit.org</url>
+    </repository>
+  </repositories>
+
 
   <!-- ==============================================================
          Group of modules to build in approximate dependency order.

Modified: sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -25,8 +25,6 @@ import java.util.Locale;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.io.LineNumberReader;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.citation.Citation;
@@ -42,6 +40,7 @@ import org.opengis.referencing.operation
 import org.opengis.util.NoSuchIdentifierException;
 import org.opengis.util.FactoryException;
 
+import org.apache.sis.measure.Units;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.metadata.iso.DefaultIdentifier;
 import org.apache.sis.metadata.iso.citation.Citations;
@@ -802,7 +801,7 @@ final class LandsatReader {
             band = new DefaultBand();
             band.setDescription(new SimpleInternationalString(BAND_NAMES[index]));
             band.setPeakResponse((double) WAVELENGTHS[index]);
-            band.setBoundUnits(SI.MetricPrefix.NANO(SI.METRE));
+            band.setBoundUnits(Units.NANOMETRE);
             bands[index] = band;
         }
         return band;
@@ -818,7 +817,7 @@ final class LandsatReader {
      */
     private void setProjectionParameter(final String key, final String name, final String value, final boolean isLinear) {
         if (projection != null) {
-            projection.parameter(name).setValue(Double.parseDouble(value), isLinear ? SI.METRE : NonSI.DEGREE_ANGLE);
+            projection.parameter(name).setValue(Double.parseDouble(value), isLinear ? Units.METRE : Units.DEGREE);
         } else {
             listeners.warning(errors().getString(Errors.Keys.UnexpectedProperty_2, filename, key), null);
         }

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,7 +19,8 @@ package org.apache.sis.internal.netcdf;
 import java.util.Date;
 import java.io.Closeable;
 import java.io.IOException;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
+import javax.measure.format.ParserException;
 import org.apache.sis.measure.Units;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.logging.WarningListeners;
@@ -146,7 +147,7 @@ public abstract class Decoder implements
         final String unit = stringValue(name);
         if (unit != null) try {
             return Units.valueOf(unit);
-        } catch (IllegalArgumentException e) {
+        } catch (ParserException e) {
             listeners.warning(null, e);
         }
         return null;

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -31,8 +31,9 @@ import java.util.regex.Pattern;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.ReadableByteChannel;
-import javax.measure.converter.UnitConverter;
-import javax.measure.converter.ConversionException;
+import javax.measure.UnitConverter;
+import javax.measure.IncommensurableException;
+import javax.measure.format.ParserException;
 import org.opengis.parameter.InvalidParameterCardinalityException;
 import org.apache.sis.internal.netcdf.DataType;
 import org.apache.sis.internal.netcdf.Decoder;
@@ -729,7 +730,7 @@ public final class ChannelDecoder extend
                     dates[i] = new Date(epoch + Math.round(converter.convert(value.doubleValue())));
                 }
             }
-        } catch (ConversionException | DateTimeException | ArithmeticException e) {
+        } catch (IncommensurableException | ParserException | DateTimeException | ArithmeticException e) {
             listeners.warning(null, e);
         }
         return dates;

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -27,11 +27,10 @@ import java.util.HashMap;
 import java.util.Arrays;
 import java.util.Collection;
 import java.io.IOException;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.converter.UnitConverter;
-import javax.measure.converter.ConversionException;
+import javax.measure.Unit;
+import javax.measure.UnitConverter;
+import javax.measure.IncommensurableException;
+import javax.measure.format.ParserException;
 
 import org.opengis.util.NameFactory;
 import org.opengis.util.InternationalString;
@@ -684,8 +683,8 @@ final class MetadataReader {
          * If at least one geographic ordinates above is available, add a GeographicBoundingBox.
          */
         if (xmin != null || xmax != null || ymin != null || ymax != null) {
-            final UnitConverter xConv = getConverterTo(decoder.unitValue(LONGITUDE.UNITS), NonSI.DEGREE_ANGLE);
-            final UnitConverter yConv = getConverterTo(decoder.unitValue(LATITUDE .UNITS), NonSI.DEGREE_ANGLE);
+            final UnitConverter xConv = getConverterTo(decoder.unitValue(LONGITUDE.UNITS), Units.DEGREE);
+            final UnitConverter yConv = getConverterTo(decoder.unitValue(LATITUDE .UNITS), Units.DEGREE);
             extent = new DefaultExtent(null, new DefaultGeographicBoundingBox(
                     valueOf(xmin, xConv), valueOf(xmax, xConv),
                     valueOf(ymin, yConv), valueOf(ymax, yConv)), null, null);
@@ -694,7 +693,7 @@ final class MetadataReader {
          * If at least one vertical ordinates above is available, add a VerticalExtent.
          */
         if (zmin != null || zmax != null) {
-            final UnitConverter c = getConverterTo(decoder.unitValue(VERTICAL.UNITS), SI.METRE);
+            final UnitConverter c = getConverterTo(decoder.unitValue(VERTICAL.UNITS), Units.METRE);
             double min = valueOf(zmin, c);
             double max = valueOf(zmax, c);
             if (CF.POSITIVE_DOWN.equals(stringValue(VERTICAL.POSITIVE))) {
@@ -760,7 +759,7 @@ final class MetadataReader {
     private UnitConverter getConverterTo(final Unit<?> source, final Unit<?> target) {
         if (source != null) try {
             return source.getConverterToAny(target);
-        } catch (ConversionException e) {
+        } catch (IncommensurableException e) {
             warning(e);
         }
         return null;
@@ -866,7 +865,7 @@ final class MetadataReader {
         final String units = variable.getUnitsString();
         if (units != null) try {
             band.setUnits(Units.valueOf(units));
-        } catch (RuntimeException e) { // IllegalArgumentException or ClassCastException (specific to this branch).
+        } catch (ClassCastException | ParserException e) {
             decoder.listeners.warning(errors().getString(Errors.Keys.CanNotAssignUnitToDimension_2, name, units), e);
         }
         return band;

Modified: sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -144,7 +144,7 @@ public final strictfp class MetadataRead
             "  │   └─Attribute group\n" +
             "  │       └─Attribute\n" +
             "  │           ├─Sequence identifier……………………………… SST\n" +
-            "  │           ├─Units…………………………………………………………………… K\n" +
+            "  │           ├─Units…………………………………………………………………… K\n" +
             "  │           └─Description…………………………………………………… Sea temperature\n" +
             "  ├─Data quality info\n" +
             "  │   └─Lineage\n" +

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -29,10 +29,8 @@ import java.io.LineNumberReader;
 import java.io.IOException;
 import java.net.URI;
 import java.nio.charset.Charset;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.quantity.Duration;
+import javax.measure.Unit;
+import javax.measure.quantity.Time;
 import org.opengis.metadata.Metadata;
 import org.opengis.util.FactoryException;
 import org.opengis.metadata.maintenance.ScopeCode;
@@ -59,6 +57,7 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.IndexedResourceBundle;
 import org.apache.sis.util.collection.BackingStoreException;
+import org.apache.sis.measure.Units;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Instant;
@@ -258,13 +257,13 @@ public final class Store extends DataSto
     @SuppressWarnings("fallthrough")
     private GeneralEnvelope parseEnvelope(final List<String> elements) throws DataStoreException, FactoryException {
         CoordinateReferenceSystem crs = null;
-        int spatialDimensionCount     = 2;
-        double[]       lowerCorner    = ArraysExt.EMPTY_DOUBLE;
-        double[]       upperCorner    = ArraysExt.EMPTY_DOUBLE;
-        Instant        startTime      = null;
-        Instant        endTime        = null;
-        Unit<Duration> timeUnit       = SI.SECOND;
-        boolean        isTimeAbsolute = false;
+        int spatialDimensionCount = 2;
+        double[]   lowerCorner    = ArraysExt.EMPTY_DOUBLE;
+        double[]   upperCorner    = ArraysExt.EMPTY_DOUBLE;
+        Instant    startTime      = null;
+        Instant    endTime        = null;
+        Unit<Time> timeUnit       = Units.SECOND;
+        boolean    isTimeAbsolute = false;
         int ordinal = -1;
         for (final String element : elements) {
             ordinal++;
@@ -292,10 +291,10 @@ public final class Store extends DataSto
                     case 6: endTime     = Instant.parse(element); continue;
                     case 7: switch (element.toLowerCase(Locale.US)) {
                                 case "sec":
-                                case "second":   /* Already SI.SECOND. */ continue;
-                                case "minute":   timeUnit = NonSI.MINUTE; continue;
-                                case "hour":     timeUnit = NonSI.HOUR;   continue;
-                                case "day":      timeUnit = NonSI.DAY;    continue;
+                                case "second":   /* Already SECOND. */    continue;
+                                case "minute":   timeUnit = Units.MINUTE; continue;
+                                case "hour":     timeUnit = Units.HOUR;   continue;
+                                case "day":      timeUnit = Units.DAY;    continue;
                                 case "absolute": isTimeAbsolute = true;   continue;
                                 default: throw new DataStoreContentException(errors().getString(Errors.Keys.UnknownUnit_1, element));
                             }

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,9 +16,8 @@
  */
 package org.apache.sis.internal.storage.csv;
 
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
-import javax.measure.quantity.Duration;
+import javax.measure.Unit;
+import javax.measure.quantity.Time;
 import org.opengis.referencing.datum.TemporalDatum;
 import org.apache.sis.internal.converter.SurjectiveConverter;
 import org.apache.sis.referencing.CommonCRS;
@@ -47,7 +46,7 @@ class TimeEncoding extends SurjectiveCon
     /**
      * Times are formatted as ISO dates.
      */
-    static final TimeEncoding ABSOLUTE = new TimeEncoding(DEFAULT.datum(), NonSI.DAY) {
+    static final TimeEncoding ABSOLUTE = new TimeEncoding(DEFAULT.datum(), Units.DAY) {
         @Override public Instant apply(final String time) {
             return Instant.parse(time);
         }
@@ -66,7 +65,7 @@ class TimeEncoding extends SurjectiveCon
     /**
      * Creates a new time encoding.
      */
-    TimeEncoding(final TemporalDatum datum, final Unit<Duration> unit) {
+    TimeEncoding(final TemporalDatum datum, final Unit<Time> unit) {
         this.origin   = datum.getOrigin().getTime();
         this.interval = unit.getConverterTo(Units.MILLISECOND).convert(1);
     }

Modified: sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -52,7 +52,7 @@ public final strictfp class StoreTest ex
             "  DATUM[\"Nouvelle Triangulation Francaise (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]]";
 



Mime
View raw message