• {@code angle(A, B) = -angle(B, A)}
• * * - * @param source The source axis direction. - * @param target The target axis direction. - * @return The arithmetic angle (in degrees) of the rotation to apply on a line pointing toward + * @param source the source axis direction. + * @param target the target axis direction. + * @return the arithmetic angle (in degrees) of the rotation to apply on a line pointing toward * the source direction in order to make it point toward the target direction, or * {@code null} if this value can not be computed. */ @@ -234,8 +231,8 @@ public final class CoordinateSystems ext /** * Returns the axis direction for the specified coordinate system. * - * @param cs The coordinate system. - * @return The axis directions for the specified coordinate system. + * @param cs the coordinate system. + * @return the axis directions for the specified coordinate system. */ private static AxisDirection[] getAxisDirections(final CoordinateSystem cs) { final AxisDirection[] directions = new AxisDirection[cs.getDimension()]; @@ -271,18 +268,19 @@ public final class CoordinateSystems ext * } * * - * @param sourceCS The source coordinate system. - * @param targetCS The target coordinate system. - * @return The conversion from {@code sourceCS} to {@code targetCS} as an affine transform. + * @param sourceCS the source coordinate system. + * @param targetCS the target coordinate system. + * @return the conversion from {@code sourceCS} to {@code targetCS} as an affine transform. * Only axis direction and units are taken in account. * @throws IllegalArgumentException if the CS are not of the same type, or axes do not match. - * @throws ConversionException if the units are not compatible, or the conversion is non-linear. + * @throws IncommensurableException if the units are not compatible, or the conversion is non-linear. * * @see Matrices#createTransform(AxisDirection[], AxisDirection[]) */ + @SuppressWarnings("fallthrough") public static Matrix swapAndScaleAxes(final CoordinateSystem sourceCS, final CoordinateSystem targetCS) - throws IllegalArgumentException, ConversionException + throws IllegalArgumentException, IncommensurableException { ensureNonNull("sourceCS", sourceCS); ensureNonNull("targetCS", targetCS); @@ -313,8 +311,7 @@ public final class CoordinateSystems ext for (int j=0; j targetUnit = targetCS.getAxis(j).getUnit(); for (int i=0; i getUnitReplacement(CoordinateSystemAxis axis, Unit unit) { * if (Units.isAngular(unit)) { - * unit = NonSI.DEGREE_ANGLE; + * unit = Units.DEGREE; * } * return unit; * } @@ -377,9 +383,9 @@ public final class CoordinateSystems ext * A rational for normalized axis order and units is explained in the Axis units and direction section * in the description of the {@linkplain org.apache.sis.referencing.operation.projection map projection package}. * - * @param cs The coordinate system, or {@code null}. - * @param filter The modifications to apply on coordinate system axes. - * @return The modified coordinate system as a new instance, + * @param cs the coordinate system, or {@code null}. + * @param filter the modifications to apply on coordinate system axes. + * @return the modified coordinate system as a new instance, * or {@code cs} if the given coordinate system was null or does not need any change. * @throws IllegalArgumentException if the specified coordinate system can not be normalized. * @@ -421,9 +427,9 @@ public final class CoordinateSystems ext * }); * } * - * @param cs The coordinate system in which to replace linear units, or {@code null}. - * @param newUnit The new linear unit. - * @return The modified coordinate system as a new instance, + * @param cs the coordinate system in which to replace linear units, or {@code null}. + * @param newUnit the new linear unit. + * @return the modified coordinate system as a new instance, * or {@code cs} if all linear units were already equal to the given one. * * @see Units#isLinear(Unit) @@ -462,9 +468,9 @@ public final class CoordinateSystems ext * }); * } * - * @param cs The coordinate system in which to replace angular units, or {@code null}. - * @param newUnit The new angular unit. - * @return The modified coordinate system as a new instance, + * @param cs the coordinate system in which to replace angular units, or {@code null}. + * @param newUnit the new angular unit. + * @return the modified coordinate system as a new instance, * or {@code cs} if all angular units were already equal to the given one. * * @see Units#isAngular(Unit) Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java?rev=1767577&r1=1767576&r2=1767577&view=diff ============================================================================== --- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] (original) +++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] Tue Nov 1 21:03:06 2016 @@ -17,7 +17,7 @@ package org.apache.sis.referencing.cs; import java.util.Map; -import javax.measure.unit.Unit; +import javax.measure.Unit; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlRootElement; import org.opengis.referencing.cs.AffineCS; @@ -52,7 +52,7 @@ import org.apache.sis.measure.Units; * * @author Martin Desruisseaux (IRD, Geomatys) * @since 0.4 - * @version 0.4 + * @version 0.8 * @module */ @XmlType(name = "AffineCSType") @@ -106,9 +106,9 @@ public class DefaultAffineCS extends Abs * * * - * @param properties The properties to be given to the identified object. - * @param axis0 The first axis. - * @param axis1 The second axis. + * @param properties the properties to be given to the identified object. + * @param axis0 the first axis. + * @param axis1 the second axis. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createAffineCS(Map, CoordinateSystemAxis, CoordinateSystemAxis) */ @@ -123,10 +123,10 @@ public class DefaultAffineCS extends Abs * Constructs a three-dimensional coordinate system from a set of properties. * The properties map is given unchanged to the superclass constructor. * - * @param properties The properties to be given to the identified object. - * @param axis0 The first axis. - * @param axis1 The second axis. - * @param axis2 The third axis. + * @param properties the properties to be given to the identified object. + * @param axis0 the first axis. + * @param axis1 the second axis. + * @param axis2 the third axis. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createAffineCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis) */ @@ -145,7 +145,7 @@ public class DefaultAffineCS extends Abs * *

This constructor performs a shallow copy, i.e. the properties are not cloned.

* - * @param cs The coordinate system to copy. + * @param cs the coordinate system to copy. * * @see #castOrCopy(AffineCS) */ @@ -162,8 +162,8 @@ public class DefaultAffineCS extends Abs *

This method checks for the {@link CartesianCS} sub-interface. If that interface is found, * then this method delegates to the corresponding {@code castOrCopy} static method.

* - * @return The domain covered by this grid. + * @return the domain covered by this grid. * @throws TransformException if an error occurred while computing the envelope. */ public Envelope getDomainOfValidity() throws TransformException { @@ -328,9 +323,9 @@ public abstract class DatumShiftGrid * * - * @return The unit of measurement of output values interpolated by {@code interpolateAt(…)}. + * @return the unit of measurement of output values interpolated by {@code interpolateAt(…)}. * * @see #interpolateAt */ @@ -442,9 +437,9 @@ public abstract class DatumShiftGrid * * - * @param ordinates The "real world" ordinate (often longitude and latitude, but not necessarily) + * @param ordinates the "real world" ordinate (often longitude and latitude, but not necessarily) * of the point for which to get the translation. - * @return The translation vector at the given position. + * @return the translation vector at the given position. * @throws TransformException if an error occurred while computing the translation vector. */ public double[] interpolateAt(final double... ordinates) throws TransformException { @@ -479,9 +474,9 @@ public abstract class DatumShiftGridApply a bilinear interpolation and store the result in {@code vector[dim]}. * * - * @param gridX First grid ordinate of the point for which to get the translation. - * @param gridY Second grid ordinate of the point for which to get the translation. - * @param vector A pre-allocated array where to write the translation vector. + * @param gridX first grid ordinate of the point for which to get the translation. + * @param gridY second grid ordinate of the point for which to get the translation. + * @param vector a pre-allocated array where to write the translation vector. */ public void interpolateInCell(double gridX, double gridY, final double[] vector) { int ix = (int) gridX; gridX -= ix; @@ -525,9 +520,9 @@ public abstract class DatumShiftGrid * * - * @param dim The dimension of the translation vector component to get, - * from 0 inclusive to {@link #getTranslationDimensions()} exclusive. - * @param gridX The grid index on the x axis, from 0 inclusive to {@code gridSize[0]} exclusive. - * @param gridY The grid index on the y axis, from 0 inclusive to {@code gridSize[1]} exclusive. - * @return The translation for the given dimension in the grid cell at the given index. + * @param dim the dimension of the translation vector component to get, + * from 0 inclusive to {@link #getTranslationDimensions()} exclusive. + * @param gridX the grid index on the x axis, from 0 inclusive to {@code gridSize[0]} exclusive. + * @param gridY the grid index on the y axis, from 0 inclusive to {@code gridSize[1]} exclusive. + * @return the translation for the given dimension in the grid cell at the given index. */ public abstract double getCellValue(int dim, int gridX, int gridY); @@ -576,9 +571,9 @@ public abstract class DatumShiftGridX, Y and Z). * - * @param dim The dimension for which to get an average translation value, - * from 0 inclusive to {@link #getTranslationDimensions()} exclusive. - * @return A translation value close to the average for the given dimension. + * @param dim the dimension for which to get an average translation value, + * from 0 inclusive to {@link #getTranslationDimensions()} exclusive. + * @return a translation value close to the average for the given dimension. */ public double getCellMean(final int dim) { final DoubleDouble sum = new DoubleDouble(); @@ -610,7 +605,7 @@ public abstract class DatumShiftGridThis information is used for determining a tolerance threshold in iterative calculation.

* - * @return An estimation of cell value precision. + * @return an estimation of cell value precision. */ public abstract double getCellPrecision(); @@ -631,7 +626,7 @@ public abstract class DatumShiftGrid unit = getAxisUnit(); // Gives to users a chance to override properties. double length = getSemiMajorAxis(); if (isWKT1) { - length = unit.getConverterTo(SI.METRE).convert(length); + length = unit.getConverterTo(Units.METRE).convert(length); } formatter.append(length); final double inverseFlattening = getInverseFlattening(); // Gives to users a chance to override properties. @@ -779,7 +779,7 @@ public class DefaultEllipsoid extends Ab if (isWKT1) { return WKTKeywords.Spheroid; } - if (!convention.isSimplified() || !SI.METRE.equals(unit)) { + if (!convention.isSimplified() || !Units.METRE.equals(unit)) { formatter.append(unit); } return WKTKeywords.Ellipsoid; @@ -834,7 +834,7 @@ public class DefaultEllipsoid extends Ab } } if (unit == null) { - unit = SI.METRE; + unit = Units.METRE; Measure.missingUOM(DefaultEllipsoid.class, "semiMajorAxis"); } } Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java?rev=1767577&r1=1767576&r2=1767577&view=diff ============================================================================== --- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] (original) +++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] Tue Nov 1 21:03:06 2016 @@ -17,8 +17,8 @@ package org.apache.sis.referencing.datum; import java.util.Map; -import javax.measure.unit.Unit; -import javax.measure.unit.NonSI; +import java.util.Objects; +import javax.measure.Unit; import javax.measure.quantity.Angle; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; @@ -29,8 +29,9 @@ import org.opengis.referencing.Reference import org.opengis.referencing.datum.PrimeMeridian; import org.opengis.referencing.crs.GeneralDerivedCRS; import org.apache.sis.referencing.AbstractIdentifiedObject; +import org.apache.sis.internal.referencing.Formulas; +import org.apache.sis.internal.referencing.WKTUtilities; import org.apache.sis.internal.referencing.ReferencingUtilities; -import org.apache.sis.internal.util.PatchedUnitFormat; import org.apache.sis.internal.metadata.MetadataUtilities; import org.apache.sis.internal.metadata.WKTKeywords; import org.apache.sis.internal.jaxb.gml.Measure; @@ -38,14 +39,11 @@ import org.apache.sis.internal.util.Nume import org.apache.sis.io.wkt.Formatter; import org.apache.sis.io.wkt.Convention; import org.apache.sis.util.ComparisonMode; +import org.apache.sis.measure.Units; import static org.apache.sis.util.ArgumentChecks.ensureFinite; import static org.apache.sis.util.ArgumentChecks.ensureNonNull; -// Branch-dependent imports -import java.util.Objects; -import org.apache.sis.internal.referencing.Formulas; - /** * Defines the origin from which longitude values are determined. @@ -149,9 +147,9 @@ public class DefaultPrimeMeridian extend * * * - * @param properties The properties to be given to the identified object. - * @param greenwichLongitude The longitude value relative to the Greenwich Meridian. - * @param angularUnit The angular unit of the longitude. + * @param properties the properties to be given to the identified object. + * @param greenwichLongitude the longitude value relative to the Greenwich Meridian. + * @param angularUnit the angular unit of the longitude. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createPrimeMeridian(Map, double, Unit) */ @@ -172,7 +170,7 @@ public class DefaultPrimeMeridian extend * *

This constructor performs a shallow copy, i.e. the properties are not cloned.

• *