sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1790572 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/internal/referencing/provider/ main/resources/META-INF/services/ test/java/org/apache/sis/internal/referencing/provider/
Date Fri, 07 Apr 2017 15:49:03 GMT
Author: desruisseaux
Date: Fri Apr  7 15:49:03 2017
New Revision: 1790572

URL: http://svn.apache.org/viewvc?rev=1790572&view=rev
Log:
Implement Geographic2D with Height Offsets (EPSG:9618).
https://issues.apache.org/jira/browse/SIS-284

Added:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicAndVerticalOffsets.java
      - copied, changed from r1790133, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets2D.java
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
    sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java

Copied: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicAndVerticalOffsets.java
(from r1790133, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets2D.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicAndVerticalOffsets.java?p2=sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicAndVerticalOffsets.java&p1=sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets2D.java&r1=1790133&r2=1790572&rev=1790572&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets2D.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicAndVerticalOffsets.java
[UTF-8] Fri Apr  7 15:49:03 2017
@@ -17,74 +17,60 @@
 package org.apache.sis.internal.referencing.provider;
 
 import javax.xml.bind.annotation.XmlTransient;
-import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.parameter.ParameterNotFoundException;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.MathTransformFactory;
-import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
-import org.apache.sis.parameter.Parameters;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.measure.Units;
 
 
 /**
- * The provider for <cite>"Geographic2D offsets"</cite> (EPSG:9619).
+ * The provider for <cite>"Geographic2D with Height Offsets"</cite> (EPSG:9618).
+ * This is not the same than a <cite>"Geographic3D offsets"</cite> because this
+ * operation also performs a simplified transformation from ellipsoidal height
+ * to geoidal height, as can been seen from the difference in parameter name.
+ * For a "Geographic3D offsets" with ellipsoidal heights, see the parent class.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
- * @since   0.7
+ * @version 0.8
+ * @since   0.8
  * @module
  */
 @XmlTransient
-public final class GeographicOffsets2D extends GeographicOffsets {
+public final class GeographicAndVerticalOffsets extends GeographicOffsets {
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -1611236201346560796L;
+    private static final long serialVersionUID = 7822664525013018023L;
+
+    /**
+     * The operation parameter descriptor for the <cite>"Geoid undulation"</cite>
parameter value.
+     *
+     * @see #TZ
+     */
+    static final ParameterDescriptor<Double> TH;
 
     /**
      * The group of all parameters expected by this coordinate operation.
      */
     private static final ParameterDescriptorGroup PARAMETERS;
     static {
-        PARAMETERS = builder().addIdentifier("9619").addName("Geographic2D offsets").createGroup(TY,
TX);
+        final ParameterBuilder builder = builder();
+        TH = builder.addIdentifier("8604").addName("Geoid undulation").create(0, Units.METRE);
+        PARAMETERS = builder().addIdentifier("9618").addName("Geographic2D with Height Offsets").createGroup(TY,
TX, TH);
     }
 
     /**
      * Constructs a provider with default parameters.
      */
-    public GeographicOffsets2D() {
-        this(null);
-    }
-
-    /**
-     * Constructs a provider that can be resized.
-     */
-    GeographicOffsets2D(GeodeticOperation[] redimensioned) {
-        super(2, 2, PARAMETERS, redimensioned);
+    public GeographicAndVerticalOffsets() {
+        super(3, 3, PARAMETERS, null);
     }
 
     /**
-     * Returns the three-dimensional variant of this operation method.
-     */
-    @Override
-    Class<GeographicOffsets> variant3D() {
-        return GeographicOffsets.class;
-    }
-
-    /**
-     * Creates a transform from the specified group of parameter values.
-     * The parameter values are unconditionally converted to degrees.
-     *
-     * @param  factory  ignored (can be null).
-     * @param  values   the group of parameter values.
-     * @return the created math transform.
-     * @throws ParameterNotFoundException if a required parameter was not found.
+     * Returns the parameter descriptor for the vertical axis.
      */
     @Override
-    public MathTransform createMathTransform(MathTransformFactory factory, ParameterValueGroup
values)
-            throws ParameterNotFoundException
-    {
-        final Parameters pv = Parameters.castOrWrap(values);
-        return new AffineTransform2D(1, 0, 0, 1, pv.doubleValue(TX), pv.doubleValue(TY));
+    ParameterDescriptor<Double> vertical() {
+        return TH;
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java?rev=1790572&r1=1790571&r2=1790572&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
[UTF-8] Fri Apr  7 15:49:03 2017
@@ -96,6 +96,13 @@ public class GeographicOffsets extends G
     }
 
     /**
+     * Returns the parameter descriptor for the vertical axis.
+     */
+    ParameterDescriptor<Double> vertical() {
+        return TZ;
+    }
+
+    /**
      * Creates a transform from the specified group of parameter values.
      * The parameter values are unconditionally converted to degrees and metres.
      *
@@ -112,7 +119,7 @@ public class GeographicOffsets extends G
         final Matrix4 t = new Matrix4();
         t.m03 = pv.doubleValue(TX);
         t.m13 = pv.doubleValue(TY);
-        t.m23 = pv.doubleValue(TZ);
+        t.m23 = pv.doubleValue(vertical());
         return MathTransforms.linear(t);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod?rev=1790572&r1=1790571&r2=1790572&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
[UTF-8] Fri Apr  7 15:49:03 2017
@@ -7,6 +7,7 @@ org.apache.sis.internal.referencing.prov
 org.apache.sis.internal.referencing.provider.Geographic2Dto3D
 org.apache.sis.internal.referencing.provider.GeographicOffsets
 org.apache.sis.internal.referencing.provider.GeographicOffsets2D
+org.apache.sis.internal.referencing.provider.GeographicAndVerticalOffsets
 org.apache.sis.internal.referencing.provider.VerticalOffset
 org.apache.sis.internal.referencing.provider.LongitudeRotation
 org.apache.sis.internal.referencing.provider.GeocentricTranslation

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java?rev=1790572&r1=1790571&r2=1790572&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
[UTF-8] Fri Apr  7 15:49:03 2017
@@ -57,6 +57,7 @@ public final strictfp class ProvidersTes
             AxisOrderReversal3D.class,
             GeographicOffsets.class,
             GeographicOffsets2D.class,
+            GeographicAndVerticalOffsets.class,
             VerticalOffset.class,
             LongitudeRotation.class,
             CoordinateFrameRotation.class,



Mime
View raw message