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/04/09 18:22:53 UTC
svn commit: r1672408 - in /sis/branches/JDK8/core:
sis-metadata/src/main/java/org/apache/sis/metadata/iso/
sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/
sis-metadata/src/test/java/org/apache/sis/metadata/iso/
sis-referencing/src/main...
Author: desruisseaux
Date: Thu Apr 9 16:22:52 2015
New Revision: 1672408
URL: http://svn.apache.org/r1672408
Log:
Referencing: rename "OGP" as "IOGP" in XML files as well (SIS-196).
This action is taken after feedback from a member of EPSG group.
Modified:
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml
sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -355,7 +355,7 @@ public class ImmutableIdentifier extends
*/
value = properties.get(CODESPACE_KEY);
if (value == null && !properties.containsKey(CODESPACE_KEY)) {
- codeSpace = org.apache.sis.internal.util.Citations.getUnicodeIdentifier(authority);
+ codeSpace = org.apache.sis.internal.util.Citations.getCodeSpace(authority);
} else if (value instanceof String) {
codeSpace = trimWhitespaces((String) value);
} else {
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -76,7 +76,7 @@ public final class Citations extends Sta
* because of this name change and for avoiding confusion with {@link #EPSG} citation.
*/
@Deprecated
- public static final Citation OGP = new SimpleCitation("OGP");
+ public static final Citation OGP = new SimpleCitation("OGP"); // TODO: after removal, forName("OGP") should map to EPSG.
/**
* The <a href="http://www.epsg.org">EPSG</a> dataset. This citation is used as an authority for
@@ -92,6 +92,8 @@ public final class Citations extends Sta
*
* The citation {@linkplain DefaultCitation#getTitle() title} and contact information reference
* the IOGP organization, but the {@link IdentifierSpace#getName() namespace} is {@code "EPSG"}.
+ * Note that both the new "IOGP" and the legacy "OGP" abbreviations may be used as a code space
+ * in GML files.
*
* @see #AUTO
* @see #AUTO2
Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -24,6 +24,7 @@ import org.apache.sis.metadata.iso.citat
import org.apache.sis.metadata.iso.citation.DefaultCitation;
import org.apache.sis.metadata.iso.citation.HardCodedCitations;
import org.apache.sis.util.iso.SimpleInternationalString;
+import org.apache.sis.internal.util.Constants;
import org.apache.sis.io.wkt.Convention;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
@@ -131,13 +132,13 @@ public final strictfp class ImmutableIde
@DependsOnMethod("testConstructorWithStringValues")
public void testPredefinedCitation() {
final Map<String,Object> properties = properties();
- assertNotNull(properties.put(AUTHORITY_KEY, "EPSG"));
+ assertNotNull(properties.put(AUTHORITY_KEY, Constants.EPSG));
final ImmutableIdentifier identifier = new ImmutableIdentifier(properties);
Validators.validate(identifier);
assertEquals(CODE_KEY, "This is a code", identifier.getCode());
assertSame (AUTHORITY_KEY, Citations.EPSG, identifier.getAuthority());
- assertEquals(CODESPACE_KEY, "EPSG", identifier.getCodeSpace()); // Inferred from authority.
+ assertEquals(CODESPACE_KEY, Constants.EPSG, identifier.getCodeSpace()); // Inferred from authority.
assertEquals(VERSION_KEY, "This is a version", identifier.getVersion());
assertEquals("remarks", "There is remarks", identifier.getRemarks().toString(Locale.ENGLISH));
assertEquals("remarks_fr", "Voici des remarques", identifier.getRemarks().toString(Locale.FRENCH));
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -158,6 +158,13 @@ public final class Code {
final String urn = DefinitionURI.format(NameMeaning.toObjectType(type), fallback);
if (urn != null) {
final Code code = new Code();
+ /*
+ * Really getUnicodeIdentifier(…) below, not getCodeSpace(…). The reason is that the
+ * code space already appears in the URN string, and common usage found in GML files
+ * is to use the "codeSpace" attribute for the authority ("OGP" or "IOGP" for objects
+ * from the EPSG database). Consequently in the common case where the authority is our
+ * Citations.EPSG constant, we really want the "IOGP" string rather than "EPSG".
+ */
code.codeSpace = getUnicodeIdentifier(fallback.getAuthority());
code.code = urn;
return code;
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -307,7 +307,7 @@ public abstract class Builder<B extends
return new ImmutableIdentifier(authority, getCodeSpace(), identifier, getVersion(), null);
} else {
// Do not use the version information since it applies to the default authority rather than the given one.
- return new ImmutableIdentifier(authority, Citations.getUnicodeIdentifier(authority), identifier);
+ return new ImmutableIdentifier(authority, Citations.getCodeSpace(authority), identifier);
}
}
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -33,13 +33,11 @@ import org.opengis.metadata.Identifier;
import org.opengis.parameter.InvalidParameterValueException;
import org.apache.sis.internal.metadata.NameToIdentifier;
import org.apache.sis.internal.system.DefaultFactories;
-import org.apache.sis.metadata.iso.citation.Citations; // For javadoc
+import org.apache.sis.internal.util.Citations;
import org.apache.sis.metadata.iso.ImmutableIdentifier;
import org.apache.sis.util.collection.WeakValueHashMap;
import org.apache.sis.util.ArgumentChecks;
-import static org.apache.sis.internal.util.Citations.getUnicodeIdentifier;
-
// Branch-dependent imports
import java.util.Objects;
@@ -177,7 +175,7 @@ public class NamedIdentifier extends Imm
* the authority. The code can not be null.
*/
public NamedIdentifier(final Citation authority, final CharSequence code) {
- super(authority, getUnicodeIdentifier(authority), toString(code));
+ super(authority, Citations.getCodeSpace(authority), toString(code));
if (code instanceof InternationalString) {
name = createName(authority, code);
isNameSupplied = true; // Because 'code' is an international string.
@@ -257,7 +255,7 @@ public class NamedIdentifier extends Imm
*/
private GenericName createName(final Citation authority, final CharSequence code) {
final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
- final String identifier = getUnicodeIdentifier(authority); // Whitespaces trimed by Citations.
+ final String identifier = Citations.getCodeSpace(authority); // Whitespaces trimed by Citations.
NameSpace scope = null;
if (identifier != null) {
synchronized (SCOPES) {
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -215,9 +215,9 @@ public final strictfp class DefaultCarte
final CoordinateSystemAxis N = cs.getAxis(1);
assertEquals("name", "Easting, northing (E,N)", cs.getName().getCode());
assertEquals("remarks", "Used in ProjectedCRS.", cs.getRemarks().toString());
- assertIdentifierEquals( "identifier", "OGP", "EPSG", null, "4400", getSingleton(cs.getIdentifiers()));
- assertIdentifierEquals("axis[0].identifier", "OGP", "EPSG", null, "1", getSingleton(E.getIdentifiers()));
- assertIdentifierEquals("axis[1].identifier", "OGP", "EPSG", null, "2", getSingleton(N.getIdentifiers()));
+ assertIdentifierEquals( "identifier", "IOGP", "EPSG", null, "4400", getSingleton(cs.getIdentifiers()));
+ assertIdentifierEquals("axis[0].identifier", "IOGP", "EPSG", null, "1", getSingleton(E.getIdentifiers()));
+ assertIdentifierEquals("axis[1].identifier", "IOGP", "EPSG", null, "2", getSingleton(N.getIdentifiers()));
/*
* Marshal and compare with the original file.
*/
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -134,9 +134,9 @@ public final strictfp class DefaultEllip
final CoordinateSystemAxis λ = cs.getAxis(1);
assertEquals("name", "Latitude (north), Longitude (east)", cs.getName().getCode());
assertEquals("remarks", "Used in two-dimensional GeographicCRS.", cs.getRemarks().toString());
- assertIdentifierEquals( "identifier", "OGP", "EPSG", null, "6422", getSingleton(cs.getIdentifiers()));
- assertIdentifierEquals("axis[0].identifier", "OGP", "EPSG", null, "106", getSingleton(φ.getIdentifiers()));
- assertIdentifierEquals("axis[1].identifier", "OGP", "EPSG", null, "107", getSingleton(λ.getIdentifiers()));
+ assertIdentifierEquals( "identifier", "IOGP", "EPSG", null, "6422", getSingleton(cs.getIdentifiers()));
+ assertIdentifierEquals("axis[0].identifier", "IOGP", "EPSG", null, "106", getSingleton(φ.getIdentifiers()));
+ assertIdentifierEquals("axis[1].identifier", "IOGP", "EPSG", null, "107", getSingleton(λ.getIdentifiers()));
assertEquals("axis[0].abbreviation", "φ", φ.getAbbreviation());
assertEquals("axis[1].abbreviation", "λ", λ.getAbbreviation());
/*
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -268,18 +268,18 @@ public final strictfp class DefaultGeode
assertWktEquals(Convention.WKT2,
"Datum[“World Geodetic System 1984”,\n" +
" Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]],\n" +
- " Id[“EPSG”, 6326, Citation[“OGP”], URI[“urn:ogc:def:datum:EPSG::6326”]]]",
+ " Id[“EPSG”, 6326, Citation[“IOGP”], URI[“urn:ogc:def:datum:EPSG::6326”]]]",
datum);
assertWktEquals(Convention.INTERNAL,
"Datum[“World Geodetic System 1984”,\n" +
- " Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, Id[“EPSG”, 7030, Citation[“OGP”]],\n" +
+ " Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, Id[“EPSG”, 7030, Citation[“IOGP”]],\n" +
" Remarks[“Defining parameters cited in EPSG database.”]],\n" +
" Anchor[“Station coordinates changed by a few centimetres in 1994, 1997, 2002 and 2012.”],\n" +
" Scope[“Satellite navigation.”],\n" +
" Area[“World.”],\n" +
" BBox[-90.00, -180.00, 90.00, 180.00],\n" +
- " Id[“EPSG”, 6326, Citation[“OGP”]],\n" +
+ " Id[“EPSG”, 6326, Citation[“IOGP”]],\n" +
" Remarks[“No distinction between the original and subsequent WGS 84 frames.”]]",
datum);
}
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -150,13 +150,13 @@ public final strictfp class DefaultPrime
assertWktEquals(Convention.WKT1,
"PRIMEM[“Paris”, 2.33722917, AUTHORITY[“EPSG”, “8903”]]", pm);
assertWktEquals(Convention.WKT2,
- "PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“OGP”], URI[“urn:ogc:def:meridian:EPSG::8903”]]]", pm);
+ "PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“IOGP”], URI[“urn:ogc:def:meridian:EPSG::8903”]]]", pm);
assertWktEquals(Convention.INTERNAL,
- "PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“OGP”]],\n" +
+ "PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“IOGP”]],\n" +
" Remarks[“Equivalent to 2°20′14.025″.”]]", pm);
assertXmlEquals(
"<gml:PrimeMeridian xmlns:gml=\"" + Namespaces.GML + "\">\n" +
- " <gml:identifier codeSpace=\"OGP\">urn:ogc:def:meridian:EPSG::8903</gml:identifier>\n" +
+ " <gml:identifier codeSpace=\"IOGP\">urn:ogc:def:meridian:EPSG::8903</gml:identifier>\n" +
" <gml:name>Paris</gml:name>\n" +
" <gml:remarks>Equivalent to 2°20′14.025″.</gml:remarks>\n" +
" <gml:greenwichLongitude uom=\"urn:ogc:def:uom:EPSG::9105\">2.5969213</gml:greenwichLongitude>\n" +
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=1672408&r1=1672407&r2=1672408&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 Thu Apr 9 16:22:52 2015
@@ -24,16 +24,16 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-crs-4326">
- <gml:identifier codeSpace="OGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
<gml:name>WGS 84</gml:name>
<gml:scope>Horizontal component of 3D system.</gml:scope>
<gml:ellipsoidalCS>
<gml:EllipsoidalCS gml:id="epsg-cs-6422">
- <gml:identifier codeSpace="OGP">urn:ogc:def:cs:EPSG::6422</gml:identifier>
+ <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="OGP">urn:ogc:def:axis:EPSG::106</gml:identifier>
+ <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>
@@ -44,7 +44,7 @@
</gml:axis>
<gml:axis>
<gml:CoordinateSystemAxis gml:id="epsg-axis-107" uom="urn:ogc:def:uom:EPSG::9122">
- <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::107</gml:identifier>
+ <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>
@@ -57,19 +57,19 @@
</gml:ellipsoidalCS>
<gml:geodeticDatum>
<gml:GeodeticDatum gml:id="epsg-datum-6326">
- <gml:identifier codeSpace="EPSG">urn:ogc:def:datum:EPSG::6326</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::6326</gml:identifier>
<gml:name>World Geodetic System 1984</gml:name>
<gml:scope>Satellite navigation.</gml:scope>
<gml:primeMeridian>
<gml:PrimeMeridian gml:id = "epsg-meridian-8901">
- <gml:identifier codeSpace="OGP">urn:ogc:def:meridian:EPSG::8901</gml:identifier>
+ <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-7030">
- <gml:identifier codeSpace="OGP">urn:ogc:def:ellipsoid:EPSG::7030</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:ellipsoid:EPSG::7030</gml:identifier>
<gml:name>WGS 84</gml:name>
<gml:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9001">6378137.0</gml:semiMajorAxis>
<gml:secondDefiningParameter>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml Thu Apr 9 16:22:52 2015
@@ -23,12 +23,12 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-cs-4400">
- <gml:identifier codeSpace="OGP">urn:ogc:def:cs:EPSG::4400</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:cs:EPSG::4400</gml:identifier>
<gml:name>Easting, northing (E,N)</gml:name>
<gml:remarks>Used in ProjectedCRS.</gml:remarks>
<gml:axis>
<gml:CoordinateSystemAxis gml:id="epsg-axis-1" uom="urn:ogc:def:uom:EPSG::9001">
- <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::1</gml:identifier>
+ <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>
@@ -36,7 +36,7 @@
</gml:axis>
<gml:axis>
<gml:CoordinateSystemAxis gml:id="epsg-axis-2" uom="urn:ogc:def:uom:EPSG::9001">
- <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::2</gml:identifier>
+ <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>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml Thu Apr 9 16:22:52 2015
@@ -23,12 +23,12 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-cs-6422">
- <gml:identifier codeSpace="OGP">urn:ogc:def:cs:EPSG::6422</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:cs:EPSG::6422</gml:identifier>
<gml:name>Latitude (north), Longitude (east)</gml:name>
<gml:remarks>Used in two-dimensional GeographicCRS.</gml:remarks>
<gml:axis>
<gml:CoordinateSystemAxis gml:id="epsg-axis-106" uom="urn:ogc:def:uom:EPSG::9122">
- <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::106</gml:identifier>
+ <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>
@@ -39,7 +39,7 @@
</gml:axis>
<gml:axis>
<gml:CoordinateSystemAxis gml:id="epsg-axis-107" uom="urn:ogc:def:uom:EPSG::9122">
- <gml:identifier codeSpace="OGP">urn:ogc:def:axis:EPSG::107</gml:identifier>
+ <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>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke%201880.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml Thu Apr 9 16:22:52 2015
@@ -23,7 +23,7 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-ellipsoid-7055">
- <gml:identifier codeSpace="OGP">urn:ogc:def:ellipsoid:EPSG::7055</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:ellipsoid:EPSG::7055</gml:identifier>
<gml:name>Clarke 1880 (international foot)</gml:name>
<gml:remarks>Definition in feet assumed to be international foot.</gml:remarks>
<gml:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9002">20926202</gml:semiMajorAxis>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml Thu Apr 9 16:22:52 2015
@@ -23,7 +23,7 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-meridian-8901">
- <gml:identifier codeSpace="OGP">urn:ogc:def:meridian:EPSG::8901</gml:identifier>
+ <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>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean%20Sea%20Level.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml Thu Apr 9 16:22:52 2015
@@ -24,7 +24,7 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-datum-5100">
- <gml:identifier codeSpace="OGP">urn:ogc:def:datum:EPSG::5100</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::5100</gml:identifier>
<gml:name>Mean Sea Level</gml:name>
<gml:remarks>Approximates geoid.</gml:remarks>
<gml:domainOfValidity>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml Thu Apr 9 16:22:52 2015
@@ -23,7 +23,7 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-meridian-8903">
- <gml:identifier codeSpace="OGP">urn:ogc:def:meridian:EPSG::8903</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:meridian:EPSG::8903</gml:identifier>
<gml:name>Paris</gml:name>
<gml:remarks>Equivalent to 2°20â²14.025â³.</gml:remarks>
<gml:greenwichLongitude uom="urn:ogc:def:uom:EPSG::9105">2.5969213</gml:greenwichLongitude>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS%2084.xml?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml Thu Apr 9 16:22:52 2015
@@ -24,7 +24,7 @@
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
gml:id = "epsg-datum-6326">
- <gml:identifier codeSpace="OGP">urn:ogc:def:datum:EPSG::6326</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:datum:EPSG::6326</gml:identifier>
<gml:name>World Geodetic System 1984</gml:name>
<gml:remarks>No distinction between the original and subsequent WGS 84 frames.</gml:remarks>
<gml:domainOfValidity>
@@ -47,14 +47,14 @@
<gml:realizationEpoch>1984-01-01</gml:realizationEpoch>
<gml:primeMeridian>
<gml:PrimeMeridian gml:id = "epsg-meridian-8901">
- <gml:identifier codeSpace="OGP">urn:ogc:def:meridian:EPSG::8901</gml:identifier>
+ <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-7030">
- <gml:identifier codeSpace="OGP">urn:ogc:def:ellipsoid:EPSG::7030</gml:identifier>
+ <gml:identifier codeSpace="IOGP">urn:ogc:def:ellipsoid:EPSG::7030</gml:identifier>
<gml:name>WGS 84</gml:name>
<gml:remarks>Defining parameters cited in EPSG database.</gml:remarks>
<gml:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9001">6378137</gml:semiMajorAxis>
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -73,7 +73,7 @@ final class IdentifierMapEntry extends A
*/
@Override
public String getCodeSpace() {
- return Citations.getUnicodeIdentifier(getAuthority());
+ return Citations.getCodeSpace(getAuthority());
}
/**
@@ -110,7 +110,7 @@ final class IdentifierMapEntry extends A
Immutable(Citation authority, String code) {super(authority, code);}
@Override public Citation getAuthority() {return getKey();}
@Override public String getCode() {return getValue();}
- @Override public String getCodeSpace() {return Citations.getUnicodeIdentifier(getAuthority());}
+ @Override public String getCodeSpace() {return Citations.getCodeSpace(getAuthority());}
@Override public String getVersion() {return null;}
@Override public InternationalString getDescription() {return null;}
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -196,7 +196,7 @@ public final class SpecializedIdentifier
*/
@Override
public String getCodeSpace() {
- return Citations.getUnicodeIdentifier(authority);
+ return Citations.getCodeSpace(authority);
}
/**
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -102,7 +102,7 @@ public class SimpleIdentifier implements
*/
@Override
public String getCodeSpace() {
- return Citations.getUnicodeIdentifier(authority);
+ return Citations.getCodeSpace(authority);
}
/**
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -321,9 +321,6 @@ public final class Citations extends Sta
* @since 0.6
*/
public static String getUnicodeIdentifier(final Citation citation) {
- if (citation instanceof IdentifierSpace<?>) {
- return ((IdentifierSpace<?>) citation).getName();
- }
final String identifier = getIdentifier(citation, true);
if (identifier != null) {
/*
@@ -363,4 +360,24 @@ public final class Citations extends Sta
}
return identifier;
}
+
+ /**
+ * Infers a code space from the given citation, or returns {@code null} if none.
+ * This method is very close to {@link #getUnicodeIdentifier(Citation)}; its main difference is regarding
+ * the {@link org.apache.sis.metadata.iso.citation.Citations#EPSG} constant: this method returns "EPSG"
+ * instead than "IOGP".
+ *
+ * @param citation The citation for which to infer the code space, or {@code null}.
+ * @return A non-empty code space for the given citation without leading or trailing whitespaces,
+ * or {@code null} if the given citation is null or does not have any Unicode identifier or title.
+ *
+ * @since 0.6
+ */
+ public static String getCodeSpace(final Citation citation) {
+ if (citation instanceof IdentifierSpace<?>) {
+ return ((IdentifierSpace<?>) citation).getName();
+ } else {
+ return getUnicodeIdentifier(citation);
+ }
+ }
}
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1672408&r1=1672407&r2=1672408&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] Thu Apr 9 16:22:52 2015
@@ -50,7 +50,7 @@ public final strictfp class CitationsTes
}
/**
- * Tests {@link Citations#getUnicodeIdentifier(Citation)} with some ignorable characters.
+ * Tests {@link Citations#getCodeSpace(Citation)} with some ignorable characters.
* Ignorable character used in this test are:
*
* <ul>
@@ -60,14 +60,14 @@ public final strictfp class CitationsTes
*/
@Test
@DependsOnMethod("testGetIdentifier")
- public void testGetUnicodeIdentifier() {
+ public void testGetCodeSpace() {
final SimpleCitation citation = new SimpleCitation(" Valid\u2060Id\u200Bentifier ");
- assertEquals("ValidIdentifier", Citations.getUnicodeIdentifier(citation));
+ assertEquals("ValidIdentifier", Citations.getCodeSpace(citation));
assertNull("Shall not be taken as a valid identifier.",
- Citations.getUnicodeIdentifier(new SimpleCitation("Proj.4")));
+ Citations.getCodeSpace(new SimpleCitation("Proj.4")));
assertEquals("Shall fallback on the the identifier space name.",
- "TheProj4Space", Citations.getUnicodeIdentifier(new Proj4()));
+ "TheProj4Space", Citations.getCodeSpace(new Proj4()));
}
/**