sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1678033 - in /sis/branches/JDK8/core: sis-referencing/src/main/java/org/apache/sis/referencing/crs/ sis-referencing/src/test/java/org/apache/sis/referencing/crs/ sis-referencing/src/test/java/org/apache/sis/referencing/cs/ sis-referencing/...
Date Wed, 06 May 2015 16:14:10 GMT
Author: desruisseaux
Date: Wed May  6 16:14:10 2015
New Revision: 1678033

URL: http://svn.apache.org/r1678033
Log:
Referencing: better support of DerivedCRS WKT. According ISO 19162 a DerivedCRS can
itself be a GeodeticCRS, VerticalCRS, TemporalCRS, ParametericCRS or EngineerindCRS.

Added:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -462,7 +462,7 @@ public class AbstractCRS extends Abstrac
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        final String  keyword = super.formatTo(formatter);
+        final String keyword = super.formatTo(formatter);
         formatter.newLine();
         formatter.append(toFormattable(getDatum()));
         formatter.newLine();

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -75,6 +75,23 @@ import static org.apache.sis.internal.re
  * part (e.g. the EPSG identifier) that would otherwise been lost. Users can obtain the list
of their
  * choice by invoking {@link #getSingleComponents()} or {@link #getComponents()} respectively.
  *
+ * <div class="section">Component order</div>
+ * ISO 19162 restricts compound CRS to the following components in that order:
+ * <ul>
+ *   <li>A mandatory horizontal CRS (only one of two-dimensional {@code GeographicCRS}
or {@code ProjectedCRS} or {@code EngineeringCRS}).</li>
+ *   <li>Optionally followed by a {@code VerticalCRS} or a {@code ParametricCRS} (but
not both).</li>
+ *   <li>Optionally followed by a {@code TemporalCRS}.</li>
+ * </ul>
+ *
+ * SIS currently does not enforce those restrictions. In particular:
+ * <ul>
+ *   <li>Components may appear in different order.
+ *   <li>{@code VerticalCRS} + {@code TemporalCRS} (without horizontal component) is
accepted.</li>
+ *   <li>{@code GeocentricCRS} or three-dimensional {@code GeographicCRS} can be combined
with {@code TemporalCRS}.</li>
+ * </ul>
+ *
+ * However users are encouraged to follow ISO 19162 restriction for better portability.
+ *
  * <div class="section">Immutability and thread safety</div>
  * This class is immutable and thus thread-safe if the property <em>values</em>
(not necessarily the map itself)
  * and all {@link CoordinateReferenceSystem} instances given to the constructor are also
immutable.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -20,18 +20,32 @@ import java.util.Map;
 import javax.xml.bind.annotation.XmlTransient;
 import org.opengis.parameter.GeneralParameterValue;
 import org.opengis.referencing.datum.Datum;
+import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.datum.VerticalDatum;
+import org.opengis.referencing.datum.TemporalDatum;
+import org.opengis.referencing.datum.EngineeringDatum;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.DerivedCRS;
+import org.opengis.referencing.crs.GeodeticCRS;
+import org.opengis.referencing.crs.VerticalCRS;
+import org.opengis.referencing.crs.TemporalCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
+import org.opengis.referencing.crs.EngineeringCRS;
 import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.cs.EllipsoidalCS;
+import org.opengis.referencing.cs.VerticalCS;
+import org.opengis.referencing.cs.TimeCS;
 import org.opengis.referencing.operation.Conversion;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.NoninvertibleTransformException;
 import org.opengis.geometry.MismatchedDimensionException;
+import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.referencing.operation.DefaultOperationMethod;
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.Classes;
 
 
 /**
@@ -291,7 +305,170 @@ public class DefaultDerivedCRS extends A
             if (!isBaseCRS(formatter)) {
                 formatCS(formatter, getCoordinateSystem(), isWKT1);
             }
-            return "EngineeringCRS"; // TODO: may be GeodeticCRS, VerticalCRS, etc.
+            return keyword();
+        }
+    }
+
+    /**
+     * Return the WKT 2 keyword for this {@code DerivedCRS}, or {@code null} if unknown.
+     * Inner subclasses will override this method for returning a constant value instead
+     * than trying to infer it from the components.
+     */
+    String keyword() {
+        return getType(getBaseCRS(), getCoordinateSystem());
+    }
+
+    /**
+     * Returns the WKT 2 keyword for a {@code DerivedCRS} having the given base CRS and derived
coordinate system.
+     * Note that an ambiguity exists if the given base CRS is a {@code GeodeticCRS}, as the
result could be either
+     * {@code "GeodeticCRS"} or {@code "EngineeringCRS"}. The current implementation returns
the former if the
+     * derived coordinate system is of the same kind than the base coordinate system.
+     */
+    static String getType(final SingleCRS baseCRS, final CoordinateSystem derivedCS) {
+        final Class<?> type;
+        if (baseCRS instanceof AbstractIdentifiedObject) {
+            // For avoiding ambiguity if a user chooses to implement more
+            // than 1 CRS interface (not recommended, but may happen).
+            type = ((AbstractIdentifiedObject) baseCRS).getInterface();
+        } else {
+            type = baseCRS.getClass();
+        }
+        if (GeodeticCRS.class.isAssignableFrom(type)) {
+            if (Classes.implementSameInterfaces(derivedCS.getClass(),
+                    baseCRS.getCoordinateSystem().getClass(), CoordinateSystem.class))
+            {
+                return "GeodeticCRS";
+            } else {
+                return "EngineeringCRS";
+            }
+        } else if (VerticalCRS.class.isAssignableFrom(type) && derivedCS instanceof
VerticalCS) {
+            return "VerticalCRS";
+        } else if (TemporalCRS.class.isAssignableFrom(type) && derivedCS instanceof
TimeCS) {
+            return "TimeCRS";
+        } else if (ProjectedCRS.class.isAssignableFrom(type) || EngineeringCRS.class.isAssignableFrom(type))
{
+            return "EngineeringCRS";
+        } else {
+            return null;
+        }
+    }
+
+
+
+
+    /**
+     * A derived geodetic CRS.  Note that base CRS of kind {@link GeodeticCRS} can be used
both with this class
+     * and with {@link org.apache.sis.referencing.crs.DefaultDerivedCRS.Engineering}. Consequently
an ambiguity
+     * may exist when choosing the kind if {@code DerivedCRS} to create for a given {@code
GeodeticCRS}.
+     */
+    @XmlTransient
+    private static final class Geodetic extends DefaultDerivedCRS implements GeodeticCRS
{
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = -1263243517380302846L;
+
+        /** Creates a new geodetic CRS derived from the given one. */
+        Geodetic(Map<String,?> properties, GeodeticCRS baseCRS, Conversion conversionFromBase,
EllipsoidalCS derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base geodetic CRS. */
+        @Override public GeodeticDatum getDatum() {
+            return (GeodeticDatum) super.getDatum();
+        }
+
+        /** Returns the coordinate system given at construction time. */
+        @Override public EllipsoidalCS getCoordinateSystem() {
+            return (EllipsoidalCS) super.getCoordinateSystem();
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return "GeodeticCRS";
+        }
+    }
+
+    /**
+     * A derived vertical CRS.
+     */
+    @XmlTransient
+    private static final class Vertical extends DefaultDerivedCRS implements VerticalCRS
{
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = -5599709829566076972L;
+
+        /** Creates a new vertical CRS derived from the given one. */
+        Vertical(Map<String,?> properties, VerticalCRS baseCRS, Conversion conversionFromBase,
VerticalCS derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base vertical CRS. */
+        @Override public VerticalDatum getDatum() {
+            return (VerticalDatum) super.getDatum();
+        }
+
+        /** Returns the coordinate system given at construction time. */
+        @Override public VerticalCS getCoordinateSystem() {
+            return (VerticalCS) super.getCoordinateSystem();
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return "VerticalCRS";
+        }
+    }
+
+    /**
+     * A derived temporal CRS.
+     */
+    @XmlTransient
+    private static final class Temporal extends DefaultDerivedCRS implements TemporalCRS
{
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = -4721311735720248819L;
+
+        /** Creates a new temporal CRS derived from the given one. */
+        Temporal(Map<String,?> properties, TemporalCRS baseCRS, Conversion conversionFromBase,
TimeCS derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base temporal CRS. */
+        @Override public TemporalDatum getDatum() {
+            return (TemporalDatum) super.getDatum();
+        }
+
+        /** Returns the coordinate system given at construction time. */
+        @Override public TimeCS getCoordinateSystem() {
+            return (TimeCS) super.getCoordinateSystem();
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return "TimeCRS";
+        }
+    }
+
+    /**
+     * An derived engineering CRS. ISO 19162 restricts the base CRS to {@code EngineeringCRS},
{@code ProjectedCRS}
+     * or {@code GeodeticCRS}. Note that in the later case, an ambiguity may exist with the
+     * {@link org.apache.sis.referencing.crs.DefaultDerivedCRS.Geodetic} when deciding which
{@code DerivedCRS} to
+     * create.
+     */
+    @XmlTransient
+    private static final class Engineering extends DefaultDerivedCRS implements EngineeringCRS
{
+        /** For cross-version compatibility. */
+        private static final long serialVersionUID = 42334975023270039L;
+
+        /** Creates a new temporal CRS derived from the given one. */
+        Engineering(Map<String,?> properties, SingleCRS baseCRS, Conversion conversionFromBase,
CoordinateSystem derivedCS) {
+            super(properties, baseCRS, conversionFromBase, derivedCS);
+        }
+
+        /** Returns the datum of the base engineering CRS. */
+        @Override public EngineeringDatum getDatum() {
+            final Datum datum = super.getDatum();
+            return (datum instanceof EngineeringDatum) ? (EngineeringDatum) datum : null;
+        }
+
+        /** Returns the WKT keyword for this derived CRS type.*/
+        @Override String keyword() {
+            return "EngineeringCRS";
         }
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -38,7 +38,8 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * A contextually local coordinate reference system. It can be divided into two broad categories:
+ * A 1-, 2- or 3-dimensional contextually local coordinate reference system.
+ * It can be divided into two broad categories:
  *
  * <ul>
  *   <li>earth-fixed systems applied to engineering activities on or near the surface
of the earth;</li>

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -29,8 +29,8 @@ import org.apache.sis.referencing.Abstra
 
 
 /**
- * A 3D coordinate reference system with the origin at the approximate centre of mass of
the earth.
- * A geocentric CRS deals with the earth's curvature by taking a 3D spatial view, which obviates
+ * A 3-dimensional coordinate reference system with the origin at the approximate centre
of mass of the earth.
+ * A geocentric CRS deals with the earth's curvature by taking a 3-dimensional spatial view,
which obviates
  * the need to model the earth's curvature.
  *
  * <p><b>Used with coordinate system type:</b>

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -40,7 +40,7 @@ import static org.apache.sis.internal.re
 
 
 /**
- * A 2D or 3D coordinate reference system based on a geodetic datum.
+ * A 2- or 3-dimensional coordinate reference system based on a geodetic datum.
  * The CRS is geographic if associated with an ellipsoidal coordinate system,
  * or geocentric if associated with a spherical or Cartesian coordinate system.
  *

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -43,7 +43,7 @@ import static org.apache.sis.internal.ut
 
 
 /**
- * A coordinate reference system based on an ellipsoidal approximation of the geoid.
+ * A 2- or 3-dimensional coordinate reference system based on an ellipsoidal approximation
of the geoid.
  * This provides an accurate representation of the geometry of geographic features
  * for a large portion of the earth's surface.
  *

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -33,9 +33,9 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * An engineering coordinate reference system applied to locations in images. Image coordinate
- * reference systems are treated as a separate sub-type because a separate user community
exists
- * for images with its own terms of reference.
+ * A 2-dimensional engineering coordinate reference system applied to locations in images.
+ * Image coordinate reference systems are treated as a separate sub-type because a separate
+ * user community exists for images with its own terms of reference.
  *
  * <p><b>Used with coordinate system types:</b>
  *   {@linkplain org.apache.sis.referencing.cs.DefaultCartesianCS Cartesian} or

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -49,7 +49,7 @@ import static org.apache.sis.internal.re
 
 
 /**
- * A 2D coordinate reference system used to approximate the shape of the earth on a planar
surface.
+ * A 2-dimensional coordinate reference system used to approximate the shape of the earth
on a planar surface.
  * It is done in such a way that the distortion that is inherent to the approximation is
carefully
  * controlled and known. Distortion correction is commonly applied to calculated bearings
and
  * distances to produce values that are a close match to actual field values.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -36,7 +36,7 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * A 1D coordinate reference system used for the recording of time.
+ * A 1-dimensional coordinate reference system used for the recording of time.
  * The Apache SIS implementation provides the following methods in addition to the OGC/ISO
properties:
  *
  * <ul>

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -32,7 +32,7 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * A 1D coordinate reference system used for recording heights or depths.
+ * A 1-dimensional coordinate reference system used for recording heights or depths.
  * Vertical CRSs make use of the direction of gravity to define the concept of height or
depth,
  * but the relationship with gravity may not be straightforward.
  *

Added: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java?rev=1678033&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.referencing.crs;
+
+import org.opengis.referencing.crs.SingleCRS;
+import org.opengis.referencing.cs.CoordinateSystem;
+import org.apache.sis.referencing.cs.HardCodedCS;
+import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+
+/**
+ * Tests the {@link DefaultDerivedCRS} class.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+@DependsOn({
+    DefaultProjectedCRSTest.class   // Has many similarities with DerivedCRS, but is simpler.
+})
+public final strictfp class DefaultDerivedCRSTest extends TestCase {
+    /**
+     * Tests {@link DefaultDerivedCRS#getType(SingleCRS, CoordinateSystem)}.
+     */
+    @Test
+    public void testGetType() {
+        assertEquals("VerticalCRS",
+                DefaultDerivedCRS.getType(HardCodedCRS.ELLIPSOIDAL_HEIGHT, HardCodedCS.GRAVITY_RELATED_HEIGHT));
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -107,7 +107,7 @@ public final strictfp class DirectionAlo
     }
 
     /**
-     * Test Well Known Text formatting.
+     * Tests Well Known Text formatting.
      */
     @Test
     public void testWKT() {

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Wed May  6 16:14:10 2015
@@ -126,9 +126,10 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.crs.DefaultGeodeticCRSTest.class,
     org.apache.sis.referencing.crs.DefaultGeocentricCRSTest.class,
     org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class,
-    org.apache.sis.referencing.crs.DefaultProjectedCRSTest.class,
     org.apache.sis.referencing.crs.DefaultVerticalCRSTest.class,
     org.apache.sis.referencing.crs.DefaultTemporalCRSTest.class,
+    org.apache.sis.referencing.crs.DefaultProjectedCRSTest.class,
+    org.apache.sis.referencing.crs.DefaultDerivedCRSTest.class,
     org.apache.sis.referencing.crs.SubTypesTest.class,
     org.apache.sis.referencing.crs.DefaultCompoundCRSTest.class,
     org.apache.sis.referencing.crs.HardCodedCRSTest.class,

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1678033&r1=1678032&r2=1678033&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
Wed May  6 16:14:10 2015
@@ -522,15 +522,17 @@ next:       for (final Class<?> candidat
      * of interfaces. Only interfaces assignable to {@code baseInterface} are compared.
      * Declaration order doesn't matter.
      *
-     * For example in ISO 19111, different interfaces exist for different coordinate system
(CS)
-     * geometries ({@code CartesianCS}, {@code PolarCS}, etc.). One can check if two implementations
-     * have the same geometry with the following code:
+     * <div class="note"><b>Example:</b>
+     * in ISO 19111, different interfaces exist for different coordinate system (CS) geometries
+     * ({@code CartesianCS}, {@code PolarCS}, etc.). One can check if two implementations
have
+     * the same geometry with the following code:
      *
      * {@preformat java
      *     if (implementSameInterfaces(cs1, cs2, CoordinateSystem.class)) {
      *         // The two Coordinate System are of the same kind.
      *     }
      * }
+     * </div>
      *
      * @param object1 The first object to check for interfaces.
      * @param object2 The second object to check for interfaces.



Mime
View raw message