sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1534339 - in /sis/branches/JDK7/core/sis-referencing/src: main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
Date Mon, 21 Oct 2013 19:36:32 GMT
Author: desruisseaux
Date: Mon Oct 21 19:36:31 2013
New Revision: 1534339

URL: http://svn.apache.org/r1534339
Log:
More javadoc.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java?rev=1534339&r1=1534338&r2=1534339&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] Mon Oct 21 19:36:31 2013
@@ -71,6 +71,7 @@ import java.util.Objects;
  * <center><b>Geocentric coordinates transformation</b></center>
  * <center>from (<var>X</var><sub>s</sub>, <var>Y</var><sub>s</sub>,
<var>Z</var><sub>s</sub>)
  *           to (<var>X</var><sub>t</sub>, <var>Y</var><sub>t</sub>,
<var>Z</var><sub>t</sub>)</center>
+ * <center><font size="-1">(ignoring unit conversions)</font></center>
  *
  * <p><math display="block" alttext="MathML capable browser required">
  *   <mfenced open="[" close="]">
@@ -360,6 +361,12 @@ public class BursaWolfParameters extends
      * This affine transform can be applied on <strong>geocentric</strong> coordinates.
      * This is identified as operation method 1033 in the EPSG database.
      *
+     * {@section Inverse transformation}
+     * The inverse transformation can be computed by reversing the sign of the 7 parameters
before to use
+     * them in the above matrix. Note that both the direct and inverse transformations are
approximations.
+     * Multiplication of direct and inverse transformation matrices results in a matrix close
to the identity,
+     * but not necessarily strictly equals.
+     *
      * @param  inverse If {@code true}, returns the inverse transformation instead.
      * @return An affine transform in geocentric space created from this Bursa-Wolf parameters.
      *

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java?rev=1534339&r1=1534338&r2=1534339&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
[UTF-8] Mon Oct 21 19:36:31 2013
@@ -18,6 +18,7 @@ package org.apache.sis.referencing.datum
 
 import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 import org.apache.sis.referencing.operation.matrix.Matrices;
+import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -50,7 +51,25 @@ public final strictfp class BursaWolfPar
     }
 
     /**
-     * Tests serialization of <cite>ED87 to WGS 84</cite> parameters (EPSG:1146).
+     * Multiplies the <cite>ED87 to WGS 84</cite> parameters (EPSG:1146) transformation
by its inverse,
+     * and verify that the result is somewhat close to the identity. This is an internal
consistency test.
+     */
+    @Test
+    @DependsOnMethod("testGetPositionVectorTransformation")
+    public void testP() {
+        final BursaWolfParameters bursaWolf = new BursaWolfParameters(
+                -82.981, -99.719, -110.709, -0.5076, 0.1503, 0.3898, -0.3143, null);
+        final MatrixSIS toWGS84 = MatrixSIS.castOrCopy(bursaWolf.getPositionVectorTransformation(false));
+        final MatrixSIS toED87  = MatrixSIS.castOrCopy(bursaWolf.getPositionVectorTransformation(true));
+        final MatrixSIS product = toWGS84.multiply(toED87);
+        /*
+         * The error is below 1E-11 for all elements except the translation terms.
+         */
+        assertTrue(Matrices.isIdentity(product, 5E-4));
+    }
+
+    /**
+     * Tests the string representation of <cite>ED87 to WGS 84</cite> parameters
(EPSG:1146).
      */
     @Test
     public void testToString() {



Mime
View raw message