sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1767577 [3/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-metadata/src/main/java/org/apache/sis/io/wkt/VerticalInfo.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/VerticalInfo.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/VerticalInfo.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/VerticalInfo.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,7 +18,7 @@ package org.apache.sis.io.wkt;
 
 import java.util.Map;
 import java.util.Collections;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Length;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.IdentifiedObject;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -29,8 +29,7 @@ import java.text.NumberFormat;
 import java.text.DateFormat;
 import java.text.ParsePosition;
 import java.text.ParseException;
-import javax.measure.unit.Unit;
-import javax.measure.unit.UnitFormat;
+import javax.measure.Unit;
 import org.opengis.util.Factory;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
@@ -41,6 +40,7 @@ import org.opengis.referencing.datum.Dat
 import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.referencing.operation.CoordinateOperationFactory;
 import org.apache.sis.io.CompoundFormat;
+import org.apache.sis.measure.UnitFormat;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
@@ -110,7 +110,7 @@ import org.apache.sis.internal.jdk8.JDK8
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Rémi Eve (IRD)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  *
  * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
@@ -235,8 +235,8 @@ public class WKTFormat extends CompoundF
      * Creates a format for the given locale and timezone. The given locale will be used for
      * {@link InternationalString} localization; this is <strong>not</strong> the locale for number format.
      *
-     * @param locale   The locale for the new {@code Format}, or {@code null} for {@code Locale.ROOT}.
-     * @param timezone The timezone, or {@code null} for UTC.
+     * @param  locale    the locale for the new {@code Format}, or {@code null} for {@code Locale.ROOT}.
+     * @param  timezone  the timezone, or {@code null} for UTC.
      */
     public WKTFormat(final Locale locale, final TimeZone timezone) {
         super(locale, timezone);
@@ -279,8 +279,8 @@ public class WKTFormat extends CompoundF
      *       used for {@link InternationalString} localization.</li>
      * </ul>
      *
-     * @param  category The category for which a locale is desired.
-     * @return The locale for the given category (never {@code null}).
+     * @param  category  the category for which a locale is desired.
+     * @return the locale for the given category (never {@code null}).
      */
     @Override
     public Locale getLocale(final Locale.Category category) {
@@ -293,7 +293,7 @@ public class WKTFormat extends CompoundF
     /**
      * Returns the symbols used for parsing and formatting WKT.
      *
-     * @return The current set of symbols used for parsing and formatting WKT.
+     * @return the current set of symbols used for parsing and formatting WKT.
      */
     public Symbols getSymbols() {
         return symbols;
@@ -302,7 +302,7 @@ public class WKTFormat extends CompoundF
     /**
      * Sets the symbols used for parsing and formatting WKT.
      *
-     * @param symbols The new set of symbols to use for parsing and formatting WKT.
+     * @param  symbols  the new set of symbols to use for parsing and formatting WKT.
      */
     public void setSymbols(final Symbols symbols) {
         ArgumentChecks.ensureNonNull("symbols", symbols);
@@ -325,7 +325,7 @@ public class WKTFormat extends CompoundF
      *   <li>Any other user-supplied mapping.</li>
      * </ul>
      *
-     * @return The mapper between Java character sequences and the characters to write in WKT.
+     * @return the mapper between Java character sequences and the characters to write in WKT.
      *
      * @since 0.6
      */
@@ -344,7 +344,7 @@ public class WKTFormat extends CompoundF
      * then the default mapper is {@link Transliterator#DEFAULT} except for WKT formatted according
      * the {@linkplain Convention#INTERNAL internal convention}.</p>
      *
-     * @param transliterator The new mapper to use, or {@code null} for restoring the default value.
+     * @param  transliterator  the new mapper to use, or {@code null} for restoring the default value.
      *
      * @since 0.6
      */
@@ -359,7 +359,7 @@ public class WKTFormat extends CompoundF
     /**
      * Returns whether WKT keywords should be written with upper cases or camel cases.
      *
-     * @return The case to use for formatting keywords.
+     * @return the case to use for formatting keywords.
      */
     public KeywordCase getKeywordCase() {
         return keywordCase;
@@ -368,7 +368,7 @@ public class WKTFormat extends CompoundF
     /**
      * Sets whether WKT keywords should be written with upper cases or camel cases.
      *
-     * @param keywordCase The case to use for formatting keywords.
+     * @param  keywordCase  the case to use for formatting keywords.
      */
     public void setKeywordCase(final KeywordCase keywordCase) {
         ArgumentChecks.ensureNonNull("keywordCase", keywordCase);
@@ -379,7 +379,7 @@ public class WKTFormat extends CompoundF
     /**
      * Returns whether to use short or long WKT keywords.
      *
-     * @return The style used for formatting keywords.
+     * @return the style used for formatting keywords.
      *
      * @since 0.6
      */
@@ -390,7 +390,7 @@ public class WKTFormat extends CompoundF
     /**
      * Sets whether to use short or long WKT keywords.
      *
-     * @param keywordStyle The style to use for formatting keywords.
+     * @param  keywordStyle  the style to use for formatting keywords.
      *
      * @since 0.6
      */
@@ -404,7 +404,7 @@ public class WKTFormat extends CompoundF
      * Returns the colors to use for syntax coloring, or {@code null} if none.
      * By default there is no syntax coloring.
      *
-     * @return The colors for syntax coloring, or {@code null} if none.
+     * @return the colors for syntax coloring, or {@code null} if none.
      */
     public Colors getColors() {
         return colors;
@@ -419,7 +419,7 @@ public class WKTFormat extends CompoundF
      * method tries to highlight most of the elements that are relevant to
      * {@link org.apache.sis.util.Utilities#equalsIgnoreMetadata(Object, Object)}.</p>
      *
-     * @param colors The colors for syntax coloring, or {@code null} if none.
+     * @param  colors  the colors for syntax coloring, or {@code null} if none.
      */
     public void setColors(Colors colors) {
         if (colors != null) {
@@ -433,7 +433,7 @@ public class WKTFormat extends CompoundF
      * Returns the convention for parsing and formatting WKT elements.
      * The default value is {@link Convention#WKT2}.
      *
-     * @return The convention to use for formatting WKT elements (never {@code null}).
+     * @return the convention to use for formatting WKT elements (never {@code null}).
      */
     public Convention getConvention() {
         return convention;
@@ -442,7 +442,7 @@ public class WKTFormat extends CompoundF
     /**
      * Sets the convention for parsing and formatting WKT elements.
      *
-     * @param convention The new convention to use for parsing and formatting WKT elements.
+     * @param  convention  the new convention to use for parsing and formatting WKT elements.
      */
     public void setConvention(final Convention convention) {
         ArgumentChecks.ensureNonNull("convention", convention);
@@ -471,7 +471,7 @@ public class WKTFormat extends CompoundF
      * If no authority has been {@linkplain #setNameAuthority(Citation) explicitly set}, then this
      * method returns the default authority for the current {@linkplain #getConvention() convention}.
      *
-     * @return The organization, standard or project to look for when fetching projection and parameter names.
+     * @return the organization, standard or project to look for when fetching projection and parameter names.
      *
      * @see Formatter#getNameAuthority()
      */
@@ -489,7 +489,7 @@ public class WKTFormat extends CompoundF
      * associated to the {@linkplain #getConvention() convention}. A {@code null} value
      * restore the default behavior.
      *
-     * @param authority The new authority, or {@code null} for inferring it from the convention.
+     * @param  authority  the new authority, or {@code null} for inferring it from the convention.
      *
      * @see Formatter#getNameAuthority()
      */
@@ -530,7 +530,7 @@ public class WKTFormat extends CompoundF
      * Returns the current indentation to be used for formatting objects.
      * The {@value #SINGLE_LINE} value means that the whole WKT is to be formatted on a single line.
      *
-     * @return The current indentation.
+     * @return the current indentation.
      */
     public int getIndentation() {
         return indentation;
@@ -540,7 +540,7 @@ public class WKTFormat extends CompoundF
      * Sets a new indentation to be used for formatting objects.
      * The {@value #SINGLE_LINE} value means that the whole WKT is to be formatted on a single line.
      *
-     * @param indentation The new indentation to use.
+     * @param  indentation  the new indentation to use.
      */
     public void setIndentation(final int indentation) {
         ArgumentChecks.ensureBetween("indentation", SINGLE_LINE, Byte.MAX_VALUE, indentation);
@@ -576,9 +576,9 @@ public class WKTFormat extends CompoundF
      *   <li><code>{@linkplain CoordinateOperationFactory}.class</code></li>
      * </ul>
      *
-     * @param  <T>  The compile-time type of the {@code type} argument.
-     * @param  type The factory type.
-     * @return The factory used by this {@code WKTFormat} for the given type.
+     * @param  <T>   the compile-time type of the {@code type} argument.
+     * @param  type  the factory type.
+     * @return the factory used by this {@code WKTFormat} for the given type.
      * @throws IllegalArgumentException if the {@code type} argument is not one of the valid values.
      */
     public <T extends Factory> T getFactory(final Class<T> type) {
@@ -612,9 +612,9 @@ public class WKTFormat extends CompoundF
      * {@link java.io.Serializable}. The factories used by {@code WKTFormat} instances after deserialization
      * are the default ones.
      *
-     * @param  <T>     The compile-time type of the {@code type} argument.
-     * @param  type    The factory type.
-     * @param  factory The factory to be used by this {@code WKTFormat} for the given type.
+     * @param  <T>      the compile-time type of the {@code type} argument.
+     * @param  type     the factory type.
+     * @param  factory  the factory to be used by this {@code WKTFormat} for the given type.
      * @throws IllegalArgumentException if the {@code type} argument is not one of the valid values.
      */
     public <T extends Factory> void setFactory(final Class<T> type, final T factory) {
@@ -643,7 +643,7 @@ public class WKTFormat extends CompoundF
      * <p>The returned collection is modifiable. In particular, a call to {@link Set#clear()}
      * removes all fragments from this {@code WKTFormat}.</p>
      *
-     * @return The name of all fragments known to this {@code WKTFormat}.
+     * @return the name of all fragments known to this {@code WKTFormat}.
      */
     public Set<String> getFragmentNames() {
         return fragments().keySet();
@@ -670,10 +670,10 @@ public class WKTFormat extends CompoundF
      *
      * For removing a fragment, use <code>{@linkplain #getFragmentNames()}.remove(name)</code>.
      *
-     * @param  name The name to assign to the WKT fragment. Identifiers are case-sensitive.
-     * @param  wkt The Well Know Text (WKT) fragment represented by the given identifier.
+     * @param  name  the name to assign to the WKT fragment. Identifiers are case-sensitive.
+     * @param  wkt   the Well Know Text (WKT) fragment represented by the given identifier.
      * @throws IllegalArgumentException if the name is invalid or if a fragment is already present for that name.
-     * @throws ParseException If an error occurred while parsing the given WKT.
+     * @throws ParseException if an error occurred while parsing the given WKT.
      */
     public void addFragment(final String name, final String wkt) throws IllegalArgumentException, ParseException {
         ArgumentChecks.ensureNonEmpty("wkt", wkt);
@@ -703,10 +703,10 @@ public class WKTFormat extends CompoundF
      * Creates an object from the given character sequence.
      * The parsing begins at the index given by the {@code pos} argument.
      *
-     * @param  wkt The character sequence for the object to parse.
-     * @param  pos The position where to start the parsing.
-     * @return The parsed object.
-     * @throws ParseException If an error occurred while parsing the WKT.
+     * @param  wkt  the character sequence for the object to parse.
+     * @param  pos  the position where to start the parsing.
+     * @return the parsed object.
+     * @throws ParseException if an error occurred while parsing the WKT.
      */
     @Override
     public Object parse(final CharSequence wkt, final ParsePosition pos) throws ParseException {
@@ -767,9 +767,9 @@ public class WKTFormat extends CompoundF
      * {@link org.opengis.metadata.extent.TemporalExtent}
      * and {@link Unit}.
      *
-     * @param  object     The object to format.
-     * @param  toAppendTo Where the text is to be appended.
-     * @throws IOException If an error occurred while writing to {@code toAppendTo}.
+     * @param  object      the object to format.
+     * @param  toAppendTo  where the text is to be appended.
+     * @throws IOException if an error occurred while writing to {@code toAppendTo}.
      *
      * @see FormattableObject#toWKT()
      */
@@ -807,7 +807,7 @@ public class WKTFormat extends CompoundF
             formatter.setBuffer(buffer);
             valid = formatter.appendElement(object) || formatter.appendValue(object);
         } finally {
-            warnings = formatter.getWarnings();  // Must be saved before formatter.clear() is invoked.
+            warnings = formatter.getWarnings();     // Must be saved before formatter.clear() is invoked.
             formatter.setBuffer(null);
             formatter.clear();
         }
@@ -829,8 +829,8 @@ public class WKTFormat extends CompoundF
      * The {@code valueType} can be any types declared in the
      * {@linkplain CompoundFormat#createFormat(Class) parent class}.
      *
-     * @param  valueType The base type of values to parse or format.
-     * @return The format to use for parsing of formatting values of the given type, or {@code null} if none.
+     * @param  valueType  the base type of values to parse or format.
+     * @return the format to use for parsing of formatting values of the given type, or {@code null} if none.
      */
     @Override
     protected Format createFormat(final Class<?> valueType) {
@@ -840,7 +840,11 @@ public class WKTFormat extends CompoundF
         if (valueType == Date.class) {
             return new StandardDateFormat(symbols.getLocale(), getTimeZone());
         }
-        return super.createFormat(valueType);
+        final Format format = super.createFormat(valueType);
+        if (format instanceof UnitFormat) {
+            ((UnitFormat) format).setStyle(UnitFormat.Style.NAME);
+        }
+        return format;
     }
 
     /**
@@ -848,7 +852,7 @@ public class WKTFormat extends CompoundF
      * {@linkplain #format(Object, Appendable) formatting}, returns the warnings. Otherwise returns {@code null}.
      * The warnings are cleared every time a new object is parsed or formatted.
      *
-     * @return The warnings of the last parsing of formatting operation, or {@code null} if none.
+     * @return the warnings of the last parsing of formatting operation, or {@code null} if none.
      *
      * @since 0.6
      */
@@ -863,12 +867,12 @@ public class WKTFormat extends CompoundF
     /**
      * Returns a clone of this format.
      *
-     * @return A clone of this format.
+     * @return a clone of this format.
      */
     @Override
     public WKTFormat clone() {
         final WKTFormat clone = (WKTFormat) super.clone();
-        clone.formatter = null; // Do not share the formatter.
+        clone.formatter = null;                                 // Do not share the formatter.
         clone.parser    = null;
         clone.warnings  = null;
         return clone;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.metadata.iso.content;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Length;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -249,6 +249,8 @@ public class DefaultBand extends Default
      * @return Units in which sensor wavelengths are expressed.
      *
      * @since 0.5
+     *
+     * @see org.apache.sis.measure.Units#NANOMETRE
      */
 /// @XmlElement(name = "boundUnits")
     @UML(identifier="boundUnits", obligation=OPTIONAL, specification=ISO_19115)

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.metadata.iso.content;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,7 @@
 package org.apache.sis.metadata.iso.distribution;
 
 import java.util.Collection;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,7 +19,7 @@ package org.apache.sis.metadata.iso.exte
 import java.util.Date;
 import java.util.List;
 import java.util.ArrayList;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.geometry.Envelope;
 import org.opengis.temporal.TemporalPrimitive;
 import org.opengis.metadata.extent.Extent;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,7 @@
 package org.apache.sis.metadata.iso.quality;
 
 import java.util.List;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.io.wkt;
 
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import org.opengis.util.CodeList;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.metadata.extent.GeographicBoundingBox;
@@ -40,7 +38,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn({ConventionTest.class, SymbolsTest.class, ColorsTest.class})
@@ -90,12 +88,12 @@ public final strictfp class FormatterTes
     @Test
     public void testAppendVerticalExtent() {
         final DefaultVerticalExtent extent = new DefaultVerticalExtent(102, 108, VerticalCRSMock.HEIGHT_ft);
-        assertWktEquals(Convention.WKT2_SIMPLIFIED, "VerticalExtent[102, 108, Unit[“ft”, 0.3048]]", extent);
-        assertWktEquals(Convention.WKT2, "VERTICALEXTENT[102, 108, LENGTHUNIT[“ft”, 0.3048]]", extent);
+        assertWktEquals(Convention.WKT2_SIMPLIFIED, "VerticalExtent[102, 108, Unit[“foot”, 0.3048]]", extent);
+        assertWktEquals(Convention.WKT2, "VERTICALEXTENT[102, 108, LENGTHUNIT[“foot”, 0.3048]]", extent);
 
         extent.setMinimumValue(100.2);
         extent.setMaximumValue(100.8);
-        assertWktEquals(Convention.WKT2, "VERTICALEXTENT[100.2, 100.8, LENGTHUNIT[“ft”, 0.3048]]", extent);
+        assertWktEquals(Convention.WKT2, "VERTICALEXTENT[100.2, 100.8, LENGTHUNIT[“foot”, 0.3048]]", extent);
     }
 
     /**
@@ -103,12 +101,12 @@ public final strictfp class FormatterTes
      */
     @Test
     public void testAppendUnit() {
-        assertWktEquals(Convention.WKT2, "LENGTHUNIT[“metre”, 1]", SI.METRE);
-        assertWktEquals(Convention.WKT2, "ANGLEUNIT[“degree”, 0.017453292519943295]", NonSI.DEGREE_ANGLE);
+        assertWktEquals(Convention.WKT2, "LENGTHUNIT[“metre”, 1]", Units.METRE);
+        assertWktEquals(Convention.WKT2, "ANGLEUNIT[“degree”, 0.017453292519943295]", Units.DEGREE);
         assertWktEquals(Convention.WKT2, "SCALEUNIT[“parts per million”, 1.0E-6]", Units.PPM);
 
-        assertWktEquals(Convention.WKT1, "UNIT[“metre”, 1]", SI.METRE);
-        assertWktEquals(Convention.WKT1, "UNIT[“degree”, 0.017453292519943295]", NonSI.DEGREE_ANGLE);
+        assertWktEquals(Convention.WKT1, "UNIT[“metre”, 1]", Units.METRE);
+        assertWktEquals(Convention.WKT1, "UNIT[“degree”, 0.017453292519943295]", Units.DEGREE);
         assertWktEquals(Convention.WKT1, "UNIT[“parts per million”, 1.0E-6]", Units.PPM);
     }
 

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.metadata;
 
 import java.util.Arrays;
-import javax.measure.unit.SI;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.citation.PresentationForm;
 import org.apache.sis.util.collection.TableColumn;
@@ -31,6 +30,7 @@ import org.apache.sis.metadata.iso.citat
 import org.apache.sis.metadata.iso.content.DefaultAttributeGroup;
 import org.apache.sis.metadata.iso.identification.DefaultDataIdentification;
 import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -70,7 +70,7 @@ public final strictfp class TreeTableFor
         final DefaultBand band = new DefaultBand();
         band.setMinValue(min);
         band.setMaxValue(max);
-        band.setUnits(SI.CENTIMETRE);
+        band.setUnits(Units.CENTIMETRE);
         return band;
     }
 

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,10 +19,9 @@ package org.apache.sis.metadata.iso.exte
 import java.util.List;
 import java.util.Arrays;
 import java.util.Collections;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
-import javax.measure.converter.UnitConverter;
-import javax.measure.converter.ConversionException;
+import javax.measure.Unit;
+import javax.measure.UnitConverter;
+import javax.measure.IncommensurableException;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.apache.sis.measure.Units;
 import org.apache.sis.measure.MeasurementRange;
@@ -44,7 +43,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @DependsOn(DefaultGeographicBoundingBoxTest.class)
@@ -57,11 +56,11 @@ public final strictfp class ExtentsTest
     /**
      * Tests {@link Extents#getVerticalRange(Extent)}.
      *
-     * @throws ConversionException should never happen in this test.
+     * @throws IncommensurableException if a conversion between incompatible units were attempted.
      */
     @Test
     @SuppressWarnings("null")
-    public void testGetVerticalRange() throws ConversionException {
+    public void testGetVerticalRange() throws IncommensurableException {
         final List<DefaultVerticalExtent> extents = Arrays.asList(
                 new DefaultVerticalExtent( -200,  -100, VerticalCRSMock.HEIGHT),
                 new DefaultVerticalExtent(  150,   300, VerticalCRSMock.DEPTH),
@@ -80,7 +79,7 @@ public final strictfp class ExtentsTest
             unit = e.getVerticalCRS().getCoordinateSystem().getAxis(0).getUnit();
             if (Units.isLinear(unit)) break;
         }
-        final UnitConverter c = unit.getConverterToAny(SI.METRE);
+        final UnitConverter c = unit.getConverterToAny(Units.METRE);
         /*
          * The actual test. Arbitrarily compare the heights in metres, converting them if needed.
          */

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -22,8 +22,8 @@ package org.apache.sis.geometry;
  * force installation of the Java2D module (e.g. JavaFX/SWT).
  */
 import java.io.Serializable;
-import javax.measure.unit.Unit;
-import javax.measure.converter.ConversionException;
+import javax.measure.Unit;
+import javax.measure.IncommensurableException;
 import org.opengis.geometry.Envelope;
 import org.opengis.geometry.DirectPosition;
 import org.opengis.geometry.MismatchedDimensionException;
@@ -108,7 +108,7 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 public abstract class AbstractEnvelope implements Envelope, Emptiable {
@@ -486,10 +486,10 @@ public abstract class AbstractEnvelope i
      * @param  unit The unit for the return value.
      * @return The span in terms of the given unit.
      * @throws IndexOutOfBoundsException If the given index is out of bounds.
-     * @throws ConversionException if the length can't be converted to the specified units.
+     * @throws IncommensurableException if the length can't be converted to the specified units.
      */
     public double getSpan(final int dimension, final Unit<?> unit)
-            throws IndexOutOfBoundsException, ConversionException
+            throws IndexOutOfBoundsException, IncommensurableException
     {
         double value = getSpan(dimension);
         final CoordinateSystemAxis axis = getAxis(getCoordinateReferenceSystem(), dimension);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationMethod.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationMethod.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationMethod.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationMethod.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,7 +20,7 @@ import java.util.Map;
 import java.util.Collection;
 import java.util.Collections;
 import javax.xml.bind.annotation.XmlElement;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.util.FactoryException;
 import org.opengis.metadata.Identifier;
 import org.opengis.parameter.GeneralParameterValue;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameter.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameter.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameter.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,14 +18,13 @@ package org.apache.sis.internal.jaxb.ref
 
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlElement;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterDescriptor;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.PropertyType;
 import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.Units;
 import org.apache.sis.parameter.DefaultParameterDescriptor;
 
 
@@ -39,7 +38,7 @@ import org.apache.sis.parameter.DefaultP
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.8
  * @module
  */
 public final class CC_OperationParameter extends PropertyType<CC_OperationParameter, ParameterDescriptor<?>> {
@@ -135,9 +134,9 @@ public final class CC_OperationParameter
                 valueClass = value.getClass();
                 Unit<?> unit = ((ParameterValue<?>) parent).getUnit();
                 if (unit != null) {
-                    unit = unit.toSI();
-                    if (SI.RADIAN.equals(unit)) {
-                        unit = NonSI.DEGREE_ANGLE;
+                    unit = unit.getSystemUnit();
+                    if (Units.RADIAN.equals(unit)) {
+                        unit = Units.DEGREE;
                     }
                     assert (valueClass == Double.class) || (valueClass == double[].class) : valueClass;
                     valueDomain = MeasurementRange.create(Double.NEGATIVE_INFINITY, false,

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,8 +18,9 @@ package org.apache.sis.internal.jaxb.ref
 
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.referencing.datum.Ellipsoid;
+import org.apache.sis.measure.Units;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gml.Measure;
@@ -34,7 +35,7 @@ import org.apache.sis.util.resources.Err
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.8
  * @module
  */
 @XmlRootElement(name = "SecondDefiningParameter", namespace = Namespaces.GML)
@@ -48,7 +49,7 @@ public final class SecondDefiningParamet
     /**
      * The measure, which is either the polar radius or the inverse of the flattening value.
      * We distinguish those two cases by the unit: if the measure is the inverse flattening,
-     * then the unit must be {@link Unit#ONE}.
+     * then the unit must be {@link Units#UNITY}.
      *
      * @see Ellipsoid#getSemiMinorAxis()
      * @see Ellipsoid#getInverseFlattening()
@@ -72,7 +73,7 @@ public final class SecondDefiningParamet
             secondDefiningParameter = new SecondDefiningParameter(ellipsoid, false);
         } else {
             if (ellipsoid.isIvfDefinitive()) {
-                measure = new Measure(ellipsoid.getInverseFlattening(), Unit.ONE);
+                measure = new Measure(ellipsoid.getInverseFlattening(), Units.UNITY);
             } else {
                 measure = new Measure(ellipsoid.getSemiMinorAxis(), ellipsoid.getAxisUnit());
             }
@@ -85,7 +86,7 @@ public final class SecondDefiningParamet
      * @return {@code true} if the measure is the inverse of the flattening value.
      */
     public boolean isIvfDefinitive() {
-        return (measure != null) && Unit.ONE.equals(measure.unit);
+        return (measure != null) && Units.UNITY.equals(measure.unit);
     }
 
     /**
@@ -130,7 +131,7 @@ public final class SecondDefiningParamet
      * @param measure The inverse flattening value.
      */
     public void setInverseFlattening(final Measure measure) {
-        if (measure.setUnit(Unit.ONE)) {
+        if (measure.setUnit(Units.UNITY)) {
             Context.warningOccured(Context.current(), SecondDefiningParameter.class, "setInverseFlattening",
                     Errors.class, Errors.Keys.IncompatiblePropertyValue_1, "uom");
         }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/EPSGParameterDomain.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/EPSGParameterDomain.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/EPSGParameterDomain.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/EPSGParameterDomain.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,7 @@
 package org.apache.sis.internal.referencing;
 
 import java.util.Set;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.apache.sis.measure.NumberRange;
 import org.apache.sis.internal.util.CollectionsExt;
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,8 +19,8 @@ package org.apache.sis.internal.referenc
 import java.util.Map;
 import java.util.Date;
 import java.util.Collections;
-import javax.measure.unit.Unit;
-import javax.measure.quantity.Duration;
+import javax.measure.Unit;
+import javax.measure.quantity.Time;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterNotFoundException;
@@ -60,7 +60,7 @@ import org.apache.sis.referencing.operat
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public class GeodeticObjectBuilder extends Builder<GeodeticObjectBuilder> {
@@ -270,10 +270,10 @@ public class GeodeticObjectBuilder exten
      *   ProjectedCRS crs = builder
      *           .setConversionMethod("Lambert Conic Conformal (1SP)")
      *           .setConversionName("Lambert zone II")
-     *           .setParameter("Latitude of natural origin",             52, NonSI.GRADE)
-     *           .setParameter("Scale factor at natural origin", 0.99987742, Unit.ONE)
-     *           .setParameter("False easting",                      600000, SI.METRE)
-     *           .setParameter("False northing",                    2200000, SI.METRE)
+     *           .setParameter("Latitude of natural origin",             52, Units.GRAD)
+     *           .setParameter("Scale factor at natural origin", 0.99987742, Units.UNITY)
+     *           .setParameter("False easting",                      600000, Units.METRE)
+     *           .setParameter("False northing",                    2200000, Units.METRE)
      *           .addName("NTF (Paris) / Lambert zone II")
      *           .createProjectedCRS(baseCRS, derivedCS);
      * }
@@ -320,7 +320,7 @@ public class GeodeticObjectBuilder exten
      * @return a temporal CRS using the given origin and units.
      * @throws FactoryException if an error occurred while building the temporal CRS.
      */
-    public TemporalCRS createTemporalCRS(final Date origin, final Unit<Duration> unit) throws FactoryException {
+    public TemporalCRS createTemporalCRS(final Date origin, final Unit<Time> unit) throws FactoryException {
         /*
          * Try to use one of the pre-defined datum and coordinate system if possible.
          * This not only saves a little bit of memory, but also provides better names.

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,11 +16,11 @@
  */
 package org.apache.sis.internal.referencing;
 
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Length;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CartesianCS;
+import org.apache.sis.measure.Units;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.referencing.cs.AxisFilter;
 import org.apache.sis.referencing.cs.CoordinateSystems;
@@ -40,7 +40,7 @@ import static org.opengis.referencing.Id
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class Legacy {
@@ -57,9 +57,9 @@ public final class Legacy {
      * the invalid names and directions for WKT 1 parsing/formatting purposes.
      */
     private static final CartesianCS LEGACY = new DefaultCartesianCS(singletonMap(NAME_KEY, "Legacy geocentric"),
-            new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, "X"), "X", AxisDirection.OTHER, SI.METRE),
-            new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, "Y"), "Y", AxisDirection.EAST,  SI.METRE),
-            new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, "Z"), "Z", AxisDirection.NORTH, SI.METRE));
+            new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, "X"), "X", AxisDirection.OTHER, Units.METRE),
+            new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, "Y"), "Y", AxisDirection.EAST,  Units.METRE),
+            new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, "Z"), "Z", AxisDirection.NORTH, Units.METRE));
 
     /**
      * Do not allow instantiation of this class.
@@ -104,7 +104,7 @@ public final class Legacy {
 
     /**
      * Returns the coordinate system of a geocentric CRS using axes in the given unit of measurement.
-     * This method presumes that the given {@code cs} uses {@link SI#METRE} (this is not verified).
+     * This method presumes that the given {@code cs} uses {@link Units#METRE} (this is not verified).
      *
      * @param  cs The coordinate system for which to perform the unit replacement.
      * @param  unit The unit of measurement for the geocentric CRS axes.
@@ -113,7 +113,7 @@ public final class Legacy {
      * @since 0.6
      */
     public static CartesianCS replaceUnit(CartesianCS cs, final Unit<?> unit) {
-        if (unit != null && !unit.equals(SI.METRE)) {
+        if (unit != null && !unit.equals(Units.METRE)) {
             cs = (CartesianCS) CoordinateSystems.replaceLinearUnit(cs, unit.asType(Length.class));
         }
         return cs;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -21,8 +21,7 @@ import java.util.Collections;
 import java.io.ObjectStreamException;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.measure.quantity.Length;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.util.Record;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.quality.PositionalAccuracy;
@@ -104,6 +103,7 @@ public final class PositionalAccuracyCon
     /**
      * Creates an positional accuracy initialized to the given result.
      */
+    @SuppressWarnings("OverridableMethodCallDuringObjectConstruction")                  // Safe because this class is final.
     private PositionalAccuracyConstant(final InternationalString measureDescription,
             final InternationalString evaluationMethodDescription, final boolean pass)
     {
@@ -131,7 +131,7 @@ public final class PositionalAccuracyCon
      *
      * <ul>
      *   <li>If at least one {@link QuantitativeResult} is found with a linear unit, then the largest
-     *       accuracy estimate is converted to {@linkplain SI#METRE metres} and returned.</li>
+     *       accuracy estimate is converted to {@linkplain Units#METRE metres} and returned.</li>
      *   <li>Otherwise, if the operation is a {@link Conversion}, then returns 0 since a conversion
      *       is by definition accurate up to rounding errors.</li>
      *   <li>Otherwise, if the operation is a {@link Transformation}, then checks if the datum shift
@@ -166,7 +166,7 @@ public final class PositionalAccuracyCon
                                 for (final Object value : record.getAttributes().values()) {
                                     if (value instanceof Number) {
                                         double v = ((Number) value).doubleValue();
-                                        v = unitOfLength.getConverterTo(SI.METRE).convert(v);
+                                        v = unitOfLength.getConverterTo(Units.METRE).convert(v);
                                         if (v >= 0 && !(v <= accuracy)) {       // '!' is for replacing the NaN value.
                                             accuracy = v;
                                         }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,7 +19,7 @@ package org.apache.sis.internal.referenc
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Angle;
 import org.opengis.annotation.UML;
 import org.opengis.annotation.Specification;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -22,7 +22,7 @@ import java.util.Iterator;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Locale;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Length;
 
 import org.opengis.util.FactoryException;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,6 +16,9 @@
  */
 package org.apache.sis.internal.referencing;
 
+import javax.measure.Unit;
+import javax.measure.Quantity;
+import javax.measure.quantity.Angle;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.GeneralParameterValue;
@@ -39,6 +42,7 @@ import org.apache.sis.parameter.DefaultP
 import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
+import org.apache.sis.measure.Units;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Vocabulary;
@@ -54,7 +58,7 @@ import org.apache.sis.util.resources.Voc
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class WKTUtilities extends Static {
@@ -67,8 +71,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given coordinate reference system as a formattable object.
      *
-     * @param  object The coordinate reference system, or {@code null}.
-     * @return The given coordinate reference system as a formattable object, or {@code null}.
+     * @param  object  the coordinate reference system, or {@code null}.
+     * @return the given coordinate reference system as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final CoordinateReferenceSystem object) {
         if (object instanceof FormattableObject) {
@@ -81,8 +85,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given coordinate system as a formattable object.
      *
-     * @param  object The coordinate system, or {@code null}.
-     * @return The given coordinate system as a formattable object, or {@code null}.
+     * @param  object  the coordinate system, or {@code null}.
+     * @return the given coordinate system as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final CoordinateSystem object) {
         if (object instanceof FormattableObject) {
@@ -95,8 +99,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given coordinate system axis as a formattable object.
      *
-     * @param  object The coordinate system axis, or {@code null}.
-     * @return The given coordinate system axis as a formattable object, or {@code null}.
+     * @param  object  the coordinate system axis, or {@code null}.
+     * @return the given coordinate system axis as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final CoordinateSystemAxis object) {
         if (object instanceof FormattableObject) {
@@ -109,8 +113,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given datum as a formattable object.
      *
-     * @param  object The datum, or {@code null}.
-     * @return The given datum as a formattable object, or {@code null}.
+     * @param  object  the datum, or {@code null}.
+     * @return the given datum as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final Datum object) {
         if (object instanceof FormattableObject) {
@@ -123,8 +127,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given geodetic datum as a formattable object.
      *
-     * @param  object The datum, or {@code null}.
-     * @return The given datum as a formattable object, or {@code null}.
+     * @param  object  the datum, or {@code null}.
+     * @return the given datum as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final GeodeticDatum object) {
         if (object instanceof FormattableObject) {
@@ -137,8 +141,8 @@ public final class WKTUtilities extends
     /**
      * Returns the ellipsoid as a formattable object.
      *
-     * @param  object The ellipsoid, or {@code null}.
-     * @return The given ellipsoid as a formattable object, or {@code null}.
+     * @param  object  the ellipsoid, or {@code null}.
+     * @return the given ellipsoid as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final Ellipsoid object) {
         if (object instanceof FormattableObject) {
@@ -151,8 +155,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given prime meridian as a formattable object.
      *
-     * @param  object The prime meridian, or {@code null}.
-     * @return The given prime meridian as a formattable object, or {@code null}.
+     * @param  object  the prime meridian, or {@code null}.
+     * @return the given prime meridian as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final PrimeMeridian object) {
         if (object instanceof FormattableObject) {
@@ -163,11 +167,31 @@ public final class WKTUtilities extends
     }
 
     /**
+     * If the given unit is one of the unit that can not be formatted without ambiguity in WKT format,
+     * return a proposed replacement. Otherwise returns {@code unit} unchanged.
+     *
+     * @param  <Q>   the unit dimension.
+     * @param  unit  the unit to test.
+     * @return the replacement to format, or {@code unit} if not needed.
+     *
+     * @since 0.8
+     */
+    @SuppressWarnings("unchecked")
+    public static <Q extends Quantity<Q>> Unit<Q> toFormattable(Unit<Q> unit) {
+        if (Units.isAngular(unit)) {
+            if (!((Unit<Angle>) unit).getConverterTo(Units.RADIAN).isLinear()) {
+                unit = (Unit<Q>) Units.DEGREE;
+            }
+        }
+        return unit;
+    }
+
+    /**
      * Appends the name of the given object to the formatter.
      *
-     * @param object    The object from which to get the name.
-     * @param formatter The formatter where to append the name.
-     * @param type      The key of colors to apply if syntax colors are enabled.
+     * @param  object     the object from which to get the name.
+     * @param  formatter  the formatter where to append the name.
+     * @param  type       the key of colors to apply if syntax colors are enabled.
      */
     public static void appendName(final IdentifiedObject object, final Formatter formatter, final ElementKind type) {
         String name = IdentifiedObjects.getName(object, formatter.getNameAuthority());
@@ -183,8 +207,8 @@ public final class WKTUtilities extends
     /**
      * Appends a {@linkplain ParameterValueGroup group of parameters} in a {@code Param_MT[…]} element.
      *
-     * @param parameters The parameter to append to the WKT, or {@code null} if none.
-     * @param formatter The formatter where to append the parameter.
+     * @param  parameters  the parameter to append to the WKT, or {@code null} if none.
+     * @param  formatter   the formatter where to append the parameter.
      */
     public static void appendParamMT(final ParameterValueGroup parameters, final Formatter formatter) {
         if (parameters != null) {
@@ -198,8 +222,8 @@ public final class WKTUtilities extends
      * If the supplied parameter is actually a {@linkplain ParameterValueGroup parameter group},
      * all contained parameters will be flattened in a single list.
      *
-     * @param parameter The parameter to append to the WKT, or {@code null} if none.
-     * @param formatter The formatter where to append the parameter.
+     * @param  parameter  the parameter to append to the WKT, or {@code null} if none.
+     * @param  formatter  the formatter where to append the parameter.
      */
     public static void append(GeneralParameterValue parameter, final Formatter formatter) {
         if (parameter instanceof ParameterValueGroup) {
@@ -228,9 +252,9 @@ public final class WKTUtilities extends
      * {@code affine}, {@code Cartesian}, {@code cylindrical}, {@code ellipsoidal}, {@code linear},
      * {@code parametric}, {@code polar}, {@code spherical}, {@code temporal} or {@code vertical}.
      *
-     * @param  base The abstract base interface.
-     * @param  type The interface or classes for which to get the WKT type.
-     * @return The WKT type for the given class or interface, or {@code null} if none.
+     * @param  base  the abstract base interface.
+     * @param  type  the interface or classes for which to get the WKT type.
+     * @return the WKT type for the given class or interface, or {@code null} if none.
      *
      * @see ReferencingUtilities#toPropertyName(Class, Class)
      */

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,9 +19,6 @@ package org.apache.sis.internal.referenc
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import javax.xml.bind.annotation.XmlTransient;
 import org.opengis.util.GenericName;
 import org.opengis.parameter.ParameterDescriptor;
@@ -29,6 +26,7 @@ import org.opengis.parameter.ParameterDe
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.measure.Units;
 import org.apache.sis.measure.Latitude;
 import org.apache.sis.measure.Longitude;
 import org.apache.sis.measure.MeasurementRange;
@@ -143,7 +141,7 @@ public abstract class AbstractProvider e
      */
     static ParameterDescriptor<Double> createZeroConstant(final ParameterBuilder builder) {
         final Double zero = +0.0;
-        return builder.createBounded(MeasurementRange.create(-0.0, true, zero, true, NonSI.DEGREE_ANGLE), zero);
+        return builder.createBounded(MeasurementRange.create(-0.0, true, zero, true, Units.DEGREE), zero);
     }
 
     /**
@@ -152,7 +150,7 @@ public abstract class AbstractProvider e
      * where the default value should be the value of another parameter instead than 0°.
      */
     static ParameterDescriptor<Double> createMandatoryLatitude(final ParameterBuilder builder) {
-        return builder.createBounded(Latitude.MIN_VALUE, Latitude.MAX_VALUE, Double.NaN, NonSI.DEGREE_ANGLE);
+        return builder.createBounded(Latitude.MIN_VALUE, Latitude.MAX_VALUE, Double.NaN, Units.DEGREE);
     }
 
     /**
@@ -162,28 +160,28 @@ public abstract class AbstractProvider e
         return builder.createBounded(MeasurementRange.create(
                 Latitude.MIN_VALUE, includePoles,
                 Latitude.MAX_VALUE, includePoles,
-                NonSI.DEGREE_ANGLE), 0.0);
+                Units.DEGREE), 0.0);
     }
 
     /**
      * Creates a descriptor for a longitude parameter in degrees with a default value of 0°.
      */
     static ParameterDescriptor<Double> createLongitude(final ParameterBuilder builder) {
-        return builder.createBounded(Longitude.MIN_VALUE, Longitude.MAX_VALUE, 0.0, NonSI.DEGREE_ANGLE);
+        return builder.createBounded(Longitude.MIN_VALUE, Longitude.MAX_VALUE, 0.0, Units.DEGREE);
     }
 
     /**
      * Creates a descriptor for a scale parameter with a default value of 1.
      */
     static ParameterDescriptor<Double> createScale(final ParameterBuilder builder) {
-        return builder.createStrictlyPositive(1.0, Unit.ONE);
+        return builder.createStrictlyPositive(1.0, Units.UNITY);
     }
 
     /**
      * Creates a false easting, false northing or height parameter in metre with a default value of 0.
      */
     static ParameterDescriptor<Double> createShift(final ParameterBuilder builder) {
-        return builder.create(0.0, SI.METRE);
+        return builder.create(0.0, Units.METRE);
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridCompressed.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridCompressed.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridCompressed.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridCompressed.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,7 @@
 package org.apache.sis.internal.referencing.provider;
 
 import java.util.Arrays;
-import javax.measure.quantity.Quantity;
+import javax.measure.Quantity;
 import org.apache.sis.math.DecimalFunctions;
 
 
@@ -36,7 +36,7 @@ import org.apache.sis.math.DecimalFuncti
  * @version 0.7
  * @module
  */
-final class DatumShiftGridCompressed<C extends Quantity, T extends Quantity> extends DatumShiftGridFile<C,T> {
+final class DatumShiftGridCompressed<C extends Quantity<C>, T extends Quantity<T>> extends DatumShiftGridFile<C,T> {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -86,7 +86,7 @@ final class DatumShiftGridCompressed<C e
      * @param  scale     The factor by which to multiply each compressed value before to add to the average value.
      * @return The grid to use (may or may not be compressed).
      */
-    static <C extends Quantity, T extends Quantity> DatumShiftGridFile<C,T> compress(
+    static <C extends Quantity<C>, T extends Quantity<T>> DatumShiftGridFile<C,T> compress(
             final DatumShiftGridFile.Float<C,T> grid, double[] averages, final double scale)
     {
         final short[][] data = new short[grid.offsets.length][];

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridFile.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridFile.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridFile.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridFile.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -18,8 +18,8 @@ package org.apache.sis.internal.referenc
 
 import java.util.Arrays;
 import java.lang.reflect.Array;
-import javax.measure.unit.Unit;
-import javax.measure.quantity.Quantity;
+import javax.measure.Unit;
+import javax.measure.Quantity;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterDescriptor;
@@ -49,16 +49,16 @@ import org.apache.sis.internal.jdk8.JDK8
  *       from {@code float} to {@code double} performed by the {@link #getCellValue(int, int, int)} method.</li>
  * </ul>
  *
- * @param <C> Dimension of the coordinate unit (usually {@link javax.measure.quantity.Angle}).
- * @param <T> Dimension of the translation unit (usually {@link javax.measure.quantity.Angle}
- *            or {@link javax.measure.quantity.Length}).
+ * @param  <C>  dimension of the coordinate unit (usually {@link javax.measure.quantity.Angle}).
+ * @param  <T>  dimension of the translation unit (usually {@link javax.measure.quantity.Angle}
+ *              or {@link javax.measure.quantity.Length}).
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
-public abstract class DatumShiftGridFile<C extends Quantity, T extends Quantity> extends DatumShiftGrid<C,T> {
+public abstract class DatumShiftGridFile<C extends Quantity<C>, T extends Quantity<T>> extends DatumShiftGrid<C,T> {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -212,7 +212,7 @@ public abstract class DatumShiftGridFile
      * Returns {@code this} casted to the given type, after verification that those types are valid.
      */
     @SuppressWarnings("unchecked")
-    final <NC extends Quantity, NT extends Quantity> DatumShiftGridFile<NC,NT> castTo(
+    final <NC extends Quantity<NC>, NT extends Quantity<NT>> DatumShiftGridFile<NC,NT> castTo(
             final Class<NC> coordinateType, final Class<NT> translationType)
     {
         super.getCoordinateUnit() .asType(coordinateType);
@@ -271,7 +271,7 @@ public abstract class DatumShiftGridFile
      * @version 0.7
      * @module
      */
-    static final class Float<C extends Quantity, T extends Quantity> extends DatumShiftGridFile<C,T> {
+    static final class Float<C extends Quantity<C>, T extends Quantity<T>> extends DatumShiftGridFile<C,T> {
         /**
          * Serial number for inter-operability with different versions.
          */

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -26,8 +26,6 @@ import java.io.BufferedReader;
 import java.io.EOFException;
 import java.io.IOException;
 import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import javax.measure.quantity.Angle;
 import javax.measure.quantity.Length;
 import org.opengis.parameter.ParameterValueGroup;
@@ -45,6 +43,7 @@ import org.apache.sis.internal.system.Da
 import org.apache.sis.internal.referencing.NilReferencingObject;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.parameter.Parameters;
+import org.apache.sis.measure.Units;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.resources.Errors;
@@ -85,7 +84,7 @@ import org.apache.sis.internal.jdk8.JDK8
  * @author  Simon Reynard (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -256,7 +255,7 @@ public class FranceGeocentricInterpolati
             return candidate;
         }
         return DefaultEllipsoid.createEllipsoid(Collections.singletonMap(Ellipsoid.NAME_KEY,
-                NilReferencingObject.UNNAMED), semiMajorAxis, semiMinorAxis, SI.METRE);
+                NilReferencingObject.UNNAMED), semiMajorAxis, semiMinorAxis, Units.METRE);
     }
 
     /**
@@ -418,7 +417,7 @@ public class FranceGeocentricInterpolati
                             nx = JDK8.toIntExact(Math.round((xf - x0) / Δx + 1));
                             ny = JDK8.toIntExact(Math.round((yf - y0) / Δy + 1));
                             grid = new DatumShiftGridFile.Float<>(3,
-                                    NonSI.DEGREE_ANGLE, SI.METRE, false,
+                                    Units.DEGREE, Units.METRE, false,
                                     x0, y0, Δx, Δy, nx, ny, PARAMETERS, file);
                         }
                         break;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,8 +17,6 @@
 package org.apache.sis.internal.referencing.provider;
 
 import java.util.List;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import javax.xml.bind.annotation.XmlTransient;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValueGroup;
@@ -59,7 +57,7 @@ import org.apache.sis.util.logging.Loggi
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -80,42 +78,42 @@ public abstract class GeocentricAffine e
     /**
      * The operation parameter descriptor for the <cite>X-axis translation</cite>
      * ({@linkplain BursaWolfParameters#tX tX}) parameter value. Valid values range
-     * from negative to positive infinity. Units are {@linkplain SI#METRE metres}.
+     * from negative to positive infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> TX;
 
     /**
      * The operation parameter descriptor for the <cite>Y-axis translation</cite>
      * ({@linkplain BursaWolfParameters#tY tY}) parameter value. Valid values range
-     * from negative to positive infinity. Units are {@linkplain SI#METRE metres}.
+     * from negative to positive infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> TY;
 
     /**
      * The operation parameter descriptor for the <cite>Z-axis translation</cite>
      * ({@linkplain BursaWolfParameters#tZ tZ}) parameter value. Valid values range
-     * from negative to positive infinity. Units are {@linkplain SI#METRE metres}.
+     * from negative to positive infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> TZ;
 
     /**
      * The operation parameter descriptor for the <cite>X-axis rotation</cite>
      * ({@linkplain BursaWolfParameters#rX rX}) parameter value.
-     * Units are {@linkplain NonSI#SECOND_ANGLE arc-seconds}.
+     * Units are {@linkplain Units#SECOND_ANGLE arc-seconds}.
      */
     static final ParameterDescriptor<Double> RX;
 
     /**
      * The operation parameter descriptor for the <cite>Y-axis rotation</cite>
      * ({@linkplain BursaWolfParameters#rY rY}) parameter value.
-     * Units are {@linkplain NonSI#SECOND_ANGLE arc-seconds}.
+     * Units are {@linkplain Units#SECOND_ANGLE arc-seconds}.
      */
     static final ParameterDescriptor<Double> RY;
 
     /**
      * The operation parameter descriptor for the <cite>Z-axis rotation</cite>
      * ({@linkplain BursaWolfParameters#rZ rZ}) parameter value.
-     * Units are {@linkplain NonSI#SECOND_ANGLE arc-seconds}.
+     * Units are {@linkplain Units#SECOND_ANGLE arc-seconds}.
      */
     static final ParameterDescriptor<Double> RZ;
 
@@ -141,7 +139,7 @@ public abstract class GeocentricAffine e
      * Convenience method for building the rotation parameters.
      */
     private static ParameterDescriptor<Double> createRotation(final ParameterBuilder builder, final String name, final String alias) {
-        return builder.addName(name).addName(Citations.OGC, alias).createBounded(-180*60*60, 180*60*60, 0, NonSI.SECOND_ANGLE);
+        return builder.addName(name).addName(Citations.OGC, alias).createBounded(-180*60*60, 180*60*60, 0, Units.ARC_SECOND);
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.internal.referencing.provider;
 
 import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.SI;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptor;
@@ -30,6 +29,7 @@ import org.apache.sis.metadata.iso.citat
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.parameter.Parameters;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -40,7 +40,7 @@ import org.apache.sis.parameter.Paramete
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -67,34 +67,34 @@ public abstract class GeocentricAffineBe
 
     /**
      * The operation parameter descriptor for the {@code "src_semi_major"} optional parameter value.
-     * Valid values range from 0 to infinity. Units are {@linkplain SI#METRE metres}.
+     * Valid values range from 0 to infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> SRC_SEMI_MAJOR;
 
     /**
      * The operation parameter descriptor for the {@code "src_semi_minor"} optional parameter value.
-     * Valid values range from 0 to infinity. Units are {@linkplain SI#METRE metres}.
+     * Valid values range from 0 to infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> SRC_SEMI_MINOR;
 
     /**
      * The operation parameter descriptor for the {@code "src_semi_major"} optional parameter value.
-     * Valid values range from 0 to infinity. Units are {@linkplain SI#METRE metres}.
+     * Valid values range from 0 to infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> TGT_SEMI_MAJOR;
 
     /**
      * The operation parameter descriptor for the {@code "src_semi_minor"} optional parameter value.
-     * Valid values range from 0 to infinity. Units are {@linkplain SI#METRE metres}.
+     * Valid values range from 0 to infinity. Units are {@linkplain Units#METRE metres}.
      */
     public static final ParameterDescriptor<Double> TGT_SEMI_MINOR;
 
     static {
         final ParameterBuilder builder = builder().setCodeSpace(Citations.OGC, Constants.OGC);
-        SRC_SEMI_MAJOR = builder.addName("src_semi_major").createStrictlyPositive(Double.NaN, SI.METRE);
-        SRC_SEMI_MINOR = builder.addName("src_semi_minor").createStrictlyPositive(Double.NaN, SI.METRE);
-        TGT_SEMI_MAJOR = builder.addName("tgt_semi_major").createStrictlyPositive(Double.NaN, SI.METRE);
-        TGT_SEMI_MINOR = builder.addName("tgt_semi_minor").createStrictlyPositive(Double.NaN, SI.METRE);
+        SRC_SEMI_MAJOR = builder.addName("src_semi_major").createStrictlyPositive(Double.NaN, Units.METRE);
+        SRC_SEMI_MINOR = builder.addName("src_semi_minor").createStrictlyPositive(Double.NaN, Units.METRE);
+        TGT_SEMI_MAJOR = builder.addName("tgt_semi_major").createStrictlyPositive(Double.NaN, Units.METRE);
+        TGT_SEMI_MINOR = builder.addName("tgt_semi_minor").createStrictlyPositive(Double.NaN, Units.METRE);
         DIMENSION      = builder.addName("dim").setRequired(false).createBounded(Integer.class, 2, 3, null);
     }
 
@@ -146,7 +146,7 @@ public abstract class GeocentricAffineBe
         MathTransform toGeocentric = EllipsoidToCentricTransform.createGeodeticConversion(factory,
                 pv.doubleValue(SRC_SEMI_MAJOR),
                 pv.doubleValue(SRC_SEMI_MINOR),
-                SI.METRE, getSourceDimensions() >= 3,
+                Units.METRE, getSourceDimensions() >= 3,
                 EllipsoidToCentricTransform.TargetType.CARTESIAN);
         /*
          * Create a "Geocentric to Geographic" conversion with ellipsoid axis length units converted to metres
@@ -155,7 +155,7 @@ public abstract class GeocentricAffineBe
         MathTransform toGeographic = EllipsoidToCentricTransform.createGeodeticConversion(factory,
                 pv.doubleValue(TGT_SEMI_MAJOR),
                 pv.doubleValue(TGT_SEMI_MINOR),
-                SI.METRE, getTargetDimensions() >= 3,
+                Units.METRE, getTargetDimensions() >= 3,
                 EllipsoidToCentricTransform.TargetType.CARTESIAN);
         try {
             toGeographic = toGeographic.inverse();

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.internal.referencing.provider;
 
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 import javax.xml.bind.annotation.XmlTransient;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptor;
@@ -29,6 +27,7 @@ import org.apache.sis.parameter.Paramete
 import org.apache.sis.parameter.Parameters;
 import org.apache.sis.referencing.operation.matrix.Matrix4;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -38,7 +37,7 @@ import org.apache.sis.referencing.operat
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -69,9 +68,9 @@ public class GeographicOffsets extends G
     private static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
-        TY = builder.addIdentifier("8601").addName("Latitude offset") .create(0, NonSI.DEGREE_ANGLE);
-        TX = builder.addIdentifier("8602").addName("Longitude offset").create(0, NonSI.DEGREE_ANGLE);
-        TZ = builder.addIdentifier("8603").addName("Vertical Offset") .create(0, SI.METRE);
+        TY = builder.addIdentifier("8601").addName("Latitude offset") .create(0, Units.DEGREE);
+        TX = builder.addIdentifier("8602").addName("Longitude offset").create(0, Units.DEGREE);
+        TZ = builder.addIdentifier("8603").addName("Vertical Offset") .create(0, Units.METRE);
         PARAMETERS = builder.addIdentifier("9660").addName("Geographic3D offsets").createGroup(TY, TX, TZ);
     }
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.internal.referencing.provider;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Length;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValueGroup;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,10 +17,10 @@
 package org.apache.sis.internal.referencing.provider;
 
 import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.Unit;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -28,7 +28,7 @@ import org.apache.sis.parameter.Paramete
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -58,7 +58,7 @@ public final class LambertConformalMichi
         SCALE_FACTOR = builder
                 .addIdentifier("1051")
                 .addName("Ellipsoid scaling factor")
-                .createStrictlyPositive(Double.NaN, Unit.ONE);
+                .createStrictlyPositive(Double.NaN, Units.UNITY);
 
         PARAMETERS = builder
                 .addIdentifier(IDENTIFIER)

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,8 +20,7 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.NoSuchElementException;
 import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.Identifier;
@@ -39,6 +38,7 @@ import org.opengis.referencing.operation
 import org.apache.sis.internal.referencing.Resources;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.Units;
 import org.apache.sis.referencing.NamedIdentifier;
 import org.apache.sis.referencing.operation.projection.NormalizedProjection;
 import org.apache.sis.metadata.iso.citation.Citations;
@@ -91,7 +91,7 @@ public abstract class MapProjection exte
     @Debug
     public static final DefaultParameterDescriptor<Double> ECCENTRICITY;
     static {
-        final MeasurementRange<Double> valueDomain = MeasurementRange.createGreaterThan(0, SI.METRE);
+        final MeasurementRange<Double> valueDomain = MeasurementRange.createGreaterThan(0, Units.METRE);
         final GenericName[] aliases = {
             new NamedIdentifier(Citations.ESRI,    "Semi_Major"),
             new NamedIdentifier(Citations.NETCDF,  "semi_major_axis"),



Mime
View raw message