You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/05/03 23:14:33 UTC
svn commit: r1677485 - in /sis/branches/JDK8/core/sis-referencing/src:
main/java/org/apache/sis/referencing/crs/
test/java/org/apache/sis/referencing/crs/
test/java/org/apache/sis/referencing/datum/
test/resources/org/apache/sis/referencing/crs/
Author: desruisseaux
Date: Sun May 3 21:14:32 2015
New Revision: 1677485
URL: http://svn.apache.org/r1677485
Log:
Referencing: more steps toward GML support for ProjectedCRS.
Added:
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java (with props)
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml (with props)
Modified:
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/DefaultProjectedCRS.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml
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=1677485&r1=1677484&r2=1677485&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] Sun May 3 21:14:32 2015
@@ -22,6 +22,7 @@ import java.util.Arrays;
import javax.xml.bind.annotation.XmlTransient;
import org.opengis.metadata.Identifier;
import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.crs.GeodeticCRS;
import org.opengis.referencing.crs.GeographicCRS;
import org.opengis.referencing.cs.EllipsoidalCS;
import org.opengis.referencing.cs.CoordinateSystem;
@@ -32,6 +33,7 @@ import org.apache.sis.referencing.cs.Axe
import org.apache.sis.referencing.AbstractReferenceSystem;
import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.measure.Longitude;
+import org.apache.sis.util.resources.Errors;
import static org.apache.sis.internal.util.Constants.CRS;
import static org.apache.sis.internal.util.Constants.EPSG;
@@ -56,7 +58,7 @@ import static org.apache.sis.internal.ut
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4
- * @version 0.5
+ * @version 0.6
* @module
*/
@XmlTransient
@@ -141,6 +143,21 @@ public class DefaultGeographicCRS extend
}
/**
+ * For {@link SC_GeographicCRS} JAXB adapter only. This is needed because GML does not have "GeographicCRS" type.
+ * Instead, the unmarshalling process will give us a "GeodeticCRS" object with the constraint that the coordinate
+ * system shall be ellipsoidal. This constructor will be invoked for converting the GeodeticCRS instance to a
+ * GeographicCRS instance.
+ */
+ DefaultGeographicCRS(final GeodeticCRS crs) {
+ super(crs);
+ final CoordinateSystem cs = super.getCoordinateSystem();
+ if (!(cs instanceof EllipsoidalCS)) {
+ throw new IllegalArgumentException(Errors.format(
+ Errors.Keys.IllegalClass_2, EllipsoidalCS.class, cs.getClass()));
+ }
+ }
+
+ /**
* 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.
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=1677485&r1=1677484&r2=1677485&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] Sun May 3 21:14:32 2015
@@ -68,7 +68,7 @@ import static org.apache.sis.internal.re
* @module
*/
@XmlType(name="ProjectedCRSType", propOrder = {
-// "baseCRS", // TODO
+ "baseCRS",
"coordinateSystem"
})
@XmlRootElement(name = "ProjectedCRS")
@@ -210,7 +210,7 @@ public class DefaultProjectedCRS extends
* @return The base CRS.
*/
@Override
-// @XmlElement(name = "baseGeodeticCRS", required = true) // Note: older GML version used "baseGeographicCRS".
+ @XmlElement(name = "baseGeodeticCRS", required = true) // Note: older GML version used "baseGeographicCRS".
public GeographicCRS getBaseCRS() {
return (GeographicCRS) super.getBaseCRS();
}
Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java?rev=1677485&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java (added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java [UTF-8] Sun May 3 21:14:32 2015
@@ -0,0 +1,104 @@
+/*
+ * 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.GeographicCRS;
+import javax.xml.bind.annotation.XmlElement;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter for {@link GeographicCRS}, in order to integrate the value in an element
+ * complying with OGC/ISO standard.
+ *
+ * <p><b>Note:</b> JAXB adapters are usually declared in the {@link org.apache.sis.internal.jaxb.referencing}
+ * package, but this one is an exception because it needs access to package-privated {@link DefaultGeodeticCRS}
+ * class.</p>
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @since 0.6
+ * @version 0.6
+ * @module
+ */
+final class SC_GeographicCRS extends PropertyType<SC_GeographicCRS, GeographicCRS> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public SC_GeographicCRS() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code GeographicCRS.class}
+ */
+ @Override
+ protected Class<GeographicCRS> getBoundType() {
+ return GeographicCRS.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private SC_GeographicCRS(final GeographicCRS cs) {
+ super(cs);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given value
+ * in a {@code <gml:GeodeticCRS>} XML element.
+ *
+ * @param cs The element to marshall.
+ * @return A {@code PropertyType} wrapping the given the element.
+ */
+ @Override
+ protected SC_GeographicCRS wrap(final GeographicCRS cs) {
+ return new SC_GeographicCRS(cs);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual element to write
+ * inside the {@code <gml:GeodeticCRS>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return The element to be marshalled.
+ */
+ @XmlElement(name = "GeodeticCRS")
+ public DefaultGeodeticCRS getElement() {
+ final GeographicCRS metadata = this.metadata;
+ if (metadata == null || metadata instanceof DefaultGeodeticCRS) {
+ return (DefaultGeodeticCRS) metadata;
+ } else {
+ return new DefaultGeodeticCRS(metadata);
+ }
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param cs The unmarshalled element.
+ */
+ public void setElement(final DefaultGeodeticCRS cs) {
+ if (cs == null || cs instanceof GeographicCRS) {
+ metadata = (GeographicCRS) cs;
+ } else {
+ metadata = new DefaultGeographicCRS(cs);
+ }
+ }
+}
Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/SC_GeographicCRS.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java [UTF-8] Sun May 3 21:14:32 2015
@@ -88,8 +88,8 @@
@XmlJavaTypeAdapter(CD_ImageDatum.class),
@XmlJavaTypeAdapter(CD_TemporalDatum.class),
@XmlJavaTypeAdapter(CD_VerticalDatum.class),
+ @XmlJavaTypeAdapter(CS_CartesianCS.class), // Must be before CS_AffineCS.
@XmlJavaTypeAdapter(CS_AffineCS.class),
- @XmlJavaTypeAdapter(CS_CartesianCS.class),
@XmlJavaTypeAdapter(CS_CylindricalCS.class),
@XmlJavaTypeAdapter(CS_EllipsoidalCS.class),
@XmlJavaTypeAdapter(CS_LinearCS.class),
@@ -99,6 +99,7 @@
@XmlJavaTypeAdapter(CS_UserDefinedCS.class),
@XmlJavaTypeAdapter(CS_VerticalCS.class),
@XmlJavaTypeAdapter(CC_Conversion.class),
+ @XmlJavaTypeAdapter(SC_GeographicCRS.class),
@XmlJavaTypeAdapter(StringAdapter.class),
@XmlJavaTypeAdapter(InternationalStringConverter.class)
})
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java [UTF-8] Sun May 3 21:14:32 2015
@@ -106,6 +106,7 @@ public final strictfp class DefaultGeoce
"GeodeticCRS[“Geocentric”,\n" +
" Datum[“World Geodetic System 1984”,\n" +
" Ellipsoid[“WGS84”, 6378137.0, 298.257223563],\n" +
+ " Scope[“Satellite navigation.”],\n" +
" Id[“EPSG”, 6326]],\n" +
" PrimeMeridian[“Greenwich”, 0.0, Id[“EPSG”, 8901]],\n" +
" CS[“Cartesian”, 3],\n" +
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java [UTF-8] Sun May 3 21:14:32 2015
@@ -43,7 +43,7 @@ import static org.apache.sis.test.Assert
})
public final strictfp class DefaultGeodeticCRSTest extends XMLTestCase {
/**
- * An XML file in this package containing a Cartesian coordinate system definition.
+ * An XML file in this package containing a geodetic CRS definition.
*/
private static final String XML_FILE = "WGS 84.xml";
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] Sun May 3 21:14:32 2015
@@ -199,6 +199,7 @@ public final strictfp class DefaultGeogr
"GeodeticCRS[“WGS 84”,\n" +
" Datum[“World Geodetic System 1984”,\n" +
" Ellipsoid[“WGS84”, 6378137.0, 298.257223563],\n" +
+ " Scope[“Satellite navigation.”],\n" +
" Id[“EPSG”, 6326]],\n" +
" PrimeMeridian[“Greenwich”, 0.0, Id[“EPSG”, 8901]],\n" +
" CS[“ellipsoidal”, 2],\n" +
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Sun May 3 21:14:32 2015
@@ -19,8 +19,10 @@ package org.apache.sis.referencing.crs;
import javax.measure.unit.SI;
import javax.measure.unit.NonSI;
import javax.measure.unit.Unit;
+import javax.xml.bind.JAXBException;
import org.opengis.util.FactoryException;
import org.opengis.referencing.crs.ProjectedCRS;
+import org.opengis.test.Validators;
import org.apache.sis.referencing.cs.HardCodedCS;
import org.apache.sis.referencing.GeodeticObjectBuilder;
import org.apache.sis.metadata.iso.citation.Citations;
@@ -28,7 +30,7 @@ import org.apache.sis.internal.util.Cons
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 org.apache.sis.test.MetadataAssert.*;
@@ -45,7 +47,12 @@ import static org.apache.sis.test.Metada
@DependsOn({
DefaultGeographicCRSTest.class
})
-public final strictfp class DefaultProjectedCRSTest extends TestCase {
+public final strictfp class DefaultProjectedCRSTest extends XMLTestCase {
+ /**
+ * An XML file in this package containing a projected CRS definition.
+ */
+ private static final String XML_FILE = "NTF.xml";
+
/**
* Creates the "NTF (Paris) / Lambert zone II" CRS.
*
@@ -73,6 +80,7 @@ public final strictfp class DefaultProje
@Test
public void testWKT1() throws FactoryException {
final ProjectedCRS crs = create();
+ Validators.validate(crs);
assertWktEquals(Convention.WKT1,
"PROJCS[“NTF (Paris) / Lambert zone II”,\n" +
" GEOGCS[“NTF (Paris)”,\n" +
@@ -124,4 +132,22 @@ public final strictfp class DefaultProje
" Id[“EPSG”, 27572, Citation[“IOGP”], URI[“urn:ogc:def:crs:EPSG::27572”]]]",
crs);
}
+
+ /**
+ * Tests (un)marshalling of a projected coordinate reference system.
+ *
+ * @throws FactoryException if the CRS creation failed.
+ * @throws JAXBException If an error occurred during (un)marshalling.
+ */
+ @Test
+ @org.junit.Ignore("Still missing some JAXB annotations.")
+ public void testXML() throws FactoryException, JAXBException {
+ final DefaultProjectedCRS crs = unmarshalFile(DefaultProjectedCRS.class, XML_FILE);
+ Validators.validate(crs);
+ assertEquals("scope", "Large and medium scale topographic mapping and engineering survey.", crs.getScope().toString());
+ /*
+ * Marshal and compare with the original file.
+ */
+ assertMarshalEqualsFile(XML_FILE, crs, "xmlns:*", "xsi:schemaLocation");
+ }
}
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java [UTF-8] Sun May 3 21:14:32 2015
@@ -27,7 +27,7 @@ import org.apache.sis.referencing.NamedI
import org.apache.sis.internal.referencing.VerticalDatumTypes;
import org.apache.sis.metadata.iso.citation.HardCodedCitations;
-import static org.opengis.referencing.IdentifiedObject.*;
+import static org.opengis.referencing.datum.Datum.*;
/**
@@ -43,7 +43,8 @@ public final strictfp class HardCodedDat
* Greenwich meridian (EPSG:8901), with angular measurements in decimal degrees.
*/
public static final DefaultPrimeMeridian GREENWICH = new DefaultPrimeMeridian(
- properties("Greenwich", "8901"), 0, NonSI.DEGREE_ANGLE);
+ properties("Greenwich", "8901", null),
+ 0, NonSI.DEGREE_ANGLE);
/**
* Paris meridian (EPSG:8903), with angular measurements in grad.
@@ -51,7 +52,8 @@ public final strictfp class HardCodedDat
* @since 0.5
*/
public static final DefaultPrimeMeridian PARIS = new DefaultPrimeMeridian(
- properties("Paris", "8903"), 2.5969213, NonSI.GRADE);
+ properties("Paris", "8903", null),
+ 2.5969213, NonSI.GRADE);
/**
* Old Paris meridian (EPSG:8914) defined as 2°20'13.95"E.
@@ -63,14 +65,15 @@ public final strictfp class HardCodedDat
* @since 0.5
*/
public static final DefaultPrimeMeridian PARIS_RGS = new DefaultPrimeMeridian(
- properties("Paris RGS", "8914"), 2 + (20 + 13.95/60)/60, NonSI.DEGREE_ANGLE);
+ properties("Paris RGS", "8914", null),
+ 2 + (20 + 13.95/60)/60, NonSI.DEGREE_ANGLE);
/**
* WGS 1984 datum (EPSG:6326). Prime meridian is Greenwich.
* This datum is used in GPS systems.
*/
public static final DefaultGeodeticDatum WGS84 = new DefaultGeodeticDatum(
- properties("World Geodetic System 1984", "6326"),
+ properties("World Geodetic System 1984", "6326", "Satellite navigation."),
new DefaultEllipsoid(GeodeticDatumMock.WGS84.getEllipsoid()), GREENWICH);
/**
@@ -80,7 +83,7 @@ public final strictfp class HardCodedDat
* Earth Gravitational Model}.
*/
public static final DefaultGeodeticDatum WGS72 = new DefaultGeodeticDatum(
- properties("World Geodetic System 1972", "6322"),
+ properties("World Geodetic System 1972", "6322", "Satellite navigation."),
new DefaultEllipsoid(GeodeticDatumMock.WGS84.getEllipsoid()), GREENWICH);
/**
@@ -89,62 +92,70 @@ public final strictfp class HardCodedDat
* @since 0.5
*/
public static final DefaultGeodeticDatum NTF = new DefaultGeodeticDatum(
- properties("Nouvelle Triangulation Française", "6807"),
+ properties("Nouvelle Triangulation Française", "6807", "Topographic mapping."),
new DefaultEllipsoid(GeodeticDatumMock.NTF.getEllipsoid()), PARIS);
/**
* Spherical datum based on GRS 1980 Authalic Sphere (EPSG:6047). Prime meridian is Greenwich.
*/
public static final DefaultGeodeticDatum SPHERE = new DefaultGeodeticDatum(
- properties("Not specified (based on GRS 1980 Authalic Sphere)", "6047"),
+ properties("Not specified (based on GRS 1980 Authalic Sphere)", "6047", "Not a valid datum."),
new DefaultEllipsoid(GeodeticDatumMock.SPHERE.getEllipsoid()), GREENWICH);
/**
* Mean sea level, which can be used as an approximation of geoid.
*/
public static final DefaultVerticalDatum MEAN_SEA_LEVEL = new DefaultVerticalDatum(
- properties("Mean Sea Level", "5100"), VerticalDatumType.GEOIDAL);
+ properties("Mean Sea Level", "5100", "Hydrography."),
+ VerticalDatumType.GEOIDAL);
/**
* Ellipsoid for measurements of height above the ellipsoid.
* This is not a valid datum according ISO 19111, but is used by Apache SIS for internal calculation.
*/
public static final DefaultVerticalDatum ELLIPSOID = new DefaultVerticalDatum(
- properties("Ellipsoid", null), VerticalDatumTypes.ELLIPSOIDAL);
+ properties("Ellipsoid", null, "Not a valid datum."),
+ VerticalDatumTypes.ELLIPSOIDAL);
/**
* Default datum for time measured since January 1st, 1970 at 00:00 UTC.
*/
public static final DefaultTemporalDatum UNIX = new DefaultTemporalDatum(
- properties("UNIX", null), new Date(0));
+ properties("UNIX", null, null),
+ new Date(0));
/**
* Default datum for time measured since November 17, 1858 at 00:00 UTC.
*/
public static final DefaultTemporalDatum MODIFIED_JULIAN = new DefaultTemporalDatum(
- properties("Modified Julian", null), new Date(-40587 * (24*60*60*1000L)));
+ properties("Modified Julian", null, null),
+ new Date(-40587 * (24*60*60*1000L)));
/**
* Image with {@link PixelInCell#CELL_CENTER}.
*/
public static final DefaultImageDatum IMAGE = new DefaultImageDatum(
- properties("Image", null), PixelInCell.CELL_CENTER);
+ properties("Image", null, null),
+ PixelInCell.CELL_CENTER);
/**
* An engineering datum for unknown coordinate reference system. Such CRS are usually
* assumed Cartesian, but will not have any transformation path to other CRS.
*/
- public static final DefaultEngineeringDatum UNKNOWN = new DefaultEngineeringDatum(properties("Unknown", null));
+ public static final DefaultEngineeringDatum UNKNOWN = new DefaultEngineeringDatum(properties("Unknown", null, null));
/**
* Creates a map of properties for the given name and EPSG code.
*/
- private static Map<String,?> properties(final String name, final String code) {
+ private static Map<String,?> properties(final String name, final String code, final String scope) {
final Map<String,Object> properties = new HashMap<>(4);
properties.put(NAME_KEY, name);
if (code != null) {
properties.put(IDENTIFIERS_KEY, new NamedIdentifier(HardCodedCitations.EPSG, code));
}
+ if (scope != null) {
+ properties.put(SCOPE_KEY, scope);
+ }
return properties;
}
Added: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml?rev=1677485&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml (added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml Sun May 3 21:14:32 2015
@@ -0,0 +1,149 @@
+<?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:ProjectedCRS 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"
+ xmlns:xlink = "http://www.w3.org/1999/xlink"
+ gml:id = "epsg-crs-27572">
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::27572</gml:identifier>
+ <gml:name codeSpace="EPSG">NTF (Paris) / Lambert zone II</gml:name>
+ <gml:scope>Large and medium scale topographic mapping and engineering survey.</gml:scope>
+ <gml:conversion>
+ <gml:Conversion gml:id="LambertzoneII">
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:coordinateOperation:EPSG::18082</gml:identifier>
+ <gml:name codeSpace="EPSG">Lambert zone II</gml:name>
+ <gml:scope>Large and medium scale topographic mapping and engineering survey.</gml:scope>
+ <gml:method xlink:href="urn:ogc:def:method:EPSG::9801"/>
+ <gml:parameterValue>
+ <gml:ParameterValue>
+ <gml:value uom="urn:ogc:def:uom:EPSG::9105">52</gml:value>
+ <gml:operationParameter xlink:href="urn:ogc:def:parameter:EPSG::8801"/>
+ </gml:ParameterValue>
+ </gml:parameterValue>
+ <gml:parameterValue>
+ <gml:ParameterValue>
+ <gml:value uom="urn:ogc:def:uom:EPSG::9105">0</gml:value>
+ <gml:operationParameter xlink:href="urn:ogc:def:parameter:EPSG::8802"/>
+ </gml:ParameterValue>
+ </gml:parameterValue>
+ <gml:parameterValue>
+ <gml:ParameterValue>
+ <gml:value uom="urn:ogc:def:uom:EPSG::9201">0.99987742</gml:value>
+ <gml:operationParameter xlink:href="urn:ogc:def:parameter:EPSG::8805"/>
+ </gml:ParameterValue>
+ </gml:parameterValue>
+ <gml:parameterValue>
+ <gml:ParameterValue>
+ <gml:value uom="urn:ogc:def:uom:EPSG::9001">600000</gml:value>
+ <gml:operationParameter xlink:href="urn:ogc:def:parameter:EPSG::8806"/>
+ </gml:ParameterValue>
+ </gml:parameterValue>
+ <gml:parameterValue>
+ <gml:ParameterValue>
+ <gml:value uom="urn:ogc:def:uom:EPSG::9001">2200000</gml:value>
+ <gml:operationParameter xlink:href="urn:ogc:def:parameter:EPSG::8807"/>
+ </gml:ParameterValue>
+ </gml:parameterValue>
+ </gml:Conversion>
+ </gml:conversion>
+ <gml:baseGeodeticCRS>
+ <gml:GeodeticCRS gml:id="epsg-crs-4807">
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4807</gml:identifier>
+ <gml:name>NTF (Paris)</gml:name>
+ <gml:scope>Geodetic survey.</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:minimumValue>-90</gml:minimumValue>
+ <gml:maximumValue>+90</gml:maximumValue>
+ <gml:rangeMeaning codeSpace="EPSG">exact</gml:rangeMeaning>
+ </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:minimumValue>-180</gml:minimumValue>
+ <gml:maximumValue>+180</gml:maximumValue>
+ <gml:rangeMeaning codeSpace="EPSG">wraparound</gml:rangeMeaning>
+ </gml:CoordinateSystemAxis>
+ </gml:axis>
+ </gml:EllipsoidalCS>
+ </gml:ellipsoidalCS>
+ <gml:geodeticDatum>
+ <gml:GeodeticDatum gml:id="epsg-datum-6807">
+ <gml:identifier codeSpace="EPSG">urn:ogc:def:datum:EPSG::6807</gml:identifier>
+ <gml:name>Nouvelle Triangulation Française</gml:name>
+ <gml:scope>Topographic mapping.</gml:scope>
+ <gml:primeMeridian>
+ <gml:PrimeMeridian gml:id="epsg-meridian-8903">
+ <gml:identifier codeSpace="EPSG">urn:ogc:def:meridian:EPSG::8903</gml:identifier>
+ <gml:name>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.0</gml:semiMinorAxis>
+ </gml:SecondDefiningParameter>
+ </gml:secondDefiningParameter>
+ </gml:Ellipsoid>
+ </gml:ellipsoid>
+ </gml:GeodeticDatum>
+ </gml:geodeticDatum>
+ </gml:GeodeticCRS>
+ </gml:baseGeodeticCRS>
+ <gml:cartesianCS>
+ <gml:CartesianCS gml:id="epsg-cs-4400">
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:cs:EPSG::4400</gml:identifier>
+ <gml:name>Easting, Northing</gml:name>
+ <gml:axis>
+ <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="Easting">
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:axis:EPSG::1</gml:identifier>
+ <gml:name>Easting</gml:name>
+ <gml:axisAbbrev>E</gml:axisAbbrev>
+ <gml:axisDirection codeSpace="EPSG">east</gml:axisDirection>
+ </gml:CoordinateSystemAxis>
+ </gml:axis>
+ <gml:axis>
+ <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="Northing">
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:axis:EPSG::2</gml:identifier>
+ <gml:name>Northing</gml:name>
+ <gml:axisAbbrev>N</gml:axisAbbrev>
+ <gml:axisDirection codeSpace="EPSG">north</gml:axisDirection>
+ </gml:CoordinateSystemAxis>
+ </gml:axis>
+ </gml:CartesianCS>
+ </gml:cartesianCS>
+</gml:ProjectedCRS>
Propchange: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/NTF.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS%2084.xml?rev=1677485&r1=1677484&r2=1677485&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml Sun May 3 21:14:32 2015
@@ -18,11 +18,11 @@
under the License.
-->
<gml:GeodeticCRS 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:gmd = "http://www.isotc211.org/2005/gmd"
- xmlns:gco = "http://www.isotc211.org/2005/gco"
- xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
- gml:id = "epsg-crs-4326">
+ 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"
+ gml:id = "epsg-crs-4326">
<gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
<gml:name>WGS 84</gml:name>