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/17 16:46:54 UTC
svn commit: r1674331 [3/3] - in /sis/branches/JDK6: ./
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ ...
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -109,6 +109,9 @@ public final strictfp class BuilderTest
final LocalName alias1 = factory.createLocalName(null, "Mercator (1SP)");
final LocalName alias2 = factory.createLocalName(null, "Mercator_1SP");
final LocalName alias3 = factory.createLocalName(null, "CT_Mercator");
+ assertTrue("That name should not have a scope.", alias1.scope().isGlobal());
+ assertTrue("That name should not have a scope.", alias2.scope().isGlobal());
+ assertTrue("That name should not have a scope.", alias3.scope().isGlobal());
assertEquals("Mercator (1SP)", alias1.toString());
assertEquals("Mercator_1SP", alias2.toString());
assertEquals("CT_Mercator", alias3.toString());
@@ -162,10 +165,13 @@ public final strictfp class BuilderTest
final GenericName alias1 = factory.createLocalName(scope(factory, "EPSG"), "Mercator (1SP)");
final GenericName alias2 = new NamedIdentifier(OGC, "Mercator_1SP");
final GenericName alias3 = new NamedIdentifier(GEOTIFF, "CT_Mercator");
+ assertTrue ("That name should not have a scope.", alias3.scope().isGlobal());
+ assertTrue ("That name should not have a scope.", alias2.scope().isGlobal());
+ assertFalse("That name should be in EPSG scope.", alias1.scope().isGlobal());
+ assertEquals("EPSG", alias1.scope().name().toString());
assertEquals("Mercator (1SP)", alias1.toString());
assertEquals("OGC:Mercator_1SP", alias2.toString());
assertEquals("GeoTIFF:CT_Mercator", alias3.toString());
- assertEquals("EPSG", alias1.scope().name().toString());
// The test.
final BuilderMock builder = createMercator(true, false);
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -39,12 +39,12 @@ import static org.apache.sis.metadata.is
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.4
+ * @version 0.6
* @module
*/
public final strictfp class NamedIdentifierTest extends TestCase {
/**
- * Tests the {@link NamedIdentifier#NamedIdentifier(Citation, String, String, String, InternationalString)}
+ * Tests the {@link NamedIdentifier#NamedIdentifier(Citation, String, CharSequence, String, InternationalString)}
* constructor.
*/
@Test
@@ -58,19 +58,14 @@ public final strictfp class NamedIdentif
assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
assertSame ("authority", IOGP, identifier.getAuthority());
assertEquals("version", "8.3", identifier.getVersion());
- assertNull ("remarks", identifier.getRemarks());
- assertFalse ("isDeprecated", identifier.isDeprecated());
+ assertNull ("description", identifier.getDescription());
// NamedIdentifier properties
assertEquals("depth", 2, identifier.depth());
assertEquals("tip", "4326", identifier.tip().toString());
assertEquals("head", "EPSG", identifier.head().toString());
assertEquals("name", "EPSG:4326", identifier.toString());
-
- // Scope (derived from the autority)
- final NameSpace scope = identifier.scope();
- assertFalse ("scope", scope.isGlobal());
- assertEquals("scope", "IOGP", scope.name().toString());
+ assertTrue ("scope.isGlobal", identifier.scope().isGlobal());
}
/**
@@ -89,8 +84,7 @@ public final strictfp class NamedIdentif
assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
assertEquals("authority", "IOGP", identifier.getAuthority().getTitle().toString());
assertNull ("version", identifier.getVersion());
- assertNull ("remarks", identifier.getRemarks());
- assertFalse ("isDeprecated", identifier.isDeprecated());
+ assertNull ("description", identifier.getDescription());
// NamedIdentifier properties
assertEquals("depth", 2, identifier.depth());
@@ -98,6 +92,8 @@ public final strictfp class NamedIdentif
assertEquals("head", "EPSG", identifier.head().toString());
assertEquals("name", "EPSG:4326", identifier.toString());
assertSame ("scope", scope, identifier.scope());
+ assertFalse ("scope.isGlobal", scope.isGlobal());
+ assertEquals("scope", "IOGP", scope.name().toString());
}
/**
@@ -126,8 +122,7 @@ public final strictfp class NamedIdentif
assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
assertSame ("authority", EPSG, identifier.getAuthority());
assertNull ("version", identifier.getVersion());
- assertNull ("remarks", identifier.getRemarks());
- assertFalse ("isDeprecated", identifier.isDeprecated());
+ assertNull ("description", identifier.getDescription());
// NamedIdentifier properties
assertEquals("depth", 2, identifier.depth());
@@ -138,11 +133,7 @@ public final strictfp class NamedIdentif
assertEquals("name", "EPSG:name", identifier.toInternationalString().toString(Locale.ENGLISH));
assertEquals("name", "EPSG:nom", identifier.toInternationalString().toString(Locale.FRENCH));
assertEquals("name", "EPSG:名前", identifier.toInternationalString().toString(Locale.JAPANESE));
-
- // Scope (derived from the autority)
- final NameSpace scope = identifier.scope();
- assertFalse ("scope", scope.isGlobal());
- assertEquals("scope", "EPSG", scope.name().toString());
+ assertTrue ("scope.isGlobal", identifier.scope().isGlobal());
}
/**
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -95,14 +95,26 @@ public final strictfp class GeneralMatri
}
/**
- * Tests {@link MatrixSIS#concatenate(int, Number, Number)} using {@link AffineTranform}
+ * Tests {@link MatrixSIS#convertBefore(int, Number, Number)} using {@link AffineTranform}
* as a reference implementation.
*
* @since 0.6
*/
@Test
- public void testConcatenate() {
- testConcatenate(new GeneralMatrix(3, 3, true, 1), true); // Double precision
- testConcatenate(new GeneralMatrix(3, 3, true, 2), true); // Double-double precision
+ public void testConvertBefore() {
+ testConvertBefore(new GeneralMatrix(3, 3, true, 1), true); // Double precision
+ testConvertBefore(new GeneralMatrix(3, 3, true, 2), true); // Double-double precision
+ }
+
+ /**
+ * Tests {@link MatrixSIS#convertAfter(int, Number, Number)} using {@link AffineTranform}
+ * as a reference implementation.
+ *
+ * @since 0.6
+ */
+ @Test
+ public void testConvertAfter() {
+ testConvertAfter(new GeneralMatrix(3, 3, true, 1)); // Double precision
+ testConvertAfter(new GeneralMatrix(3, 3, true, 2)); // Double-double precision
}
}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix3Test.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix3Test.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix3Test.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix3Test.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -102,13 +102,24 @@ public final strictfp class Matrix3Test
}
/**
- * Tests {@link MatrixSIS#concatenate(int, Number, Number)} using {@link AffineTranform}
+ * Tests {@link MatrixSIS#convertBefore(int, Number, Number)} using {@link AffineTranform}
* as a reference implementation.
*
* @since 0.6
*/
@Test
- public void testConcatenate() {
- testConcatenate(new Matrix3(), true);
+ public void testConvertBefore() {
+ testConvertBefore(new Matrix3(), true);
+ }
+
+ /**
+ * Tests {@link MatrixSIS#convertAfter(int, Number, Number)} using {@link AffineTranform}
+ * as a reference implementation.
+ *
+ * @since 0.6
+ */
+ @Test
+ public void testConvertAfter() {
+ testConvertAfter(new Matrix3());
}
}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -397,9 +397,9 @@ public abstract strictfp class MatrixTes
}
/**
- * Tests {@link MatrixSIS#concatenate(int, Number, Number)} using {@link AffineTranform}
+ * Tests {@link MatrixSIS#convertBefore(int, Number, Number)} using {@link AffineTranform}
* as a reference implementation. This test can be run only with matrices of size 3×3.
- * Consequently it is sub-classes responsibility to add a {@code testConcatenate()} method
+ * Consequently it is sub-classes responsibility to add a {@code testConvertBefore()} method
* which invoke this method.
*
* @param matrix The matrix of size 3×3 to test.
@@ -408,7 +408,7 @@ public abstract strictfp class MatrixTes
*
* @since 0.6
*/
- final void testConcatenate(final MatrixSIS matrix, final boolean withShear) {
+ final void testConvertBefore(final MatrixSIS matrix, final boolean withShear) {
initialize(4599164481916500056L);
final AffineTransform at = new AffineTransform();
if (withShear) {
@@ -445,19 +445,60 @@ public abstract strictfp class MatrixTes
/*
* Apply the operation and compare with our reference implementation.
*/
- matrix.concatenate(srcDim, scale, offset);
- final String message = (offset == null) ? "After scale" :
- (scale == null) ? "After translate" : "After scale and translate";
- assertEqualsRelative(message, 0, matrix, 2, 0);
- assertEqualsRelative(message, 0, matrix, 2, 1);
- assertEqualsRelative(message, 1, matrix, 2, 2);
- assertEqualsRelative(message, at.getTranslateX(), matrix, 0, 2);
- assertEqualsRelative(message, at.getTranslateY(), matrix, 1, 2);
- assertEqualsRelative(message, at.getScaleX(), matrix, 0, 0);
- assertEqualsRelative(message, at.getScaleY(), matrix, 1, 1);
- assertEqualsRelative(message, at.getShearX(), matrix, 0, 1);
- assertEqualsRelative(message, at.getShearY(), matrix, 1, 0);
- assertTrue("isAffine", matrix.isAffine());
+ matrix.convertBefore(srcDim, scale, offset);
+ assertCoefficientsEqual(at, matrix);
+ }
+ }
+
+ /**
+ * Asserts that the given matrix has approximatively the same coefficients than the given affine transform.
+ */
+ private static void assertCoefficientsEqual(final AffineTransform at, final MatrixSIS matrix) {
+ assertEqualsRelative("m20", 0, matrix, 2, 0);
+ assertEqualsRelative("m21", 0, matrix, 2, 1);
+ assertEqualsRelative("m22", 1, matrix, 2, 2);
+ assertEqualsRelative("translateX", at.getTranslateX(), matrix, 0, 2);
+ assertEqualsRelative("translateY", at.getTranslateY(), matrix, 1, 2);
+ assertEqualsRelative("scaleX", at.getScaleX(), matrix, 0, 0);
+ assertEqualsRelative("scaleY", at.getScaleY(), matrix, 1, 1);
+ assertEqualsRelative("shearX", at.getShearX(), matrix, 0, 1);
+ assertEqualsRelative("shearY", at.getShearY(), matrix, 1, 0);
+ assertTrue("isAffine", matrix.isAffine());
+ }
+
+ /**
+ * Tests {@link MatrixSIS#convertAfter(int, Number, Number)} using {@link AffineTranform}
+ * as a reference implementation. This test can be run only with matrices of size 3×3.
+ * Consequently it is sub-classes responsibility to add a {@code testConvertAfter()} method
+ * which invoke this method.
+ *
+ * @param matrix The matrix of size 3×3 to test.
+ *
+ * @since 0.6
+ */
+ final void testConvertAfter(final MatrixSIS matrix) {
+ initialize(6501103578268988251L);
+ final AffineTransform pre = new AffineTransform();
+ final AffineTransform at = AffineTransform.getShearInstance(nextNonZeroRandom(), nextNonZeroRandom());
+ matrix.setElement(0, 1, at.getShearX());
+ matrix.setElement(1, 0, at.getShearY());
+ for (int i=0; i<30; i++) {
+ final Number scale = nextNonZeroRandom();
+ final Number offset = nextNonZeroRandom();
+ final int tgtDim = (i & 1);
+ switch (tgtDim) {
+ default: pre.setToIdentity();
+ break;
+ case 0: pre.setToTranslation(offset.doubleValue(), 0);
+ pre.scale(scale.doubleValue(), 1);
+ break;
+ case 1: pre.setToTranslation(0, offset.doubleValue());
+ pre.scale(1, scale.doubleValue());
+ break;
+ }
+ at.preConcatenate(pre);
+ matrix.convertAfter(tgtDim, scale, offset);
+ assertCoefficientsEqual(at, matrix);
}
}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -118,7 +118,7 @@ public final strictfp class Equirectangu
*/
@Test
public void testRandomPoints() throws FactoryException, TransformException {
- initialize(new Equirectangular(), true, true, false);
+ initialize(new Equirectangular(), true, false, true, false);
tolerance = Formulas.LINEAR_TOLERANCE; // Not NORMALIZED_TOLERANCE since this is not a NormalizedProjection.
derivativeDeltas = new double[] {100, 100};
verifyInDomain(CoordinateDomain.GEOGRAPHIC, 0);
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -28,6 +28,9 @@ import org.apache.sis.referencing.operat
import org.apache.sis.test.mock.MathTransformFactoryMock;
import org.apache.sis.test.mock.GeodeticDatumMock;
+import static java.lang.StrictMath.*;
+import static org.junit.Assert.*;
+
/**
* Base class of map projection tests.
@@ -80,13 +83,18 @@ strictfp class MapProjectionTestCase ext
* the chances to detect a mismatch.
*/
final void initialize(final DefaultOperationMethod provider, final boolean ellipse,
- final boolean hasStandardParallel, final boolean hasScaleFactor)
+ final boolean hasLatitudeOfOrigin,
+ final boolean hasStandardParallel,
+ final boolean hasScaleFactor)
throws FactoryException
{
final Parameters parameters = parameters(provider, ellipse);
parameters.parameter(Constants.CENTRAL_MERIDIAN).setValue(0.5, NonSI.DEGREE_ANGLE);
parameters.parameter(Constants.FALSE_EASTING) .setValue(200);
parameters.parameter(Constants.FALSE_NORTHING) .setValue(100);
+ if (hasLatitudeOfOrigin) {
+ parameters.parameter("latitude_of_origin").setValue(40);
+ }
if (hasStandardParallel) {
parameters.parameter(Constants.STANDARD_PARALLEL_1).setValue(20);
}
@@ -96,4 +104,52 @@ strictfp class MapProjectionTestCase ext
transform = new MathTransformFactoryMock(provider).createParameterizedTransform(parameters);
validate();
}
+
+ /**
+ * Projects the given latitude value. The longitude is fixed to zero.
+ * This method is useful for testing the behavior close to poles in a simple case.
+ *
+ * @param φ The latitude.
+ * @return The northing.
+ * @throws ProjectionException if the projection failed.
+ */
+ final double transform(final double φ) throws ProjectionException {
+ final double[] coordinate = new double[2];
+ coordinate[1] = φ;
+ ((NormalizedProjection) transform).transform(coordinate, 0, coordinate, 0, false);
+ final double y = coordinate[1];
+ if (!Double.isNaN(y) && !Double.isInfinite(y)) {
+ assertEquals(0, coordinate[0], tolerance);
+ }
+ return y;
+ }
+
+ /**
+ * Inverse projects the given northing value. The easting is fixed to zero.
+ * This method is useful for testing the behavior close to poles in a simple case.
+ *
+ * @param y The northing.
+ * @return The latitude.
+ * @throws ProjectionException if the projection failed.
+ */
+ final double inverseTransform(final double y) throws ProjectionException {
+ final double[] coordinate = new double[2];
+ coordinate[1] = y;
+ ((NormalizedProjection) transform).inverseTransform(coordinate, 0, coordinate, 0);
+ final double φ = coordinate[1];
+ if (!Double.isNaN(φ)) {
+ /*
+ * Opportunistically verify that the longitude is still zero. However the longitude value is meaningless
+ * at poles. We can not always use coordinate[0] for testing if we are at a pole because its calculation
+ * is not finished (the denormalization matrix has not yet been applied). In the particular case of SIS
+ * implementation, we observe sometime a ±180° rotation, which we ignore below. Such empirical hack is
+ * not rigorous, but it is not the purpose of this test to check the longitude value - we are doing only
+ * an opportunist check, other test methods will test longitude more accurately.
+ */
+ double λ = coordinate[0];
+ λ -= rint(λ / PI) * PI;
+ assertEquals(0, λ, tolerance);
+ }
+ return φ;
+ }
}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -78,45 +78,6 @@ public final strictfp class MercatorTest
}
/**
- * Projects the given latitude value. The longitude is fixed to zero.
- * This method is useful for testing the behavior close to poles in a simple case.
- *
- * @param φ The latitude.
- * @return The northing.
- * @throws ProjectionException if the projection failed.
- */
- private double transform(final double φ) throws ProjectionException {
- final double[] coordinate = new double[2];
- coordinate[1] = φ;
- ((NormalizedProjection) transform).transform(coordinate, 0, coordinate, 0, false);
- final double y = coordinate[1];
- if (!Double.isNaN(y) && !Double.isInfinite(y)) {
- assertEquals(0, coordinate[0], tolerance);
- }
- return y;
- }
-
- /**
- * Inverse projects the given northing value. The longitude is fixed to zero.
- * This method is useful for testing the behavior close to poles in a simple case.
- *
- * @param y The northing.
- * @return The latitude.
- * @throws ProjectionException if the projection failed.
- */
- private double inverseTransform(final double y) throws ProjectionException {
- final double[] coordinate = new double[2];
- coordinate[1] = y;
- ((NormalizedProjection) transform).inverseTransform(coordinate, 0, coordinate, 0);
- final double φ = coordinate[1];
- if (!Double.isNaN(φ)) {
- final double λ = coordinate[0];
- assertEquals(0, λ, tolerance);
- }
- return φ;
- }
-
- /**
* Tests the projection at some special latitudes (0, ±π/2, NaN).
*
* @throws ProjectionException Should never happen.
@@ -273,7 +234,7 @@ public final strictfp class MercatorTest
/*
* For some random points, compare the result of spherical formulas with the ellipsoidal ones.
*/
- initialize(new Mercator1SP(), false, false, true);
+ initialize(new Mercator1SP(), false, false, false, true);
tolerance = Formulas.LINEAR_TOLERANCE;
verifyInDomain(CoordinateDomain.GEOGRAPHIC_SAFE, 84018710);
}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -17,10 +17,10 @@
package org.apache.sis.referencing.operation.projection;
import java.util.Collections;
+import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.referencing.datum.Ellipsoid;
import org.opengis.referencing.operation.Matrix;
-import org.apache.sis.internal.referencing.provider.MapProjection;
import org.apache.sis.referencing.operation.DefaultOperationMethod;
import org.apache.sis.parameter.ParameterBuilder;
import org.apache.sis.parameter.Parameters;
@@ -57,9 +57,8 @@ final strictfp class NoOp extends Normal
private NoOp(final Parameters parameters) {
super(new DefaultOperationMethod(
Collections.singletonMap(DefaultOperationMethod.NAME_KEY, parameters.getDescriptor().getName()),
- 2, 2, parameters.getDescriptor()), parameters, null,
- MapProjection.SEMI_MAJOR, // Should actually by FALSE_EASTING, but we do not care for this test.
- MapProjection.SEMI_MINOR); // Should actually by FALSE_NORTHING, but we do not care for this test.
+ 2, 2, parameters.getDescriptor()), parameters,
+ Collections.<ParameterRole, ParameterDescriptor<Double>>emptyMap());
}
/**
Copied: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java (from r1674327, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java?p2=sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java&p1=sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java&r1=1674327&r2=1674331&rev=1674331&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -41,7 +41,7 @@ import org.apache.sis.util.Deprecable;
* @version 0.6
* @module
*/
-public abstract class HTMLGenerator implements AutoCloseable {
+public abstract class HTMLGenerator implements java.io.Closeable {
/**
* The encoding of the files to generate.
*/
@@ -91,7 +91,7 @@ public abstract class HTMLGenerator impl
if (file.exists()) {
throw new IOException("File " + file.getAbsolutePath() + " already exists.");
}
- openedTags = new ArrayDeque<>();
+ openedTags = new ArrayDeque<String>();
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), ENCODING));
out.write("<!DOCTYPE html>");
out.newLine();
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -102,6 +102,7 @@ import org.junit.BeforeClass;
org.apache.sis.referencing.operation.projection.NormalizedProjectionTest.class,
org.apache.sis.referencing.operation.projection.EquirectangularTest.class,
org.apache.sis.referencing.operation.projection.MercatorTest.class,
+ org.apache.sis.referencing.operation.projection.LambertConformalTest.class,
// Coordinate Reference System components.
org.apache.sis.referencing.datum.BursaWolfParametersTest.class,
Modified: sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS%2084.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/crs/WGS 84.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/CartesianCS.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/cs/EllipsoidalCS.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke%201880.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Clarke 1880.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Greenwich.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean%20Sea%20Level.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Mean Sea Level.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Paris.xml Fri Apr 17 14:46: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/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS%2084.xml?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/WGS 84.xml Fri Apr 17 14:46: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/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] Fri Apr 17 14:46: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/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -48,6 +48,7 @@ import org.opengis.util.InternationalStr
public interface Deprecable {
/**
* Returns {@code true} if this instance is deprecated.
+ * In such case, the {@linkplain #getRemarks() remarks} may contain information about the new object to use.
*
* @return {@code true} if this instance is deprecated.
*/
@@ -57,6 +58,8 @@ public interface Deprecable {
* If this instance is deprecated, the reason or the alternative to use.
* Otherwise, an optional free text.
*
+ * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
+ *
* @return Comments about this instance, or {@code null} if none. Shall be the
* reason for deprecation or the alternative to use if this instance
* {@linkplain #isDeprecated() is deprecated}.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -459,6 +459,11 @@ public final class Errors extends Indexe
public static final short KeyCollision_1 = 54;
/**
+ * Latitudes {0} and {1} are opposite.
+ */
+ public static final short LatitudesAreOpposite_2 = 183;
+
+ /**
* Attribute “{0}” is mandatory for an object of type ‘{1}’.
*/
public static final short MandatoryAttribute_2 = 55;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Fri Apr 17 14:46:52 2015
@@ -102,6 +102,7 @@ InfiniteArgumentValue_1 = Argu
InseparableTransform = Inseparable transform.
InsufficientArgumentSize_3 = Argument \u2018{0}\u2019 shall contain at least {1} elements. A number of {2} is insufficient.
KeyCollision_1 = A different value is already associated to the \u201c{0}\u201d key.
+LatitudesAreOpposite_2 = Latitudes {0} and {1} are opposite.
MandatoryAttribute_2 = Attribute \u201c{0}\u201d is mandatory for an object of type \u2018{1}\u2019.
MismatchedArrayLengths = Mismatched array lengths.
MismatchedCRS = The coordinate reference system must be the same for all objects.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Fri Apr 17 14:46:52 2015
@@ -92,6 +92,7 @@ InfiniteArgumentValue_1 = L\u2
InseparableTransform = La transformation n\u2019est pas s\u00e9parable.
InsufficientArgumentSize_3 = L\u2019argument \u2018{0}\u2019 doit contenir au moins {1} \u00e9l\u00e9ments. Un nombre de {2} est insuffisant.
KeyCollision_1 = Une valeur diff\u00e9rente est d\u00e9j\u00e0 associ\u00e9e \u00e0 la cl\u00e9 \u00ab\u202f{0}\u202f\u00bb.
+LatitudesAreOpposite_2 = Les latitudes {0} et {1} sont oppos\u00e9es.
MandatoryAttribute_2 = L\u2019attribut \u00ab\u202f{0}\u202f\u00bb est obligatoire pour un objet de type \u2018{1}\u2019.
MismatchedArrayLengths = Les dimensions des tableaux ne correspondent pas.
MismatchedCRS = Le syst\u00e8me de r\u00e9f\u00e9rence des coordonn\u00e9es doit \u00eatre le m\u00eame pour tous les objets.
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1674331&r1=1674330&r2=1674331&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] Fri Apr 17 14:46:52 2015
@@ -51,7 +51,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>
@@ -61,16 +61,16 @@ public final strictfp class CitationsTes
*/
@Test
@DependsOnMethod("testGetIdentifier")
- public void testGetUnicodeIdentifier() {
+ public void testGetCodeSpace() {
assumeTrue(Character.isIdentifierIgnorable('\u2060')
&& Character.isIdentifierIgnorable('\u200B'));
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()));
}
/**