Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -19,8 +19,7 @@ package org.apache.sis.internal.referenc
import java.util.Map;
import java.util.Collections;
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.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptor;
@@ -37,6 +36,7 @@ import org.apache.sis.referencing.operat
import org.apache.sis.internal.referencing.NilReferencingObject;
import org.apache.sis.internal.referencing.Formulas;
import org.apache.sis.internal.util.Constants;
+import org.apache.sis.measure.Units;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.Debug;
@@ -60,7 +60,7 @@ import org.apache.sis.util.Debug;
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.7
- * @version 0.7
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -74,7 +74,7 @@ public final class Molodensky extends Ge
* The operation parameter descriptor for the <cite>Semi-major axis length difference</cite>
* optional parameter value. This parameter is defined by the EPSG database and can be used
* in replacement of {@link #TGT_SEMI_MAJOR}.
- * Units are {@linkplain SI#METRE metres}.
+ * Units are {@linkplain Units#METRE metres}.
*/
public static final ParameterDescriptor<Double> AXIS_LENGTH_DIFFERENCE;
@@ -82,7 +82,7 @@ public final class Molodensky extends Ge
* The operation parameter descriptor for the <cite>Flattening difference</cite> optional
* parameter value. This parameter is defined by the EPSG database and can be used in
* replacement of {@link #TGT_SEMI_MINOR}.
- * Valid values range from -1 to +1, {@linkplain Unit#ONE dimensionless}.
+ * Valid values range from -1 to +1, {@linkplain Units#UNITY dimensionless}.
*/
public static final ParameterDescriptor<Double> FLATTENING_DIFFERENCE;
@@ -92,8 +92,8 @@ public final class Molodensky extends Ge
public static final ParameterDescriptorGroup PARAMETERS;
static {
final ParameterBuilder builder = builder();
- AXIS_LENGTH_DIFFERENCE = builder.addIdentifier("8654").addName("Semi-major axis length difference").create(Double.NaN, SI.METRE);
- FLATTENING_DIFFERENCE = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Unit.ONE);
+ AXIS_LENGTH_DIFFERENCE = builder.addIdentifier("8654").addName("Semi-major axis length difference").create(Double.NaN, Units.METRE);
+ FLATTENING_DIFFERENCE = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Units.UNITY);
PARAMETERS = builder.setRequired(true)
.addIdentifier("9604")
.addName("Molodensky")
@@ -267,7 +267,7 @@ public final class Molodensky extends Ge
/** Creates a new temporary ellipsoid with explicitely provided Δa and Δf values. */
Ellipsoid(Map<String,?> name, double a, double b, double Δa, double Δf) {
- super(name, a, b, Formulas.getInverseFlattening(a, b), false, SI.METRE);
+ super(name, a, b, Formulas.getInverseFlattening(a, b), false, Units.METRE);
this.Δa = Δa;
this.Δf = Δf;
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NADCON.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NADCON.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NADCON.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NADCON.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -24,7 +24,6 @@ import java.nio.FloatBuffer;
import java.nio.channels.ReadableByteChannel;
import javax.xml.bind.annotation.XmlTransient;
import javax.measure.quantity.Angle;
-import javax.measure.unit.NonSI;
import org.opengis.util.FactoryException;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
@@ -41,6 +40,7 @@ import org.apache.sis.util.CharSequences
import org.apache.sis.util.collection.Cache;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.internal.system.DataDirectory;
+import org.apache.sis.measure.Units;
// Branch-dependent imports
import java.nio.file.Path;
@@ -59,7 +59,7 @@ import java.nio.file.Files;
* @author Martin Desruisseaux (Geomatys)
* @author Rueben Schulz (UBC)
* @since 0.7
- * @version 0.7
+ * @version 0.8
* @module
*
* @see <a href="http://www.ngs.noaa.gov/cgi-bin/nadcon.prl">NADCON on-line computation</a>
@@ -392,7 +392,7 @@ public final class NADCON extends Abstra
if (latitudeShifts == null) {
dim = 1; // Dimension of latitudes.
scale = DEGREES_TO_SECONDS * Δy; // NADCON shifts are positive north.
- grid = new DatumShiftGridFile.Float<>(2, NonSI.DEGREE_ANGLE, NonSI.DEGREE_ANGLE,
+ grid = new DatumShiftGridFile.Float<>(2, Units.DEGREE, Units.DEGREE,
true, x0, y0, Δx, Δy, nx, ny, PARAMETERS, file, longitudeShifts);
grid.accuracy = SECOND_PRECISION / DEGREES_TO_SECONDS;
} else {
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -28,8 +28,7 @@ import java.nio.ByteOrder;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
import javax.measure.quantity.Angle;
import org.opengis.util.FactoryException;
import org.opengis.parameter.ParameterValueGroup;
@@ -49,6 +48,7 @@ import org.apache.sis.util.collection.Ca
import org.apache.sis.util.logging.Logging;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.resources.Messages;
+import org.apache.sis.measure.Units;
// Branch-dependent imports
import java.nio.file.Files;
@@ -64,7 +64,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
@@ -299,13 +299,13 @@ public final class NTv2 extends Abstract
final double precision;
final String name = (String) get("GS_TYPE");
if (name.equalsIgnoreCase("SECONDS")) { // Most common value
- unit = NonSI.SECOND_ANGLE;
+ unit = Units.ARC_SECOND;
precision = SECOND_PRECISION; // Used only as a hint; will not hurt if wrong.
} else if (name.equalsIgnoreCase("MINUTES")) {
- unit = NonSI.MINUTE_ANGLE;
+ unit = Units.ARC_MINUTE;
precision = SECOND_PRECISION / 60; // Used only as a hint; will not hurt if wrong.
} else if (name.equalsIgnoreCase("DEGREES")) {
- unit = NonSI.DEGREE_ANGLE;
+ unit = Units.DEGREE;
precision = SECOND_PRECISION / DEGREES_TO_SECONDS; // Used only as a hint; will not hurt if wrong.
} else {
throw new FactoryException(Errors.format(Errors.Keys.UnexpectedValueInElement_2, "GS_TYPE", name));
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicNorth.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicNorth.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicNorth.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicNorth.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -17,7 +17,6 @@
package org.apache.sis.internal.referencing.provider;
import java.util.List;
-import javax.measure.unit.NonSI;
import javax.xml.bind.annotation.XmlTransient;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
@@ -25,6 +24,7 @@ import org.opengis.parameter.GeneralPara
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.parameter.ParameterBuilder;
import org.apache.sis.measure.Latitude;
+import org.apache.sis.measure.Units;
/**
@@ -33,7 +33,7 @@ import org.apache.sis.measure.Latitude;
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -56,7 +56,7 @@ public final class PolarStereographicNor
// Replace the "Standard Parallel" parameter from [-90 … 0]° domain to [0 … 90]° domain.
final ParameterBuilder builder = builder();
parameters[0] = builder.addNamesAndIdentifiers(parameters[0]).createBounded(
- 0, Latitude.MAX_VALUE, Latitude.MAX_VALUE, NonSI.DEGREE_ANGLE);
+ 0, Latitude.MAX_VALUE, Latitude.MAX_VALUE, Units.DEGREE);
PARAMETERS = builder
.addName(Citations.ESRI, "Stereographic_North_Pole")
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -16,7 +16,6 @@
*/
package org.apache.sis.internal.referencing.provider;
-import javax.measure.unit.NonSI;
import javax.xml.bind.annotation.XmlTransient;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
@@ -25,6 +24,7 @@ import org.apache.sis.parameter.Paramete
import org.apache.sis.parameter.DefaultParameterDescriptor;
import org.apache.sis.measure.Latitude;
import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.Units;
/**
@@ -33,7 +33,7 @@ import org.apache.sis.measure.Measuremen
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -66,7 +66,7 @@ public final class PolarStereographicSou
final ParameterBuilder builder = builder();
final ParameterDescriptor<?>[] parameters = {
alternativeAuthority(PolarStereographicB.STANDARD_PARALLEL, Citations.ESRI, builder)
- .createBounded(Latitude.MIN_VALUE, 0, Latitude.MIN_VALUE, NonSI.DEGREE_ANGLE),
+ .createBounded(Latitude.MIN_VALUE, 0, Latitude.MIN_VALUE, Units.DEGREE),
forESRI(PolarStereographicB.LONGITUDE_OF_ORIGIN, builder),
PolarStereographicB.SCALE_FACTOR, // Not formally a parameter of this projection.
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -16,9 +16,6 @@
*/
package org.apache.sis.internal.referencing.provider;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
import javax.xml.bind.annotation.XmlTransient;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
@@ -30,6 +27,7 @@ import org.apache.sis.metadata.iso.citat
import org.apache.sis.referencing.operation.projection.NormalizedProjection;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.math.MathFunctions;
+import org.apache.sis.measure.Units;
/**
@@ -38,7 +36,7 @@ import org.apache.sis.math.MathFunctions
* @author Martin Desruisseaux (MPO, IRD, Geomatys)
* @author Rueben Schulz (UBC)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*
* @see <a href="http://www.remotesensing.org/geotiff/proj_list/transverse_mercator.html">Transverse Mercator on RemoteSensing.org</a>
@@ -176,11 +174,11 @@ public final class TransverseMercator ex
if (zone != 0) {
name = "UTM zone " + zone + (isSouth ? 'S' : 'N');
}
- group.parameter(Constants.LATITUDE_OF_ORIGIN).setValue(latitude, NonSI.DEGREE_ANGLE);
- group.parameter(Constants.CENTRAL_MERIDIAN) .setValue(longitude, NonSI.DEGREE_ANGLE);
- group.parameter(Constants.SCALE_FACTOR) .setValue(0.9996, Unit.ONE);
- group.parameter(Constants.FALSE_EASTING) .setValue(500000, SI.METRE);
- group.parameter(Constants.FALSE_NORTHING) .setValue(isSouth ? 10000000 : 0, SI.METRE);
+ group.parameter(Constants.LATITUDE_OF_ORIGIN).setValue(latitude, Units.DEGREE);
+ group.parameter(Constants.CENTRAL_MERIDIAN) .setValue(longitude, Units.DEGREE);
+ group.parameter(Constants.SCALE_FACTOR) .setValue(0.9996, Units.UNITY);
+ group.parameter(Constants.FALSE_EASTING) .setValue(500000, Units.METRE);
+ group.parameter(Constants.FALSE_NORTHING) .setValue(isSouth ? 10000000 : 0, Units.METRE);
return name;
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -21,7 +21,7 @@ import java.util.Set;
import java.util.Map;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import org.opengis.util.CodeList;
import org.opengis.parameter.ParameterValue;
import org.opengis.parameter.ParameterDescriptor;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -66,11 +66,11 @@ import static org.apache.sis.util.Utilit
* ParameterBuilder builder = new ParameterBuilder();
* builder.setCodeSpace(Citations.EPSG, "EPSG").setRequired(true);
* ParameterDescriptor<?>[] parameters = {
- * builder.addName("Latitude of natural origin") .createBounded( -80, +84, 0, NonSI.DEGREE_ANGLE),
- * builder.addName("Longitude of natural origin") .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE),
- * builder.addName("Scale factor at natural origin").createStrictlyPositive(1, Unit.ONE),
- * builder.addName("False easting") .create(0, SI.METRE),
- * builder.addName("False northing") .create(0, SI.METRE)
+ * builder.addName("Latitude of natural origin") .createBounded( -80, +84, 0, Units.DEGREE),
+ * builder.addName("Longitude of natural origin") .createBounded(-180, +180, 0, Units.DEGREE),
+ * builder.addName("Scale factor at natural origin").createStrictlyPositive(1, Units.UNITY),
+ * builder.addName("False easting") .create(0, Units.METRE),
+ * builder.addName("False northing") .create(0, Units.METRE)
* };
* builder.addIdentifier("9804") // Primary key in EPSG database.
* .addName("Mercator (variant A)") // EPSG name since October 2010.
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -16,6 +16,8 @@
*/
package org.apache.sis.parameter;
+import java.util.Objects;
+import java.nio.file.Path;
import java.io.Serializable;
import java.io.File;
import java.net.URL;
@@ -25,9 +27,9 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
-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.citation.Citation;
import org.opengis.parameter.ParameterValue;
import org.opengis.parameter.ParameterDescriptor;
@@ -43,7 +45,6 @@ import org.apache.sis.internal.referenci
import org.apache.sis.internal.referencing.WKTUtilities;
import org.apache.sis.internal.metadata.MetadataUtilities;
import org.apache.sis.internal.metadata.WKTKeywords;
-import org.apache.sis.internal.util.PatchedUnitFormat;
import org.apache.sis.internal.util.Numerics;
import org.apache.sis.internal.system.Loggers;
import org.apache.sis.util.Numbers;
@@ -57,10 +58,6 @@ import org.apache.sis.util.Unconvertible
import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
import static org.apache.sis.util.Utilities.deepEquals;
-// Branch-dependent imports
-import java.util.Objects;
-import java.nio.file.Path;
-
/**
* A single parameter value used by an operation method. {@code ParameterValue} instances are elements in
@@ -117,7 +114,7 @@ import java.nio.file.Path;
* Consequently, the above-cited methods provide single points that subclasses can override
* for modifying the behavior of all getter and setter methods.
*
- * @param <T> The type of the value stored in this parameter.
+ * @param <T> the type of the value stored in this parameter.
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4
@@ -172,7 +169,7 @@ public class DefaultParameterValue<T> ex
* Creates a parameter value from the specified descriptor.
* The value will be initialized to the default value, if any.
*
- * @param descriptor The abstract definition of this parameter.
+ * @param descriptor the abstract definition of this parameter.
*/
public DefaultParameterValue(final ParameterDescriptor<T> descriptor) {
ensureNonNull("descriptor", descriptor);
@@ -186,7 +183,7 @@ public class DefaultParameterValue<T> ex
* This is a <em>shallow</em> copy constructor, since the value contained in the given
* object is not cloned.
*
- * @param parameter The parameter to copy values from.
+ * @param parameter the parameter to copy values from.
*
* @see #clone()
* @see #unmodifiable(ParameterValue)
@@ -201,7 +198,7 @@ public class DefaultParameterValue<T> ex
/**
* Returns the definition of this parameter.
*
- * @return The definition of this parameter.
+ * @return the definition of this parameter.
*/
@Override
@XmlElement(name = "operationParameter", required = true)
@@ -218,7 +215,7 @@ public class DefaultParameterValue<T> ex
* All getter methods which need unit information will invoke this {@code getUnit()} method.
* Subclasses can override this method if they need to compute the unit dynamically.
*
- * @return The unit of measure, or {@code null} if none.
+ * @return the unit of measure, or {@code null} if none.
*
* @see #doubleValue()
* @see #doubleValueList()
@@ -238,7 +235,7 @@ public class DefaultParameterValue<T> ex
* All getter methods will invoke this {@code getValue()} method.
* Subclasses can override this method if they need to compute the value dynamically.
*
- * @return The parameter value as an object, or {@code null} if no value has been set
+ * @return the parameter value as an object, or {@code null} if no value has been set
* and there is no default value.
*
* @see #setValue(Object)
@@ -256,7 +253,7 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation invokes {@link #getValue()} and casts the result if possible,
* or throws an exception otherwise.</p>
*
- * @return The boolean value represented by this parameter.
+ * @return the boolean value represented by this parameter.
* @throws InvalidParameterTypeException if the value is not a boolean type.
* @throws IllegalStateException if the value is not defined and there is no default value.
*
@@ -279,7 +276,7 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation invokes {@link #getValue()} and casts the result if possible,
* or throws an exception otherwise.</p>
*
- * @return The numeric value represented by this parameter after conversion to type {@code int}.
+ * @return the numeric value represented by this parameter after conversion to type {@code int}.
* @throws InvalidParameterTypeException if the value is not an integer type.
* @throws IllegalStateException if the value is not defined and there is no default value.
*
@@ -306,7 +303,7 @@ public class DefaultParameterValue<T> ex
* or throws an exception otherwise. If the value can be casted, then the array is cloned before
* to be returned.</p>
*
- * @return A copy of the sequence of values represented by this parameter.
+ * @return a copy of the sequence of values represented by this parameter.
* @throws InvalidParameterTypeException if the value is not an array of {@code int}s.
* @throws IllegalStateException if the value is not defined and there is no default value.
*
@@ -330,7 +327,7 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation invokes {@link #getValue()} and casts the result if possible,
* or throws an exception otherwise.</p>
*
- * @return The numeric value represented by this parameter after conversion to type {@code double}.
+ * @return the numeric value represented by this parameter after conversion to type {@code double}.
* This method returns {@link Double#NaN} only if such "value" has been explicitely set.
* @throws InvalidParameterTypeException if the value is not a numeric type.
* @throws IllegalStateException if the value is not defined and there is no default value.
@@ -357,7 +354,7 @@ public class DefaultParameterValue<T> ex
* or throws an exception otherwise. If the value can be casted, then the array is cloned before
* to be returned.</p>
*
- * @return A copy of the sequence of values represented by this parameter.
+ * @return a copy of the sequence of values represented by this parameter.
* @throws InvalidParameterTypeException if the value is not an array of {@code double}s.
* @throws IllegalStateException if the value is not defined and there is no default value.
*
@@ -389,7 +386,7 @@ public class DefaultParameterValue<T> ex
}
try {
return source.getConverterToAny(unit);
- } catch (ConversionException e) {
+ } catch (IncommensurableException e) {
throw new IllegalArgumentException(Errors.format(Errors.Keys.IncompatibleUnits_2, source, unit), e);
}
}
@@ -401,8 +398,8 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation invokes {@link #doubleValue()} and {@link #getUnit()},
* then converts the values to the given unit of measurement.</p>
*
- * @param unit The unit of measure for the value to be returned.
- * @return The numeric value represented by this parameter after conversion to type
+ * @param unit the unit of measure for the value to be returned.
+ * @return the numeric value represented by this parameter after conversion to type
* {@code double} and conversion to {@code unit}.
* @throws IllegalArgumentException if the specified unit is invalid for this parameter.
* @throws InvalidParameterTypeException if the value is not a numeric type.
@@ -426,7 +423,7 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation invokes {@link #doubleValueList()} and {@link #getUnit()},
* then converts the values to the given unit of measurement.</p>
*
- * @param unit The unit of measure for the value to be returned.
+ * @param unit the unit of measure for the value to be returned.
* @return The sequence of values represented by this parameter after conversion to type
* {@code double} and conversion to {@code unit}.
* @throws IllegalArgumentException if the specified unit is invalid for this parameter.
@@ -452,7 +449,7 @@ public class DefaultParameterValue<T> ex
* Returns the string value of this parameter.
* A string value does not have an associated unit of measure.
*
- * @return The string value represented by this parameter.
+ * @return the string value represented by this parameter.
* @throws InvalidParameterTypeException if the value is not a string.
* @throws IllegalStateException if the value is not defined and there is no default value.
*
@@ -474,7 +471,7 @@ public class DefaultParameterValue<T> ex
* The default implementation can convert the following value types:
* {@link URI}, {@link URL}, {@link Path}, {@link File}.
*
- * @return The reference to a file containing parameter values.
+ * @return the reference to a file containing parameter values.
* @throws InvalidParameterTypeException if the value is not a reference to a file or an URI.
* @throws IllegalStateException if the value is not defined and there is no default value.
*
@@ -558,7 +555,7 @@ public class DefaultParameterValue<T> ex
* This implementation does not clone the given value. In particular, references to {@code int[]}
* and {@code double[]} arrays are stored <cite>as-is</cite>.</p>
*
- * @param value The parameter value, or {@code null} to restore the default.
+ * @param value the parameter value, or {@code null} to restore the default.
* @throws InvalidParameterValueException if the type of {@code value} is inappropriate for this parameter,
* or if the value is illegal for some other reason (for example the value is numeric and out of range).
*
@@ -592,7 +589,7 @@ public class DefaultParameterValue<T> ex
*
* <p>The default implementation delegates to {@link #setValue(Object, Unit)}.</p>
*
- * @param value The parameter value.
+ * @param value the parameter value.
* @throws InvalidParameterValueException if the boolean type is inappropriate for this parameter.
*
* @see #booleanValue()
@@ -610,7 +607,7 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation wraps the given integer in an object of the type specified by the
* {@linkplain #getDescriptor() descriptor}, then delegates to {@link #setValue(Object, Unit)}.</p>
*
- * @param value The parameter value.
+ * @param value the parameter value.
* @throws InvalidParameterValueException if the integer type is inappropriate for this parameter,
* or if the value is illegal for some other reason (for example a value out of range).
*
@@ -635,7 +632,7 @@ public class DefaultParameterValue<T> ex
/**
* Wraps the given value in a type compatible with the expected value class, if possible.
*
- * @throws IllegalArgumentException If the given value can not be converted to the given type.
+ * @throws IllegalArgumentException if the given value can not be converted to the given type.
*/
@SuppressWarnings("unchecked")
private static Number wrap(final double value, final Class<?> valueClass) throws IllegalArgumentException {
@@ -652,10 +649,9 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation wraps the given number in an object of the type specified by the
* {@linkplain #getDescriptor() descriptor}, then delegates to {@link #setValue(Object, Unit)}.</p>
*
- * @param value The parameter value.
- * @throws InvalidParameterValueException if the floating point type is inappropriate for this
- * parameter, or if the value is illegal for some other reason (for example a value out
- * of range).
+ * @param value the parameter value.
+ * @throws InvalidParameterValueException if the floating point type is inappropriate for this parameter,
+ * or if the value is illegal for some other reason (for example a value out of range).
*
* @see #setValue(double,Unit)
* @see #doubleValue()
@@ -677,8 +673,8 @@ public class DefaultParameterValue<T> ex
* <p>The default implementation wraps the given number in an object of the type specified by the
* {@linkplain #getDescriptor() descriptor}, then delegates to {@link #setValue(Object, Unit)}.</p>
*
- * @param value The parameter value.
- * @param unit The unit for the specified value.
+ * @param value the parameter value.
+ * @param unit the unit for the specified value.
* @throws InvalidParameterValueException if the floating point type is inappropriate for this parameter,
* or if the value is illegal for some other reason (for example a value out of range).
*
@@ -702,8 +698,8 @@ public class DefaultParameterValue<T> ex
*
* <p>The default implementation delegates to {@link #setValue(Object, Unit)}.</p>
*
- * @param values The parameter values.
- * @param unit The unit for the specified value.
+ * @param values the parameter values.
+ * @param unit the unit for the specified value.
* @throws InvalidParameterValueException if the floating point array type is inappropriate for this parameter,
* or if the value is illegal for some other reason (for example a value out of range).
*/
@@ -725,8 +721,8 @@ public class DefaultParameterValue<T> ex
* subclasses can override if they want to perform more processing on the value before its storage,
* or to be notified about value changes.
*
- * @param value The parameter value, or {@code null} to restore the default.
- * @param unit The unit associated to the new parameter value, or {@code null}.
+ * @param value the parameter value, or {@code null} to restore the default.
+ * @param unit the unit associated to the new parameter value, or {@code null}.
* @throws InvalidParameterValueException if the type of {@code value} is inappropriate for this parameter,
* or if the value is illegal for some other reason (for example the value is numeric and out of range).
*
@@ -760,8 +756,8 @@ public class DefaultParameterValue<T> ex
* {@linkplain DefaultParameterDescriptor#getValidValues() valid values} are performed
* before this method is invoked. The default implementation of this method does nothing.
*
- * @param value The value converted to the unit of measurement specified by the descriptor.
- * @throws InvalidParameterValueException If the given value is invalid for implementation-specific reasons.
+ * @param value the value converted to the unit of measurement specified by the descriptor.
+ * @throws InvalidParameterValueException if the given value is invalid for implementation-specific reasons.
*/
protected void validate(final T value) throws InvalidParameterValueException {
}
@@ -770,8 +766,8 @@ public class DefaultParameterValue<T> ex
* Compares the specified object with this parameter for equality.
* The strictness level is controlled by the second argument.
*
- * @param object The object to compare to {@code this}.
- * @param mode The strictness level of the comparison.
+ * @param object the object to compare to {@code this}.
+ * @param mode the strictness level of the comparison.
* @return {@code true} if both objects are equal according the given comparison mode.
*/
@Override
@@ -808,7 +804,7 @@ public class DefaultParameterValue<T> ex
*
* Subclasses shall override {@link #equals(Object, ComparisonMode)} instead than this method.
*
- * @param object The object to compare to {@code this}.
+ * @param object the object to compare to {@code this}.
* @return {@code true} if both objects are equal.
*/
@Override
@@ -818,9 +814,9 @@ public class DefaultParameterValue<T> ex
/**
* Returns a hash value for this parameter.
+ * This value does not need to be the same in past or future versions of this class.
*
- * @return The hash code value. This value doesn't need to be the same
- * in past or future versions of this class.
+ * @return the hash code value.
*/
@Override
public int hashCode() {
@@ -842,7 +838,7 @@ public class DefaultParameterValue<T> ex
try {
return (DefaultParameterValue<T>) super.clone();
} catch (CloneNotSupportedException exception) {
- throw new AssertionError(exception); // Should not happen, since we are cloneable
+ throw new AssertionError(exception); // Should not happen, since we are cloneable
}
}
@@ -871,9 +867,9 @@ public class DefaultParameterValue<T> ex
* Transverse Mercator</cite> (UTM) projections use the same scale factor (0.9996) and false easting (500000 metres).
* </div>
*
- * @param <T> The type of the value stored in the given parameter.
- * @param parameter The parameter to make unmodifiable, or {@code null}.
- * @return An unmodifiable implementation of the given parameter, or {@code null} if the given parameter was null.
+ * @param <T> the type of the value stored in the given parameter.
+ * @param parameter the parameter to make unmodifiable, or {@code null}.
+ * @return a unmodifiable implementation of the given parameter, or {@code null} if the given parameter was null.
*
* @since 0.6
*
@@ -914,7 +910,7 @@ public class DefaultParameterValue<T> ex
* PARAMETER[“scale_factor”, 0.99987742],
* PARAMETER[“false_easting”, 600.0], // In kilometres
* PARAMETER[“false_northing”, 2200.0], // In kilometres
- * UNIT[“km”, 1000]] // Unit for all lengths
+ * UNIT[“kilometre”, 1000]] // Unit for all lengths
* }
*
* <p><b>WKT 2:</b></p>
@@ -922,18 +918,18 @@ public class DefaultParameterValue<T> ex
* ProjectedCRS[…
* BaseGeodCRS[…
* AngleUnit[“grad”, 0.015707963267948967]],
- * Conversion["Lambert zone II",
- * Method["Lambert Conic Conformal (1SP)"],
- * Parameter["Latitude of natural origin", 52.0],
- * Parameter["Scale factor at natural origin", 0.99987742],
- * Parameter["False easting", 600.0],
- * Parameter["False northing", 2200.0]],
- * CS["Cartesian", 2],
- * LengthUnit["km", 1000]]
+ * Conversion[“Lambert zone II”,
+ * Method[“Lambert Conic Conformal (1SP)”],
+ * Parameter[“Latitude of natural origin”, 52.0],
+ * Parameter[“Scale factor at natural origin”, 0.99987742],
+ * Parameter[“False easting”, 600.0],
+ * Parameter[“False northing”, 2200.0]],
+ * CS[“Cartesian”, 2],
+ * LengthUnit[“kilometre”, 1000]]
* }
* </div>
*
- * @param formatter The formatter where to format the inner content of this WKT element.
+ * @param formatter the formatter where to format the inner content of this WKT element.
* @return {@code "Parameter"} or {@code "ParameterFile"}.
*
* @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#119">WKT 2 specification §17.2.4</a>
@@ -974,7 +970,7 @@ public class DefaultParameterValue<T> ex
ignoreUnits = true;
} else {
if (convention != Convention.INTERNAL) {
- unit = PatchedUnitFormat.toFormattable(unit);
+ unit = WKTUtilities.toFormattable(unit);
}
ignoreUnits = unit.equals(contextualUnit);
}
@@ -1092,7 +1088,7 @@ public class DefaultParameterValue<T> ex
@XmlElement(name = "valueList", type = MeasureList.class)
})
private Object getXmlValue() {
- final Object value = getValue(); // Give to user a chance to override.
+ final Object value = getValue(); // Give to user a chance to override.
if (value != null) {
if (value instanceof Number) {
final Number n = (Number) value;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -79,8 +79,8 @@ import java.util.Objects;
*
* {@preformat java
* ParameterValueGroup mercator = Mercator.PARAMETERS.createValue();
- * mercator.parameter("Longitude of natural origin").setValue(-60, NonSI.DEGREE_ANGLE); // 60°W
- * mercator.parameter("Latitude of natural origin") .setValue( 40, NonSI.DEGREE_ANGLE); // 40°N
+ * mercator.parameter("Longitude of natural origin").setValue(-60, Units.DEGREE); // 60°W
+ * mercator.parameter("Latitude of natural origin") .setValue( 40, Units.DEGREE); // 40°N
* // Keep default values for other parameters.
* }
* </div>
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -18,8 +18,7 @@ package org.apache.sis.parameter;
import java.util.Collections;
import java.util.Map;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import org.opengis.parameter.ParameterValue;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterNotFoundException;
@@ -27,6 +26,7 @@ import org.apache.sis.referencing.NamedI
import org.apache.sis.internal.referencing.Formulas;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.Units;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.ArraysExt;
@@ -44,7 +44,7 @@ import java.util.Objects;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*/
final class MapProjectionParameters extends DefaultParameterValueGroup {
@@ -170,7 +170,7 @@ final class MapProjectionParameters exte
*/
static final ParameterDescriptor<Double> DESCRIPTOR = new DefaultParameterDescriptor<>(
InverseFlattening.toMap(Constants.EARTH_RADIUS), 0, 1, Double.class,
- MeasurementRange.createGreaterThan(0.0, SI.METRE), null, null);
+ MeasurementRange.createGreaterThan(0.0, Units.METRE), null, null);
/**
* The parameters for the semi-major and semi-minor axis length.
@@ -254,7 +254,7 @@ final class MapProjectionParameters exte
*/
static final ParameterDescriptor<Double> DESCRIPTOR = new DefaultParameterDescriptor<>(
toMap(Constants.INVERSE_FLATTENING), 0, 1, Double.class,
- MeasurementRange.createGreaterThan(0.0, Unit.ONE), null, null);
+ MeasurementRange.createGreaterThan(0.0, Units.UNITY), null, null);
/**
* Helper method for {@link #DESCRIPTOR} constructions.
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -16,7 +16,7 @@
*/
package org.apache.sis.parameter;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.GeneralParameterDescriptor;
@@ -73,22 +73,22 @@ import static org.apache.sis.util.Argume
* // Constructs the list of parameters.
* ParameterDescriptor<?>[] parameters = {
* builder.addName("Latitude of natural origin") // Name in the default namespace ("EPSG" in this example).
- * .createBounded( -80, +84, 0, NonSI.DEGREE_ANGLE), // Latitude of Mercator projection can not go to the poles.
+ * .createBounded( -80, +84, 0, Units.DEGREE), // Latitude of Mercator projection can not go to the poles.
*
* builder.addIdentifier("8802") // Primary key in default namespace ("EPSG" in this example).
* .addName("Longitude of natural origin") // Primary name in default namespace ("EPSG" in this example).
* .addName(Citations.OGC, "central_meridian") // First alias in "OGC" namespace.
* .addName(Citations.GEOTIFF, "NatOriginLong") // Second alias in "GeoTIFF" namespace.
- * .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE), // Projection is valid on all the longitude range (±180°).
+ * .createBounded(-180, +180, 0, Units.DEGREE), // Projection is valid on all the longitude range (±180°).
*
* builder.addName("Scale factor at natural origin")
- * .createStrictlyPositive(1, Unit.ONE),
+ * .createStrictlyPositive(1, Units.UNITY),
*
* builder.addName("False easting")
- * .create(0, SI.METRE),
+ * .create(0, Units.METRE),
*
* builder.addName("False northing")
- * .create(0, SI.METRE)
+ * .create(0, Units.METRE)
* };
*
* // Put all above parameters in a group.
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -33,7 +33,7 @@ import java.text.ParsePosition;
import java.text.ParseException;
import java.io.Console;
import java.util.concurrent.atomic.AtomicReference;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import org.opengis.parameter.*;
import org.opengis.util.ScopedName;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -29,7 +29,7 @@ import java.lang.reflect.Array;
import java.io.IOException;
import java.text.Format;
import java.text.FieldPosition;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.metadata.Identifier;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -21,7 +21,7 @@ import java.util.HashMap;
import java.util.List;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import org.opengis.util.MemberName;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/UnmodifiableParameterValue.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/UnmodifiableParameterValue.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/UnmodifiableParameterValue.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/UnmodifiableParameterValue.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -16,7 +16,7 @@
*/
package org.apache.sis.parameter;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import javax.xml.bind.annotation.XmlTransient;
import org.opengis.parameter.ParameterValue;
import org.apache.sis.internal.util.Cloner;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -21,9 +21,9 @@ import java.util.Set;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.lang.reflect.Array;
-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.Identifier;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.GeneralParameterDescriptor;
@@ -151,7 +151,7 @@ final class Verifier {
*/
try {
converter = unit.getConverterToAny(def);
- } catch (ConversionException e) {
+ } catch (IncommensurableException e) {
throw new IllegalArgumentException(Errors.format(Errors.Keys.IncompatibleUnits_2, unit, def), e);
}
Class<?> componentType = valueClass.getComponentType();
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -73,8 +73,8 @@
*
* {@preformat java
* ParameterValueGroup group = Mercator.PARAMETERS.createValue();
- * group.parameter("Longitude of natural origin").setValue(-60); // Using default units (e.g. degrees).
- * group.parameter("False easting").setValue(200.0, SI.KILOMETRE); // Using explicit units.
+ * group.parameter("Longitude of natural origin").setValue(-60); // Using default units (e.g. degrees).
+ * group.parameter("False easting").setValue(200.0, Units.KILOMETRE); // Using explicit units.
* }
* </div>
*
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -20,7 +20,6 @@ import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
-import javax.measure.unit.NonSI;
import org.opengis.util.FactoryException;
import org.opengis.geometry.Envelope;
import org.opengis.referencing.NoSuchAuthorityCodeException;
@@ -46,6 +45,7 @@ import org.opengis.metadata.extent.Exten
import org.opengis.metadata.extent.GeographicBoundingBox;
import org.opengis.referencing.operation.CoordinateOperation;
import org.opengis.referencing.operation.TransformException;
+import org.apache.sis.measure.Units;
import org.apache.sis.geometry.Envelopes;
import org.apache.sis.geometry.GeneralEnvelope;
import org.apache.sis.internal.metadata.AxisDirections;
@@ -770,7 +770,7 @@ check: while (lower != 0 || upper != di
*/
public static double getGreenwichLongitude(final GeodeticCRS crs) {
ArgumentChecks.ensureNonNull("crs", crs);
- return ReferencingUtilities.getGreenwichLongitude(crs.getDatum().getPrimeMeridian(), NonSI.DEGREE_ANGLE);
+ return ReferencingUtilities.getGreenwichLongitude(crs.getDatum().getPrimeMeridian(), Units.DEGREE);
}
/**
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -22,10 +22,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.LogRecord;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-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.util.InternationalString;
import org.opengis.referencing.IdentifiedObject;
@@ -128,7 +126,7 @@ import org.apache.sis.internal.jdk8.JDK8
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*
* @see org.apache.sis.referencing.factory.CommonAuthorityFactory
@@ -148,7 +146,7 @@ public enum CommonCRS {
* <tr><th>Semi-major axis length:</th> <td>6378137</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6356752 <i>(approximative)</i></td></tr>
* <tr><th>Inverse flattening:</th> <td>298.257223563 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* <tr><th>UTM zones:</th> <td>1 to 60 in North and South hemispheres</td></tr>
* </table></blockquote>
*/
@@ -166,7 +164,7 @@ public enum CommonCRS {
* <tr><th>Semi-major axis length:</th> <td>6378135</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6356751 <i>(approximative)</i></td></tr>
* <tr><th>Inverse flattening:</th> <td>298.26 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* <tr><th>UTM zones:</th> <td>1 to 60 in North and South hemispheres</td></tr>
* </table></blockquote>
*/
@@ -187,7 +185,7 @@ public enum CommonCRS {
* <tr><th>Semi-major axis length:</th> <td>6378137</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6356752 <i>(approximative)</i></td></tr>
* <tr><th>Inverse flattening:</th> <td>298.257222101 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* <tr><th>UTM zones:</th> <td>1 to 23 in the North hemisphere</td></tr>
* </table></blockquote>
*
@@ -210,7 +208,7 @@ public enum CommonCRS {
* <tr><th>Prime meridian:</th> <td>Greenwich</td></tr>
* <tr><th>Semi-major axis length:</th> <td>6378206.4</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6356583.8 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* <tr><th>UTM zones:</th> <td>1 to 22 in the North hemisphere</td></tr>
* </table></blockquote>
*/
@@ -230,7 +228,7 @@ public enum CommonCRS {
* <tr><th>Semi-major axis length:</th> <td>6378137</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6356752 <i>(approximative)</i></td></tr>
* <tr><th>Inverse flattening:</th> <td>298.257222101 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* <tr><th>UTM zones:</th> <td>28 to 37 in the North hemisphere</td></tr>
* </table></blockquote>
*
@@ -253,7 +251,7 @@ public enum CommonCRS {
* <tr><th>Semi-major axis length:</th> <td>6378388</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6356912 <i>(approximative)</i></td></tr>
* <tr><th>Inverse flattening:</th> <td>297 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* <tr><th>UTM zones:</th> <td>28 to 38 in the North hemisphere</td></tr>
* </table></blockquote>
*/
@@ -271,7 +269,7 @@ public enum CommonCRS {
* <tr><th>Prime meridian:</th> <td>Greenwich</td></tr>
* <tr><th>Semi-major axis length:</th> <td>6371007</td></tr>
* <tr><th>Semi-minor axis length:</th> <td>6371007 <i>(definitive)</i></td></tr>
- * <tr><th>Ellipsoid axes unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Ellipsoid axes unit:</th> <td>{@link Units#METRE}</td></tr>
* </table></blockquote>
*
* @see org.apache.sis.referencing.datum.DefaultEllipsoid#getAuthalicRadius()
@@ -430,7 +428,7 @@ public enum CommonCRS {
* <ul>
* <li>Axis order is (<var>longitude</var>, <var>latitude</var>).</li>
* <li>Axis directions are ({@linkplain AxisDirection#EAST East}, {@linkplain AxisDirection#NORTH North}).</li>
- * <li>Angular unit is {@link NonSI#DEGREE_ANGLE}.</li>
+ * <li>Angular unit is {@link Units#DEGREE}.</li>
* <li>Prime meridian in Greenwich.</li>
* </ul>
*
@@ -1052,7 +1050,7 @@ public enum CommonCRS {
* <tr><th>Primary names:</th> <td>"MSL height" (<i>datum:</i> "Mean Sea Level")</td></tr>
* <tr><th>Abbreviations or aliases:</th> <td>"mean sea level height" (<i>datum:</i> "MSL")</td></tr>
* <tr><th>Direction:</th> <td>{@link AxisDirection#UP}</td></tr>
- * <tr><th>Unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Unit:</th> <td>{@link Units#METRE}</td></tr>
* </table></blockquote>
*
* @see VerticalDatumType#GEOIDAL
@@ -1067,7 +1065,7 @@ public enum CommonCRS {
* <tr><th>Primary names:</th> <td>"MSL depth" (<i>datum:</i> "Mean Sea Level")</td></tr>
* <tr><th>Abbreviations or aliases:</th> <td>"mean sea level depth" (<i>datum:</i> "MSL")</td></tr>
* <tr><th>Direction:</th> <td>{@link AxisDirection#DOWN}</td></tr>
- * <tr><th>Unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Unit:</th> <td>{@link Units#METRE}</td></tr>
* </table></blockquote>
*
* @see VerticalDatumType#GEOIDAL
@@ -1083,7 +1081,7 @@ public enum CommonCRS {
* <tr><th>Primary names:</th> <td>"NAVD88 height" (<i>datum:</i> "North American Vertical Datum 1988")</td></tr>
* <tr><th>Abbreviations or aliases:</th> <td>" North American Vertical Datum of 1988 height (m)" (<i>datum:</i> "NAVD88")</td></tr>
* <tr><th>Direction:</th> <td>{@link AxisDirection#UP}</td></tr>
- * <tr><th>Unit:</th> <td>{@link SI#METRE}</td></tr>
+ * <tr><th>Unit:</th> <td>{@link Units#METRE}</td></tr>
* </table></blockquote>
*
* @see CommonCRS#NAD83
@@ -1224,11 +1222,11 @@ public enum CommonCRS {
final Unit<?> unit;
switch (this) {
default: {
- unit = SI.METRE;
+ unit = Units.METRE;
break;
}
case BAROMETRIC: {
- unit = SI.MetricPrefix.HECTO(SI.PASCAL);
+ unit = Units.HECTOPASCAL;
break;
}
}
@@ -1459,14 +1457,14 @@ public enum CommonCRS {
@SuppressWarnings("fallthrough")
private TimeCS cs() {
final Map<String,?> cs, axis;
- Unit<Duration> unit = SI.SECOND;
+ Unit<Time> unit = Units.SECOND;
switch (this) {
default: {
// Share the coordinate system created for truncated Julian.
return TRUNCATED_JULIAN.crs().getCoordinateSystem();
}
case TRUNCATED_JULIAN: {
- unit = NonSI.DAY;
+ unit = Units.DAY;
// Fall through
}
case UNIX: {
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -629,7 +629,7 @@ public final class IdentifiedObjects ext
* <tr><td>{@link org.opengis.referencing.operation.OperationMethod}</td> <td>{@code method}</td> <td>Operation method definition</td></tr>
* <tr><td>{@link org.opengis.parameter.ParameterDescriptor}</td> <td>{@code parameter}</td> <td>Operation parameter definition</td></tr>
* <tr><td>{@link org.opengis.referencing.ReferenceSystem}</td> <td>{@code referenceSystem}</td> <td>Value reference system definition</td></tr>
- * <tr><td>{@link javax.measure.unit.Unit}</td> <td>{@code uom}</td> <td>Unit of measure definition</td></tr>
+ * <tr><td>{@link javax.measure.Unit}</td> <td>{@code uom}</td> <td>Unit of measure definition</td></tr>
* </table>
*
* The type is followed by the {@linkplain NamedIdentifier#getVersion() codespace version} if available,
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -18,9 +18,7 @@ package org.apache.sis.referencing;
import java.util.Map;
import java.util.HashMap;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
import javax.measure.quantity.Length;
import org.opengis.referencing.datum.Ellipsoid;
import org.opengis.referencing.datum.PrimeMeridian;
@@ -61,6 +59,7 @@ import org.apache.sis.referencing.operat
import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
import org.apache.sis.measure.Longitude;
import org.apache.sis.measure.Latitude;
+import org.apache.sis.measure.Units;
import static org.opengis.referencing.IdentifiedObject.NAME_KEY;
import static org.opengis.referencing.IdentifiedObject.ALIAS_KEY;
@@ -76,7 +75,7 @@ import static org.apache.sis.internal.me
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*/
final class StandardDefinitions {
@@ -221,7 +220,7 @@ final class StandardDefinitions {
double semiMajorAxis; // No default value
double other; // No default value
boolean ivfDefinitive = true;
- Unit<Length> unit = SI.METRE;
+ Unit<Length> unit = Units.METRE;
switch (code) {
case 7030: name = "WGS 84"; alias = "WGS84"; semiMajorAxis = 6378137.0; other = 298.257223563; break;
case 7043: name = "WGS 72"; alias = "NWL 10D"; semiMajorAxis = 6378135.0; other = 298.26; break;
@@ -247,7 +246,7 @@ final class StandardDefinitions {
final Map<String,Object> properties = new HashMap<>(4);
properties.put(NAME_KEY, new NamedIdentifier(Citations.EPSG, "Greenwich")); // Name is fixed by ISO 19111.
properties.put(IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG, GREENWICH));
- return new DefaultPrimeMeridian(properties, 0, NonSI.DEGREE_ANGLE);
+ return new DefaultPrimeMeridian(properties, 0, Units.DEGREE);
}
/**
@@ -360,7 +359,7 @@ final class StandardDefinitions {
*/
static CoordinateSystemAxis createAxis(final short code) {
final String name, abrv;
- Unit<?> unit = SI.METRE;
+ Unit<?> unit = Units.METRE;
double min = Double.NEGATIVE_INFINITY;
double max = Double.POSITIVE_INFINITY;
RangeMeaning rm = null;
@@ -368,17 +367,17 @@ final class StandardDefinitions {
switch (code) {
case 1: name = "Easting";
abrv = "E";
- unit = SI.METRE;
+ unit = Units.METRE;
dir = AxisDirection.EAST;
break;
case 2: name = "Northing";
abrv = "N";
- unit = SI.METRE;
+ unit = Units.METRE;
dir = AxisDirection.NORTH;
break;
case 60: name = "Spherical latitude";
abrv = "φ′"; // See HardCodedAxes.SPHERICAL_LATITUDE in tests.
- unit = NonSI.DEGREE_ANGLE;
+ unit = Units.DEGREE;
dir = AxisDirection.NORTH;
min = Latitude.MIN_VALUE;
max = Latitude.MAX_VALUE;
@@ -386,7 +385,7 @@ final class StandardDefinitions {
break;
case 61: name = "Spherical longitude";
abrv = "θ"; // See HardCodedAxes.SPHERICAL_LONGITUDE in tests.
- unit = NonSI.DEGREE_ANGLE;
+ unit = Units.DEGREE;
dir = AxisDirection.EAST;
min = Longitude.MIN_VALUE;
max = Longitude.MAX_VALUE;
@@ -394,7 +393,7 @@ final class StandardDefinitions {
break;
case 62: name = "Geocentric radius";
abrv = "R"; // See HardCodedAxes.GEOCENTRIC_RADIUS in tests.
- unit = SI.METRE;
+ unit = Units.METRE;
dir = AxisDirection.UP;
rm = RangeMeaning.EXACT;
min = 0;
@@ -402,7 +401,7 @@ final class StandardDefinitions {
case 108: // Used in Ellipsoidal 3D.
case 106: name = AxisNames.GEODETIC_LATITUDE;
abrv = "φ";
- unit = NonSI.DEGREE_ANGLE;
+ unit = Units.DEGREE;
dir = AxisDirection.NORTH;
min = Latitude.MIN_VALUE;
max = Latitude.MAX_VALUE;
@@ -411,7 +410,7 @@ final class StandardDefinitions {
case 109: // Used in Ellipsoidal 3D.
case 107: name = AxisNames.GEODETIC_LONGITUDE;
abrv = "λ";
- unit = NonSI.DEGREE_ANGLE;
+ unit = Units.DEGREE;
dir = AxisDirection.EAST;
min = Longitude.MIN_VALUE;
max = Longitude.MAX_VALUE;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -19,7 +19,7 @@ package org.apache.sis.referencing.crs;
import java.util.Map;
import java.util.EnumMap;
import java.util.ConcurrentModificationException;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -17,8 +17,7 @@
package org.apache.sis.referencing.crs;
import java.util.Map;
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
import javax.measure.quantity.Angle;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
@@ -42,6 +41,7 @@ import org.apache.sis.referencing.Abstra
import org.apache.sis.io.wkt.Convention;
import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.referencing.CRS;
+import org.apache.sis.measure.Units;
import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
@@ -61,7 +61,7 @@ import static org.apache.sis.util.Argume
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*/
@XmlType(name = "GeodeticCRSType", propOrder = {
@@ -204,7 +204,7 @@ class DefaultGeodeticCRS extends Abstrac
final PrimeMeridian pm = datum.getPrimeMeridian();
final Unit<Angle> angularUnit = AxisDirections.getAngularUnit(cs, null);
if (convention != Convention.WKT2_SIMPLIFIED || // Really this specific enum, not Convention.isSimplified().
- ReferencingUtilities.getGreenwichLongitude(pm, NonSI.DEGREE_ANGLE) != 0)
+ ReferencingUtilities.getGreenwichLongitude(pm, Units.DEGREE) != 0)
{
final Unit<Angle> oldUnit = formatter.addContextualUnit(angularUnit);
formatter.indent(1);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -17,7 +17,7 @@
package org.apache.sis.referencing.crs;
import java.util.Map;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
import javax.measure.quantity.Angle;
import javax.measure.quantity.Length;
import javax.xml.bind.annotation.XmlType;
@@ -329,10 +329,10 @@ public class DefaultProjectedCRS extends
* BaseGeodCRS[“NTF (Paris)”,
* Datum[“Nouvelle Triangulation Francaise”,
* Ellipsoid[“NTF”, 6378249.2, 293.4660212936269, LengthUnit[“metre”, 1]]],
- * PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967]]],
+ * PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grad”, 0.015707963267948967]]],
* Conversion[“Lambert zone II”,
* Method[“Lambert Conic Conformal (1SP)”, Id[“EPSG”, 9801, Citation[“IOGP”]]],
- * Parameter[“Latitude of natural origin”, 52.0, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8801]],
+ * Parameter[“Latitude of natural origin”, 52.0, AngleUnit[“grad”, 0.015707963267948967], Id[“EPSG”, 8801]],
* Parameter[“Longitude of natural origin”, 0.0, AngleUnit[“degree”, 0.017453292519943295], Id[“EPSG”, 8802]],
* Parameter[“Scale factor at natural origin”, 0.99987742, ScaleUnit[“unity”, 1], Id[“EPSG”, 8805]],
* Parameter[“False easting”, 600000.0, LengthUnit[“metre”, 1], Id[“EPSG”, 8806]],
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -21,8 +21,8 @@ import java.util.Date;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.measure.quantity.Duration;
-import javax.measure.converter.UnitConverter;
+import javax.measure.quantity.Time;
+import javax.measure.UnitConverter;
import org.opengis.referencing.cs.CoordinateSystem;
import org.opengis.referencing.cs.TimeCS;
import org.opengis.referencing.crs.TemporalCRS;
@@ -59,7 +59,7 @@ import static org.apache.sis.util.Argume
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*
* @see org.apache.sis.referencing.datum.DefaultTemporalDatum
@@ -212,7 +212,7 @@ public class DefaultTemporalCRS extends
*/
private void initializeConverter() {
origin = datum.getOrigin().getTime();
- toMillis = getCoordinateSystem().getAxis(0).getUnit().asType(Duration.class).getConverterTo(Units.MILLISECOND);
+ toMillis = getCoordinateSystem().getAxis(0).getUnit().asType(Time.class).getConverterTo(Units.MILLISECOND);
}
/**
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -19,9 +19,7 @@ package org.apache.sis.referencing.cs;
import java.util.Map;
import java.util.EnumMap;
import java.util.Arrays;
-import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -67,7 +65,7 @@ import static org.apache.sis.util.Utilit
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*
* @see DefaultCoordinateSystemAxis
@@ -271,7 +269,7 @@ public class AbstractCS extends Abstract
* or an {@code INVALID_*} error code otherwise. This method is invoked at construction time for checking
* argument validity. The default implementation returns {@code VALID} in all cases. Subclasses override
* this method in order to put more restrictions on allowed axis directions and check for compatibility
- * with {@linkplain SI#METRE metre} or {@linkplain NonSI#DEGREE_ANGLE degree} units.
+ * with {@linkplain Units#METRE metre} or {@linkplain Units#DEGREE degree} units.
*
* <p><b>Note for implementors:</b> since this method is invoked at construction time, it shall not depend
* on this object's state. This method is not in public API for that reason.</p>
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -16,9 +16,7 @@
*/
package org.apache.sis.referencing.cs;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
import org.opengis.referencing.cs.AxisDirection;
import org.opengis.referencing.cs.CoordinateSystem; // For javadoc
import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -108,7 +106,7 @@ import org.apache.sis.measure.Units;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*
* @see AbstractCS#forConvention(AxesConvention)
@@ -123,9 +121,9 @@ public enum AxesConvention implements Ax
* <li>Axes are oriented and ordered as defined for {@link #CONVENTIONALLY_ORIENTED} coordinate systems.</li>
* <li>Known units are normalized (this list may be expanded in future SIS versions):
* <ul>
- * <li>Angular units are set to {@link javax.measure.unit.NonSI#DEGREE_ANGLE}.</li>
- * <li>Linear units are set to {@link javax.measure.unit.SI#METRE}.</li>
- * <li>Temporal units are set to {@link javax.measure.unit.NonSI#DAY}.</li>
+ * <li>Angular units are set to {@link javax.measure.Units#DEGREE}.</li>
+ * <li>Linear units are set to {@link javax.measure.unit.Units#METRE}.</li>
+ * <li>Temporal units are set to {@link javax.measure.unit.Units#DAY}.</li>
* </ul>
* </li>
* </ul>
@@ -155,11 +153,11 @@ public enum AxesConvention implements Ax
@Override
public Unit<?> getUnitReplacement(final CoordinateSystemAxis axis, Unit<?> unit) {
if (Units.isLinear(unit)) {
- unit = SI.METRE;
+ unit = Units.METRE;
} else if (Units.isAngular(unit)) {
- unit = NonSI.DEGREE_ANGLE;
+ unit = Units.DEGREE;
} else if (Units.isTemporal(unit)) {
- unit = NonSI.DAY;
+ unit = Units.DAY;
}
return unit;
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java [UTF-8] Tue Nov 1 21:03:06 2016
@@ -19,7 +19,7 @@ package org.apache.sis.referencing.cs;
import org.opengis.referencing.cs.AxisDirection;
import org.opengis.referencing.cs.CoordinateSystem;
import org.opengis.referencing.cs.CoordinateSystemAxis;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
/**
@@ -93,7 +93,7 @@ public interface AxisFilter {
* @Override
* public Unit<?> getUnitReplacement(CoordinateSystemAxis axis, Unit<?> unit) {
* if (Units.isAngular(unit)) {
- * unit = NonSI.DEGREE_ANGLE;
+ * unit = Units.DEGREE;
* }
* return unit;
* }
|