sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1708006 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/crs/ test/java/org/apache/sis/referencing/crs/ test/resources/org/apache/sis/referencing/crs/
Date Sun, 11 Oct 2015 17:59:12 GMT
Author: desruisseaux
Date: Sun Oct 11 17:59:12 2015
New Revision: 1708006

URL: http://svn.apache.org/viewvc?rev=1708006&view=rev
Log:
Complete GML support for CompoundCRS (SIS-159).

Added:
    sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/CompoundCRS.xml
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java

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=1708006&r1=1708005&r2=1708006&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] Sun Oct 11 17:59:12 2015
@@ -23,7 +23,9 @@ import java.util.ArrayList;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.referencing.datum.Datum;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.CompoundCRS;
@@ -42,10 +44,11 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
+import org.apache.sis.internal.jaxb.referencing.SC_CRS;
 import org.apache.sis.util.collection.CheckedContainer;
+import org.apache.sis.util.collection.Containers;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.ComparisonMode;
-import org.apache.sis.util.Workaround;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.Convention;
 
@@ -106,7 +109,7 @@ import static org.apache.sis.internal.re
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.7
  * @module
  */
 @XmlType(name="CompoundCRSType")
@@ -120,12 +123,15 @@ public class DefaultCompoundCRS extends
     /**
      * The coordinate reference systems in this compound CRS.
      * May be the same reference than {@link #singles}.
+     *
+     * <p><b>Consider this field as final!</b>
+     * This field is modified only at unmarshalling time by {@link #setComponents(List)}</p>
      */
-    private final List<? extends CoordinateReferenceSystem> components;
+    private List<? extends CoordinateReferenceSystem> components;
 
     /**
      * A decomposition of the CRS list into the single elements.
-     * Computed by {@link #computeSingleCRS(List)} on construction or deserialization.
+     * Computed by {@link #setSingleComponents(List)} on construction or deserialization.
      */
     private transient List<SingleCRS> singles;
 
@@ -179,16 +185,17 @@ public class DefaultCompoundCRS extends
      */
     public DefaultCompoundCRS(final Map<String,?> properties, final CoordinateReferenceSystem...
components) {
         super(properties, createCoordinateSystem(properties, components));
-        this.components = copy(Arrays.asList(components));
+        setComponents(Arrays.asList(components));
         // 'singles' is computed by the above method call.
     }
 
     /**
      * Returns a compound coordinate system for the specified array of CRS objects.
-     * This method is a work around for RFE #4093999 in Sun's bug database
-     * ("Relax constraint on placement of this()/super() call in constructors").
+     *
+     * @param  properties The properties given to the constructor, or {@code null} if unknown.
+     * @param  components The CRS components, usually singles but not necessarily.
+     * @return The coordinate system for the given components.
      */
-    @Workaround(library="JDK", version="1.7")
     private static CoordinateSystem createCoordinateSystem(final Map<String,?> properties,
             final CoordinateReferenceSystem[] components)
     {
@@ -207,36 +214,6 @@ public class DefaultCompoundCRS extends
     }
 
     /**
-     * Computes the {@link #singles} field from the given CRS list and returns {@code true}
-     * if it has the same content.
-     */
-    private boolean computeSingleCRS(List<? extends CoordinateReferenceSystem> crs)
{
-        singles = new ArrayList<>(crs.size());
-        final boolean identical = ReferencingUtilities.getSingleComponents(crs, singles);
-        singles = UnmodifiableArrayList.wrap(singles.toArray(new SingleCRS[singles.size()]));
-        return identical;
-    }
-
-    /**
-     * Returns an unmodifiable copy of the given list. As a side effect, this method computes
the
-     * {@linkplain singles} list. If it appears that the list of {@code SingleCRS} is equal
to the
-     * given list, then it is returned in other to share the same list in both {@link #components}
-     * and {@link #singles} references.
-     *
-     * <p><strong>WARNING:</strong> this method is invoked by constructors
<em>before</em>
-     * the {@linkplain #components} field is set. Do not use this field in this method.</p>
-     */
-    @SuppressWarnings("SuspiciousToArrayCall")
-    private List<? extends CoordinateReferenceSystem> copy(List<? extends CoordinateReferenceSystem>
components) {
-        if (computeSingleCRS(components)) {
-            components = singles; // Shares the same list.
-        } else {
-            components = UnmodifiableArrayList.wrap(components.toArray(new CoordinateReferenceSystem[components.size()]));
-        }
-        return components;
-    }
-
-    /**
      * Constructs a new coordinate reference system with the same values than the specified
one.
      * This copy constructor provides a way to convert an arbitrary implementation into a
SIS one
      * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific
API.
@@ -252,8 +229,7 @@ public class DefaultCompoundCRS extends
             this.components = that.components;
             this.singles    = that.singles;
         } else {
-            this.components = copy(crs.getComponents());
-            // 'singles' is computed by the above method call.
+            setComponents(crs.getComponents());
         }
     }
 
@@ -311,6 +287,21 @@ public class DefaultCompoundCRS extends
     }
 
     /**
+     * Computes the {@link #components} and {@link #singles} fields from the given CRS list.
+     * If the two lists have the same content, then the two fields will reference the same
list.
+     *
+     * @see #getComponents()
+     */
+    @SuppressWarnings("SuspiciousToArrayCall")
+    private void setComponents(final List<? extends CoordinateReferenceSystem> crs)
{
+        if (setSingleComponents(crs)) {
+            components = singles; // Shares the same list.
+        } else {
+            components = UnmodifiableArrayList.wrap(crs.toArray(new CoordinateReferenceSystem[crs.size()]));
+        }
+    }
+
+    /**
      * Returns the ordered list of single coordinate reference systems. If this compound
CRS contains
      * other compound CRS, then all of them are expanded in a sequence of {@code SingleCRS}
objects.
      * See class Javadoc for more information.
@@ -325,6 +316,42 @@ public class DefaultCompoundCRS extends
     }
 
     /**
+     * Computes the {@link #singles} field from the given CRS list and returns {@code true}
+     * if the given list was already a list of single CRS.
+     *
+     * <p><strong>WARNING:</strong> this method is invoked by <em>before</em>
the {@linkplain #components}
+     * field is set. Do not use that field in this method.</p>
+     *
+     * @see #getSingleComponents()
+     */
+    private boolean setSingleComponents(final List<? extends CoordinateReferenceSystem>
crs) {
+        final List<SingleCRS> expanded = new ArrayList<>(crs.size());
+        final boolean identical = ReferencingUtilities.getSingleComponents(crs, expanded);
+        singles = UnmodifiableArrayList.wrap(expanded.toArray(new SingleCRS[expanded.size()]));
+        return identical;
+    }
+
+    /**
+     * Computes the single CRS list on deserialization.
+     *
+     * @param  in The input stream from which to deserialize a compound CRS.
+     * @throws IOException If an I/O error occurred while reading or if the stream contains
invalid data.
+     * @throws ClassNotFoundException If the class serialized on the stream is not on the
classpath.
+     */
+    @SuppressWarnings("unchecked")
+    private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
{
+        in.defaultReadObject();
+        if (components instanceof CheckedContainer<?>) {
+            final Class<?> type = ((CheckedContainer<?>) components).getElementType();
+            if (type == SingleCRS.class) {
+                singles = (List<SingleCRS>) components;
+                return;
+            }
+        }
+        setSingleComponents(components);
+    }
+
+    /**
      * Returns {@code true} if the sequence of single components is conform to the ISO 19162
restrictions.
      * The <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#111">WKT
2 specification at §16.1</a>
      * restricts {@code CompoundCRS} to the following components in that order:
@@ -352,7 +379,10 @@ public class DefaultCompoundCRS extends
      * @return {@code true} if this CRS is "standard" compliant, except for the above-cited
limitations.
      */
     @SuppressWarnings("fallthrough")
-    final boolean isStandardCompliant() {
+    static boolean isStandardCompliant(final List<? extends CoordinateReferenceSystem>
singles) {
+        if (Containers.isNullOrEmpty(singles)) {
+            return false;
+        }
         /*
          * 0 if we expect a horizontal CRS: Geographic2D, projected or engineering.
          * 1 if we expect a vertical or parametric CRS (but not both).
@@ -360,7 +390,7 @@ public class DefaultCompoundCRS extends
          * 3 if we do not expect any other CRS.
          */
         int state = 0;
-        for (final SingleCRS crs : getSingleComponents()) {
+        for (final CoordinateReferenceSystem crs : singles) {
             switch (state) {
                 case 0: {
                     if (crs instanceof GeodeticCRS || crs instanceof ProjectedCRS || crs
instanceof EngineeringCRS) {
@@ -392,26 +422,6 @@ public class DefaultCompoundCRS extends
     }
 
     /**
-     * Computes the single CRS list on deserialization.
-     *
-     * @param  in The input stream from which to deserialize a compound CRS.
-     * @throws IOException If an I/O error occurred while reading or if the stream contains
invalid data.
-     * @throws ClassNotFoundException If the class serialized on the stream is not on the
classpath.
-     */
-    @SuppressWarnings("unchecked")
-    private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
{
-        in.defaultReadObject();
-        if (components instanceof CheckedContainer<?>) {
-            final Class<?> type = ((CheckedContainer<?>) components).getElementType();
-            if (type == SingleCRS.class) {
-                singles = (List<SingleCRS>) components;
-                return;
-            }
-        }
-        computeSingleCRS(components);
-    }
-
-    /**
      * {@inheritDoc}
      *
      * <p>If the given convention is {@link AxesConvention#CONVENTIONALLY_ORIENTED}
or
@@ -518,15 +528,24 @@ public class DefaultCompoundCRS extends
     protected String formatTo(final Formatter formatter) {
         WKTUtilities.appendName(this, formatter, null);
         final Convention convention = formatter.getConvention();
+        final List<? extends CoordinateReferenceSystem> crs;
+        final boolean isStandardCompliant;
         final boolean isWKT1 = convention.majorVersion() == 1;
-        for (final CoordinateReferenceSystem element :
-                (isWKT1 || convention == Convention.INTERNAL) ? getComponents() : getSingleComponents())
-        {
-            formatter.newLine();
-            formatter.append(toFormattable(element));
+        if (isWKT1 || convention == Convention.INTERNAL) {
+            crs = getComponents();
+            isStandardCompliant = true;    // WKT 1 does not put any restriction.
+        } else {
+            crs = getSingleComponents();
+            isStandardCompliant = isStandardCompliant(crs);
         }
-        formatter.newLine(); // For writing the ID[…] element on its own line.
-        if (!isStandardCompliant()) {
+        if (crs != null) {    // Should never be null, except e.g. if unmarshalling invalid
GML.
+            for (final CoordinateReferenceSystem element : crs) {
+                formatter.newLine();
+                formatter.append(toFormattable(element));
+            }
+            formatter.newLine();    // For writing the ID[…] element on its own line.
+        }
+        if (!isStandardCompliant) {
             formatter.setInvalidWKT(this, null);
         }
         return isWKT1 ? WKTKeywords.Compd_CS : WKTKeywords.CompoundCRS;
@@ -552,6 +571,33 @@ public class DefaultCompoundCRS extends
      * reserved to JAXB, which will assign values to the fields using reflexion.
      */
     private DefaultCompoundCRS() {
-        components = null;
+    }
+
+    /**
+     * Returns the CRS components to marshal. We use this private methods instead than annotating
+     * {@link #getSingleComponents()} directly for two reasons:
+     *
+     * <ul>
+     *   <li>Use array instead of {@code List} in order to force JAXB to invoke the
setter method.
+     *       This setter is needed for performing additional work after setting the list
of CRS.</li>
+     *
+     *   <li>Allow a slightly asymmetry: marshal {@code SingleCRS} components for compliance
with
+     *       the standard, but accept the more generic {@code CoordinateReferenceSystem}
elements
+     *       at unmarshalling time.</li>
+     * </ul>
+     */
+    @XmlJavaTypeAdapter(SC_CRS.class)
+    @XmlElement(name = "componentReferenceSystem", required = true)
+    private CoordinateReferenceSystem[] getXMLComponents() {
+        final List<SingleCRS> crs = getSingleComponents();
+        return (crs != null) ? crs.toArray(new CoordinateReferenceSystem[crs.size()]) : null;
+    }
+
+    /**
+     * Invoked by JAXB for setting the components of this compound CRS.
+     */
+    private void setXMLComponents(final CoordinateReferenceSystem[] crs) {
+        components = setSingleComponents(Arrays.asList(crs)) ? singles : UnmodifiableArrayList.wrap(crs);
+        setCoordinateSystem("coordinateSystem", createCoordinateSystem(null, crs));
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java?rev=1708006&r1=1708005&r2=1708006&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
[UTF-8] Sun Oct 11 17:59:12 2015
@@ -16,21 +16,25 @@
  */
 package org.apache.sis.referencing.crs;
 
+import java.util.List;
+import javax.xml.bind.JAXBException;
 import org.opengis.test.Validators;
+import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.apache.sis.referencing.cs.DefaultCompoundCS;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.cs.HardCodedAxes;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
-import org.apache.sis.test.TestCase;
+import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
 import static org.opengis.referencing.cs.CoordinateSystem.NAME_KEY;
-import static org.apache.sis.test.MetadataAssert.*;
+import static org.apache.sis.test.ReferencingAssert.*;
 
 
 /**
@@ -38,7 +42,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
 @DependsOn({
@@ -46,7 +50,7 @@ import static org.apache.sis.test.Metada
     DefaultGeographicCRSTest.class,
     DefaultVerticalCRSTest.class
 })
-public final strictfp class DefaultCompoundCRSTest extends TestCase {
+public final strictfp class DefaultCompoundCRSTest extends XMLTestCase {
     /**
      * The vertical CRS arbitrarily chosen in this class for the tests.
      */
@@ -58,6 +62,11 @@ public final strictfp class DefaultCompo
     private static final DefaultTemporalCRS TIME = HardCodedCRS.TIME;
 
     /**
+     * An XML file in this package containing a projected CRS definition.
+     */
+    private static final String XML_FILE = "CompoundCRS.xml";
+
+    /**
      * Tests construction and serialization of a {@link DefaultCompoundCRS}.
      */
     @Test
@@ -147,11 +156,18 @@ public final strictfp class DefaultCompo
     public void testIsStandardCompliant() {
         final DefaultCompoundCRS crs3 = new DefaultCompoundCRS(singletonMap(NAME_KEY, "3D"),
HardCodedCRS.WGS84,  HEIGHT);
         final DefaultCompoundCRS crs4 = new DefaultCompoundCRS(singletonMap(NAME_KEY, "4D"),
HardCodedCRS.WGS84_3D, TIME);
-        assertTrue (crs3.isStandardCompliant());
-        assertTrue (crs4.isStandardCompliant());
-        assertTrue (new DefaultCompoundCRS(singletonMap(NAME_KEY, "4D"), crs3, TIME).isStandardCompliant());
-        assertFalse(new DefaultCompoundCRS(singletonMap(NAME_KEY, "5D"), crs4, TIME).isStandardCompliant());
-        assertFalse(new DefaultCompoundCRS(singletonMap(NAME_KEY, "4D"), TIME, crs3).isStandardCompliant());
+        assertTrue (isStandardCompliant(crs3));
+        assertTrue (isStandardCompliant(crs4));
+        assertTrue (isStandardCompliant(new DefaultCompoundCRS(singletonMap(NAME_KEY, "4D"),
crs3, TIME)));
+        assertFalse(isStandardCompliant(new DefaultCompoundCRS(singletonMap(NAME_KEY, "5D"),
crs4, TIME)));
+        assertFalse(isStandardCompliant(new DefaultCompoundCRS(singletonMap(NAME_KEY, "4D"),
TIME, crs3)));
+    }
+
+    /**
+     * Returns {@code true} if the given CRS is compliant with ISO 19162 restrictions.
+     */
+    private static boolean isStandardCompliant(final DefaultCompoundCRS crs) {
+        return DefaultCompoundCRS.isStandardCompliant(crs.getSingleComponents());
     }
 
     /**
@@ -242,4 +258,31 @@ public final strictfp class DefaultCompo
                 "  BBox[-90.00, -180.00, 90.00, 180.00]]",
                 HardCodedCRS.GEOID_4D);
     }
+
+    /**
+     * Tests (un)marshalling of a derived coordinate reference system.
+     *
+     * @throws JAXBException If an error occurred during (un)marshalling.
+     *
+     * @since 0.7
+     */
+    @Test
+    public void testXML() throws JAXBException {
+        final DefaultCompoundCRS crs = unmarshalFile(DefaultCompoundCRS.class, XML_FILE);
+        Validators.validate(crs);
+        assertEpsgNameAndIdentifierEqual("JGD2011 + JGD2011 (vertical) height", 6697, crs);
+        assertAxisDirectionsEqual("coordinateSystem", crs.getCoordinateSystem(), AxisDirection.NORTH,
AxisDirection.EAST, AxisDirection.UP);
+        /*
+         * Shallow verification of the components.
+         */
+        final List<CoordinateReferenceSystem> components = crs.getComponents();
+        assertSame("singleComponents", components, crs.getSingleComponents());
+        assertEquals("components.size", 2, components.size());
+        assertEpsgNameAndIdentifierEqual("JGD2011",                   6668, components.get(0));
+        assertEpsgNameAndIdentifierEqual("JGD2011 (vertical) height", 6695, components.get(1));
+        /*
+         * Test marshalling and compare with the original file.
+         */
+        assertMarshalEqualsFile(XML_FILE, crs, "xmlns:*", "xsi:schemaLocation", "gml:id");
+    }
 }

Modified: 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=1708006&r1=1708005&r2=1708006&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
[UTF-8] Sun Oct 11 17:59:12 2015
@@ -20,7 +20,6 @@ import java.util.Collections;
 import javax.xml.bind.JAXBException;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
-import org.opengis.util.FactoryException;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
@@ -219,13 +218,12 @@ public final strictfp class DefaultDeriv
     /**
      * Tests (un)marshalling of a derived coordinate reference system.
      *
-     * @throws FactoryException if the CRS creation failed.
      * @throws JAXBException If an error occurred during (un)marshalling.
      *
      * @since 0.7
      */
     @Test
-    public void testXML() throws FactoryException, JAXBException {
+    public void testXML() throws JAXBException {
         final DefaultDerivedCRS crs = unmarshalFile(DefaultDerivedCRS.class, XML_FILE);
         Validators.validate(crs);
         assertEpsgNameAndIdentifierEqual("WGS 84", 4979, crs.getBaseCRS());

Added: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/CompoundCRS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/CompoundCRS.xml?rev=1708006&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/CompoundCRS.xml
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/CompoundCRS.xml
Sun Oct 11 17:59:12 2015
@@ -0,0 +1,119 @@
+<?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:CompoundCRS xsi:schemaLocation = "http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/coordinateReferenceSystems.xsd"
+                 xmlns:gml          = "http://www.opengis.net/gml/3.2"
+                 xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
+                 gml:id             = "epsg-crs-6697">
+
+  <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::6697</gml:identifier>
+  <gml:name codeSpace="EPSG">JGD2011 + JGD2011 (vertical) height</gml:name>
+  <gml:scope>Large and medium scale topographic mapping and engineering survey.</gml:scope>
+
+  <!-- First Coordinate Reference System: a two-dimensional geographic CRS. -->
+  <gml:componentReferenceSystem>
+    <gml:GeodeticCRS gml:id="epsg-crs-6668">
+      <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::6668</gml:identifier>
+      <gml:name codeSpace="EPSG">JGD2011</gml:name>
+      <gml:scope>Horizontal component of 3D system.</gml:scope>
+      <gml:ellipsoidalCS>
+        <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>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>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-1128">
+          <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::1128</gml:identifier>
+          <gml:name codeSpace="EPSG">Japanese Geodetic Datum 2011</gml:name>
+          <gml:scope>Geodetic survey, topographic and engineering survey.</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>Greenwich</gml:name>
+              <gml:greenwichLongitude uom="urn:ogc:def:uom:EPSG::9102">0</gml:greenwichLongitude>
+            </gml:PrimeMeridian>
+          </gml:primeMeridian>
+          <gml:ellipsoid>
+            <gml:Ellipsoid gml:id="epsg-ellipsoid-7019">
+              <gml:identifier codeSpace="IOGP">urn:ogc:def:ellipsoid:EPSG::7019</gml:identifier>
+              <gml:name codeSpace="EPSG">GRS 1980</gml:name>
+              <gml:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9001">6378137</gml:semiMajorAxis>
+              <gml:secondDefiningParameter>
+                <gml:SecondDefiningParameter>
+                  <gml:inverseFlattening uom="urn:ogc:def:uom:EPSG::9201">298.257222101</gml:inverseFlattening>
+                </gml:SecondDefiningParameter>
+              </gml:secondDefiningParameter>
+            </gml:Ellipsoid>
+          </gml:ellipsoid>
+        </gml:GeodeticDatum>
+      </gml:geodeticDatum>
+    </gml:GeodeticCRS>
+  </gml:componentReferenceSystem>
+
+  <!-- Second Coordinate Reference System: a one-dimensional vertical CRS. -->
+  <gml:componentReferenceSystem>
+    <gml:VerticalCRS gml:id="epsg-crs-6695">
+      <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::6695</gml:identifier>
+      <gml:name codeSpace="EPSG">JGD2011 (vertical) 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-1131">
+          <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::1131</gml:identifier>
+          <gml:name codeSpace="EPSG">Japanese Geodetic Datum 2011 (vertical)</gml:name>
+          <gml:scope>Topographic mapping, geodetic survey.</gml:scope>
+          <gml:anchorDefinition>24.3900 metres above mean sea level Tokyo Bay.</gml:anchorDefinition>
+          <gml:realizationEpoch>2011-10-31</gml:realizationEpoch>
+        </gml:VerticalDatum>
+      </gml:verticalDatum>
+    </gml:VerticalCRS>
+  </gml:componentReferenceSystem>
+
+</gml:CompoundCRS>

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

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



Mime
View raw message