sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1708623 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/ main/java/org/apache/sis/referencing/operation/transform/ test/java/org/apache/sis/referencing/operation/ test/java/org/apache/sis/te...
Date Wed, 14 Oct 2015 15:37:30 GMT
Author: desruisseaux
Date: Wed Oct 14 15:37:30 2015
New Revision: 1708623

URL: http://svn.apache.org/viewvc?rev=1708623&view=rev
Log:
Add GML support for PassThroughOperation.

Added:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
  (with props)
    sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/ConcatenatedOperation.xml

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -103,6 +103,7 @@ import java.util.Objects;
 @XmlRootElement(name = "AbstractCoordinateOperation")
 @XmlSeeAlso({
     AbstractSingleOperation.class,
+    DefaultPassThroughOperation.class,
     DefaultConcatenatedOperation.class
 })
 public class AbstractCoordinateOperation extends AbstractIdentifiedObject implements CoordinateOperation
{

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -496,6 +496,8 @@ class AbstractSingleOperation extends Ab
      * @see <a href="http://issues.apache.org/jira/browse/SIS-291">SIS-291</a>
      */
     private void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+        final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
+        final CoordinateReferenceSystem targetCRS = super.getTargetCRS();
         if (transform == null && sourceCRS != null && targetCRS != null &&
parameters != null) try {
             transform = DefaultFactories.forBuildin(MathTransformFactory.class)
                     .createBaseToDerived(sourceCRS, parameters, targetCRS.getCoordinateSystem());

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -256,6 +256,8 @@ public class DefaultConversion extends A
              * ProjectedCRS), then DefaultMathTransformFactory has a specialized createBaseToDerived(…)
              * method for this job.
              */
+            final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
+            final CoordinateReferenceSystem targetCRS = super.getTargetCRS();
             if (sourceCRS == null && targetCRS == null && factory instanceof
DefaultMathTransformFactory) {
                 transform = ((DefaultMathTransformFactory) factory).createBaseToDerived(
                         source.getCoordinateSystem(), transform,

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -17,14 +17,21 @@
 package org.apache.sis.referencing.operation;
 
 import java.util.Map;
+import java.util.Arrays;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.CoordinateOperation;
 import org.opengis.referencing.operation.PassThroughOperation;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.crs.CompoundCRS;
 import org.apache.sis.referencing.operation.transform.PassThroughTransform;
+import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.util.UnsupportedImplementationException;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.resources.Errors;
 
 import static org.apache.sis.util.Utilities.deepEquals;
 
@@ -37,10 +44,14 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.7
  * @module
  */
-// Missing JAXB annotation. See http://issues.apache.org/jira/browse/SIS-293
+@XmlType(name = "PassThroughOperationType", propOrder = {
+    "indices",
+    "operation"
+})
+@XmlRootElement(name = "PassThroughOperation")
 public class DefaultPassThroughOperation extends AbstractCoordinateOperation implements PassThroughOperation
{
     /**
      * Serial number for inter-operability with different versions.
@@ -49,8 +60,13 @@ public class DefaultPassThroughOperation
 
     /**
      * The operation to apply on the subset of a coordinate tuple.
+     *
+     * <p><b>Consider this field as final!</b>
+     * This field is modified only at unmarshalling time by {@link #setOperation(CoordinateOperation)}</p>
+     *
+     * @see #getOperation()
      */
-    private final CoordinateOperation operation;
+    private CoordinateOperation operation;
 
     /**
      * Constructs a single operation from a set of properties.
@@ -155,6 +171,7 @@ public class DefaultPassThroughOperation
      * @see PassThroughTransform#getSubTransform()
      */
     @Override
+    @XmlElement(name = "coordOperation", required = true)
     public CoordinateOperation getOperation() {
         return operation;
     }
@@ -163,7 +180,7 @@ public class DefaultPassThroughOperation
      * Returns the ordered sequence of indices in a source coordinate tuple of the coordinates
      * affected by this pass-through operation.
      *
-     * @return Indices of the modified source coordinates.
+     * @return Zero-based indices of the modified source coordinates.
      *
      * @see PassThroughTransform#getModifiedCoordinates()
      */
@@ -173,7 +190,27 @@ public class DefaultPassThroughOperation
         if (transform instanceof PassThroughTransform) {
             return ((PassThroughTransform) transform).getModifiedCoordinates();
         } else {
-            // Should not happen since the constructor created the transform itself.
+            /*
+             * Should not happen with objects created by public methods since the constructor
created the transform
+             * itself. However may happen with operations parsed from GML. As a fallback,
search in the components
+             * of CompoundCRS. This is not a universal fallback, but work for the most straightforward
cases.
+             */
+            final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
+            if (sourceCRS instanceof CompoundCRS) {
+                int firstAffectedOrdinate = 0;
+                final CoordinateReferenceSystem search = operation.getSourceCRS();
+                for (final CoordinateReferenceSystem c : ((CompoundCRS) sourceCRS).getComponents())
{
+                    final int dim = ReferencingUtilities.getDimension(c);
+                    if (c == search) {
+                        final int[] indices = new int[dim];
+                        for (int i=0; i<dim; i++) {
+                            indices[i] = firstAffectedOrdinate + i;
+                        }
+                        return indices;
+                    }
+                    firstAffectedOrdinate += dim;
+                }
+            }
             throw new UnsupportedImplementationException(transform.getClass());
         }
     }
@@ -210,4 +247,78 @@ public class DefaultPassThroughOperation
     protected long computeHashCode() {
         return super.computeHashCode() + 31 * operation.hashCode();
     }
+
+
+
+
+    //////////////////////////////////////////////////////////////////////////////////////////////////
+    ////////                                                                            
     ////////
+    ////////                               XML support with JAXB                        
     ////////
+    ////////                                                                            
     ////////
+    ////////        The following methods are invoked by JAXB using reflection (even if 
     ////////
+    ////////        they are private) or are helpers for other methods invoked by JAXB. 
     ////////
+    ////////        Those methods can be safely removed if Geographic Markup Language   
     ////////
+    ////////        (GML) support is not needed.                                        
     ////////
+    ////////                                                                            
     ////////
+    //////////////////////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Constructs a new object in which every attributes are set to a null value.
+     * <strong>This is not a valid object.</strong> This constructor is strictly
+     * reserved to JAXB, which will assign values to the fields using reflexion.
+     */
+    private DefaultPassThroughOperation() {
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time for setting the coordinate operation
+     * applied on the subset of a coordinate tuple.
+     *
+     * @see #getOperation()
+     */
+    private void setOperation(final CoordinateOperation op) {
+        operation = op;
+    }
+
+    /**
+     * Invoked by JAXB at marshalling time for getting the modified coordinates.
+     * This method converts the zero-based indices to 1-based indices.
+     *
+     * @see #getModifiedCoordinates()
+     */
+    @XmlElement(name = "modifiedCoordinate", required = true)
+    private int[] getIndices() {
+        final int[] indices = getModifiedCoordinates();
+        for (int i=0; i<indices.length; i++) {
+            indices[i]++;
+        }
+        return indices;
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time for setting the modified coordinates.
+     */
+    private void setIndices(final int[] ordinates) {
+        String missing = "sourceCRS";
+        final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
+        if (sourceCRS != null) {
+            missing = "modifiedCoordinate";
+            if (ordinates != null && ordinates.length != 0) {
+                missing = "coordOperation";
+                if (operation != null) {
+                    for (int i=1; i<ordinates.length; i++) {
+                        final int previous = ordinates[i-1];
+                        if (previous < 1 || ordinates[i] != previous + 1) {
+                            throw new IllegalArgumentException(Errors.format(
+                                    Errors.Keys.CanNotAssign_2, missing, Arrays.toString(ordinates)));
+                        }
+                    }
+                    transform = PassThroughTransform.create(ordinates[0] - 1, operation.getMathTransform(),
+                            ReferencingUtilities.getDimension(sourceCRS) - ordinates[ordinates.length
- 1]);
+                    return;
+                }
+            }
+        }
+        throw new IllegalStateException(Errors.format(Errors.Keys.MissingComponentInElement_2,
missing, "PassThroughOperation"));
+    }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -268,7 +268,7 @@ public class PassThroughTransform extend
      * used" fields public in order to keep the flexibility to replace them by a {@code modifiedCoordinates}
      * array in a future SIS version.</div>
      *
-     * @return Indices of the modified source coordinates.
+     * @return Zero-based indices of the modified source coordinates.
      *
      * @see org.apache.sis.referencing.operation.DefaultPassThroughOperation#getModifiedCoordinates()
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -41,7 +41,7 @@ import static org.apache.sis.test.TestUt
     DefaultTransformationTest.class,
     SingleOperationMarshallingTest.class
 })
-public class DefaultConcatenatedOperationTest extends XMLTestCase {
+public strictfp final class DefaultConcatenatedOperationTest extends XMLTestCase {
     /**
      * An XML file in this package containing a projected CRS definition.
      */

Added: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java?rev=1708623&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultPassThroughOperationTest.java
[UTF-8] Wed Oct 14 15:37:30 2015
@@ -0,0 +1,83 @@
+/*
+ * 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.operation;
+
+import java.util.List;
+import javax.xml.bind.JAXBException;
+import org.opengis.referencing.crs.CompoundCRS;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.operation.CoordinateOperation;
+import org.opengis.referencing.operation.Transformation;
+import org.opengis.test.Validators;
+import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.XMLTestCase;
+import org.junit.Test;
+
+import static org.apache.sis.test.TestUtilities.getSingleton;
+import static org.opengis.test.Assert.*;
+
+
+/**
+ * Tests the {@link DefaultPassThroughOperation} class.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.7
+ * @version 0.7
+ * @module
+ */
+@DependsOn({
+    DefaultTransformationTest.class,
+    SingleOperationMarshallingTest.class
+})
+public strictfp final class DefaultPassThroughOperationTest extends XMLTestCase {
+    /**
+     * An XML file in this package containing a projected CRS definition.
+     */
+    private static final String XML_FILE = "PassThroughOperation.xml";
+
+    /**
+     * Tests (un)marshalling of a concatenated operation.
+     *
+     * @throws JAXBException If an error occurred during (un)marshalling.
+     */
+    @Test
+    public void testXML() throws JAXBException {
+        final DefaultPassThroughOperation toTest = unmarshalFile(DefaultPassThroughOperation.class,
XML_FILE);
+        Validators.validate(toTest);
+        final CoordinateReferenceSystem sourceCRS = toTest.getSourceCRS();
+        final CoordinateReferenceSystem targetCRS = toTest.getTargetCRS();
+        final CoordinateOperation       operation = toTest.getOperation();
+        assertIdentifierEquals(          "identifier", "test", "test", null, "passthrough",
getSingleton(toTest   .getIdentifiers()));
+        assertIdentifierEquals("sourceCRS.identifier", "test", "test", null, "source",  
   getSingleton(sourceCRS.getIdentifiers()));
+        assertIdentifierEquals("targetCRS.identifier", "test", "test", null, "target",  
   getSingleton(targetCRS.getIdentifiers()));
+        assertIdentifierEquals("operation.identifier", "test", "test", null, "rotation",
   getSingleton(operation.getIdentifiers()));
+        assertInstanceOf("sourceCRS",    CompoundCRS.class, sourceCRS);
+        assertInstanceOf("targetCRS",    CompoundCRS.class, targetCRS);
+        assertInstanceOf("operation", Transformation.class, operation);
+        final List<CoordinateReferenceSystem> srcComponents = ((CompoundCRS) sourceCRS).getComponents();
+        final List<CoordinateReferenceSystem> tgtComponents = ((CompoundCRS) targetCRS).getComponents();
+        assertEquals("sourceCRS.components.size", 2, srcComponents.size());
+        assertEquals("targetCRS.components.size", 2, tgtComponents.size());
+        assertSame  ("sourceCRS.components[0]", operation.getSourceCRS(), srcComponents.get(0));
+        assertSame  ("targetCRS.components[0]", operation.getTargetCRS(), tgtComponents.get(0));
+        assertSame  ("targetCRS.components[1]", srcComponents.get(1),     tgtComponents.get(1));
+        /*
+         * Test marshalling and compare with the original file.
+         */
+        assertMarshalEqualsFile(XML_FILE, toTest, "xmlns:*", "xsi:schemaLocation");
+    }
+}

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

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

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=1708623&r1=1708622&r2=1708623&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 Oct 14 15:37:30 2015
@@ -26,7 +26,7 @@ import org.junit.BeforeClass;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.7
  * @module
  */
 @Suite.SuiteClasses({
@@ -139,6 +139,7 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.operation.DefaultTransformationTest.class,
     org.apache.sis.referencing.operation.DefaultConversionTest.class,
     org.apache.sis.referencing.operation.SingleOperationMarshallingTest.class,
+    org.apache.sis.referencing.operation.DefaultPassThroughOperationTest.class,
     org.apache.sis.referencing.operation.DefaultConcatenatedOperationTest.class,
     org.apache.sis.referencing.crs.DefaultProjectedCRSTest.class,
     org.apache.sis.referencing.crs.DefaultDerivedCRSTest.class,

Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/ConcatenatedOperation.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/ConcatenatedOperation.xml?rev=1708623&r1=1708622&r2=1708623&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/ConcatenatedOperation.xml
(original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/ConcatenatedOperation.xml
Wed Oct 14 15:37:30 2015
@@ -20,8 +20,6 @@
 
 <gml:ConcatenatedOperation xsi:schemaLocation = "http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/datums.xsd"
                            xmlns:gml          = "http://www.opengis.net/gml/3.2"
-                           xmlns:gmd          = "http://www.isotc211.org/2005/gmd"
-                           xmlns:gco          = "http://www.isotc211.org/2005/gco"
                            xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
                            xmlns:xlink        = "http://www.w3.org/1999/xlink"
                            gml:id             = "test-coordinateOperation-concatenated">

Added: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml?rev=1708623&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml
Wed Oct 14 15:37:30 2015
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<gml:PassThroughOperation xsi:schemaLocation = "http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/datums.xsd"
+                          xmlns:gml          = "http://www.opengis.net/gml/3.2"
+                          xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
+                          xmlns:xlink        = "http://www.w3.org/1999/xlink"
+                          gml:id             = "test-coordinateOperation-passthrough">
+
+  <gml:identifier codeSpace="test">passthrough</gml:identifier>
+  <gml:name>PassThrough test</gml:name>
+  <gml:scope>None.</gml:scope>
+  <gml:sourceCRS>
+    <!--
+      The real EPSG:7400 CRS uses the EPSG:4807 horizontal CRS (with unit in grads),
+      but this test uses a custom CRS with unit in degrees instead in order to make
+      the test smaller by reusing the same coordinate system in <gml:targetCRS>.
+    -->
+    <gml:CompoundCRS gml:id="test-crs-source">
+      <gml:identifier codeSpace="test">source</gml:identifier>
+      <gml:name>NTF (Paris) + NGF IGN69 height</gml:name>
+      <gml:scope>None.</gml:scope>
+      <gml:componentReferenceSystem>
+        <gml:GeodeticCRS gml:id="test-crs-paris">
+          <gml:identifier codeSpace="test">Paris</gml:identifier>
+          <gml:name>NTF (Paris)</gml:name>
+          <gml:scope>None.</gml:scope>
+          <gml:ellipsoidalCS>
+            <!--
+              The real EPSG:4807 CRS uses the EPSG:6403 coordinate system (with unit in grads),
+              but this test uses EPSG:6422 (with unit in degrees) instead in order to make
the
+              test smaller by reusing the same coordinate system in <gml:targetCRS>.
+            -->
+            <gml:EllipsoidalCS gml:id="epsg-cs-6422">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:cs:EPSG::6422</gml:identifier>
+              <gml:name>Latitude (north), Longitude (east)</gml:name>
+              <gml:axis>
+                <gml:CoordinateSystemAxis gml:id="epsg-axis-106" uom="urn:ogc:def:uom:EPSG::9122">
+                  <gml:identifier codeSpace="IOGP">urn:ogc:def:axis:EPSG::106</gml:identifier>
+                  <gml:name codeSpace="EPSG">Geodetic latitude</gml:name>
+                  <gml:axisAbbrev>φ</gml:axisAbbrev>
+                  <gml:axisDirection codeSpace="EPSG">north</gml:axisDirection>
+                </gml:CoordinateSystemAxis>
+              </gml:axis>
+              <gml:axis>
+                <gml:CoordinateSystemAxis gml:id="epsg-axis-107" uom="urn:ogc:def:uom:EPSG::9122">
+                  <gml:identifier codeSpace="IOGP">urn:ogc:def:axis:EPSG::107</gml:identifier>
+                  <gml:name codeSpace="EPSG">Geodetic longitude</gml:name>
+                  <gml:axisAbbrev>λ</gml:axisAbbrev>
+                  <gml:axisDirection codeSpace="EPSG">east</gml:axisDirection>
+                </gml:CoordinateSystemAxis>
+              </gml:axis>
+            </gml:EllipsoidalCS>
+          </gml:ellipsoidalCS>
+          <gml:geodeticDatum>
+            <gml:GeodeticDatum gml:id="epsg-datum-6807">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::6807</gml:identifier>
+              <gml:name codeSpace="EPSG">Nouvelle Triangulation Française (Paris)</gml:name>
+              <gml:scope>Topographic mapping.</gml:scope>
+              <gml:primeMeridian>
+                <gml:PrimeMeridian gml:id="epsg-meridian-8903">
+                  <gml:identifier codeSpace="IOGP">urn:ogc:def:meridian:EPSG::8903</gml:identifier>
+                  <gml:name codeSpace="EPSG">Paris</gml:name>
+                  <gml:greenwichLongitude uom="urn:ogc:def:uom:EPSG::9105">2.5969213</gml:greenwichLongitude>
+                </gml:PrimeMeridian>
+              </gml:primeMeridian>
+              <gml:ellipsoid>
+                <gml:Ellipsoid gml:id="epsg-ellipsoid-7011">
+                  <gml:identifier codeSpace="IOGP">urn:ogc:def:ellipsoid:EPSG::7011</gml:identifier>
+                  <gml:name codeSpace="EPSG">Clarke 1880 (IGN)</gml:name>
+                  <gml:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9001">6378249.2</gml:semiMajorAxis>
+                  <gml:secondDefiningParameter>
+                    <gml:SecondDefiningParameter>
+                      <gml:semiMinorAxis uom="urn:ogc:def:uom:EPSG::9001">6356515</gml:semiMinorAxis>
+                    </gml:SecondDefiningParameter>
+                  </gml:secondDefiningParameter>
+                </gml:Ellipsoid>
+              </gml:ellipsoid>
+            </gml:GeodeticDatum>
+          </gml:geodeticDatum>
+        </gml:GeodeticCRS>
+      </gml:componentReferenceSystem>
+      <gml:componentReferenceSystem>
+        <gml:VerticalCRS gml:id="epsg-crs-5720">
+          <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::5720</gml:identifier>
+          <gml:name>NGF-IGN69 height</gml:name>
+          <gml:scope>Geodetic and engineering surveying.</gml:scope>
+          <gml:verticalCS>
+            <gml:VerticalCS gml:id="epsg-cs-6499">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:cs:EPSG::6499</gml:identifier>
+              <gml:name>Axis: height (H). Orientation: up. UoM: m.</gml:name>
+              <gml:axis>
+                <gml:CoordinateSystemAxis gml:id="epsg-axis-114" uom="urn:ogc:def:uom:EPSG::9001">
+                  <gml:identifier codeSpace="IOGP">urn:ogc:def:axis:EPSG::114</gml:identifier>
+                  <gml:name>Gravity-related height</gml:name>
+                  <gml:axisAbbrev>H</gml:axisAbbrev>
+                  <gml:axisDirection codeSpace="EPSG">up</gml:axisDirection>
+                </gml:CoordinateSystemAxis>
+              </gml:axis>
+            </gml:VerticalCS>
+          </gml:verticalCS>
+          <gml:verticalDatum>
+            <gml:VerticalDatum gml:id="epsg-datum-5119">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::5119</gml:identifier>
+              <gml:name>Nivellement General de la France - IGN69</gml:name>
+              <gml:scope>Geodetic survey, topographic mapping, engineering survey.</gml:scope>
+            </gml:VerticalDatum>
+          </gml:verticalDatum>
+        </gml:VerticalCRS>
+      </gml:componentReferenceSystem>
+    </gml:CompoundCRS>
+  </gml:sourceCRS>
+  <!--
+    Same definition than the above <gml:sourceCRS> except for the prime meridian.
+  -->
+  <gml:targetCRS>
+    <gml:CompoundCRS gml:id="test-crs-target">
+      <gml:identifier codeSpace="test">target</gml:identifier>
+      <gml:name>NTF + NGF IGN69 height</gml:name>
+      <gml:scope>None.</gml:scope>
+      <gml:componentReferenceSystem>
+        <gml:GeodeticCRS gml:id="test-crs-greenwich">
+          <gml:identifier codeSpace="test">Greenwich</gml:identifier>
+          <gml:name>NTF</gml:name>
+          <gml:scope>Geodetic survey.</gml:scope>
+          <gml:ellipsoidalCS xlink:href="#epsg-cs-6422"/>
+          <gml:geodeticDatum>
+            <gml:GeodeticDatum gml:id="epsg-datum-6275">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::6275</gml:identifier>
+              <gml:name codeSpace="EPSG">Nouvelle Triangulation Française</gml:name>
+              <gml:scope>Topographic mapping.</gml:scope>
+              <gml:primeMeridian>
+                <gml:PrimeMeridian gml:id="epsg-meridian-8901">
+                  <gml:identifier codeSpace="IOGP">urn:ogc:def:meridian:EPSG::8901</gml:identifier>
+                  <gml:name codeSpace="EPSG">Greenwich</gml:name>
+                  <gml:greenwichLongitude uom="urn:ogc:def:uom:EPSG::9102">0</gml:greenwichLongitude>
+                </gml:PrimeMeridian>
+              </gml:primeMeridian>
+              <gml:ellipsoid xlink:href="#epsg-ellipsoid-7011"/>
+            </gml:GeodeticDatum>
+          </gml:geodeticDatum>
+        </gml:GeodeticCRS>
+      </gml:componentReferenceSystem>
+      <gml:componentReferenceSystem xlink:href="#epsg-crs-5720"/>
+    </gml:CompoundCRS>
+  </gml:targetCRS>
+  <!--
+    The part of interest for PassThroughOperation test.
+  -->
+  <gml:modifiedCoordinate>1</gml:modifiedCoordinate>
+  <gml:modifiedCoordinate>2</gml:modifiedCoordinate>
+  <gml:coordOperation>
+    <gml:Transformation gml:id="test-coordinateOperation-rotation">
+      <gml:identifier codeSpace="test">rotation</gml:identifier>
+      <gml:name>Paris to Greenwich</gml:name>
+      <gml:scope>None.</gml:scope>
+      <gml:operationVersion>1</gml:operationVersion>
+      <gml:sourceCRS xlink:href="#test-crs-paris"/>
+      <gml:targetCRS xlink:href="#test-crs-greenwich"/>
+      <gml:method>
+        <gml:OperationMethod gml:id="epsg-method-9601">
+          <gml:identifier codeSpace="IOGP">urn:ogc:def:method:EPSG::9601</gml:identifier>
+          <gml:name>Longitude rotation</gml:name>
+          <gml:formula>Target longitude = Source longitude + longitude offset.</gml:formula>
+          <gml:sourceDimensions>2</gml:sourceDimensions>
+          <gml:targetDimensions>2</gml:targetDimensions>
+          <gml:parameter>
+            <gml:OperationParameter gml:id="epsg-parameter-8602">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:parameter:EPSG::8602</gml:identifier>
+              <gml:name>Longitude offset</gml:name>
+            </gml:OperationParameter>
+          </gml:parameter>
+        </gml:OperationMethod>
+      </gml:method>
+      <gml:parameterValue>
+        <gml:ParameterValue>
+          <gml:value uom="urn:ogc:def:uom:EPSG::9105">2.5969213</gml:value>
+          <gml:operationParameter xlink:href="#epsg-parameter-8602"/>
+        </gml:ParameterValue>
+      </gml:parameterValue>
+    </gml:Transformation>
+  </gml:coordOperation>
+</gml:PassThroughOperation>

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/operation/PassThroughOperation.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message