This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 3eaf523bad5ee6674d129e90254bd14916253103 Author: Martin Desruisseaux <[email protected]> AuthorDate: Wed Mar 17 11:49:59 2021 +0100 Rename some `HardCodedCRS` constants for a more consistent pattern when saying which axis is first. --- .../sis/coverage/grid/GridDerivationTest.java | 22 +++++------- .../apache/sis/coverage/grid/GridGeometryTest.java | 6 ++-- .../coverage/grid/ResampledGridCoverageTest.java | 2 +- .../apache/sis/feature/EnvelopeOperationTest.java | 2 +- .../apache/sis/feature/FeatureOperationsTest.java | 10 +++--- .../sis/internal/feature/GeometriesTestCase.java | 2 +- .../sis/internal/filter/sqlmm/SQLMMTest.java | 18 +++++----- .../apache/sis/geometry/CoordinateFormatTest.java | 6 ++-- .../org/apache/sis/geometry/EnvelopesTest.java | 2 +- .../apache/sis/geometry/GeneralEnvelopeTest.java | 4 +-- .../referencing/DefinitionVerifierTest.java | 2 +- .../referencing/EllipsoidalHeightCombinerTest.java | 2 +- .../referencing/ReferencingUtilitiesTest.java | 2 +- .../java/org/apache/sis/referencing/CRSTest.java | 9 +++-- .../sis/referencing/GeodesicsOnEllipsoidTest.java | 2 +- .../sis/referencing/GeodeticCalculatorTest.java | 2 +- .../sis/referencing/IdentifiedObjectsTest.java | 4 +-- .../referencing/crs/DefaultCompoundCRSTest.java | 2 +- .../sis/referencing/crs/DefaultDerivedCRSTest.java | 2 +- .../apache/sis/referencing/crs/HardCodedCRS.java | 17 +++++---- .../sis/referencing/crs/HardCodedCRSTest.java | 20 +++++------ .../referencing/factory/AuthorityFactoryMock.java | 2 +- .../factory/MultiAuthoritiesFactoryTest.java | 40 +++++++++++----------- .../transform/WraparoundTransformTest.java | 8 ++--- .../org/apache/sis/storage/gdal/Proj4Test.java | 2 +- 25 files changed, 94 insertions(+), 96 deletions(-) diff --git a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridDerivationTest.java b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridDerivationTest.java index 45fb160..b6e16bc 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridDerivationTest.java +++ b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridDerivationTest.java @@ -94,7 +94,7 @@ public final strictfp class GridDerivationTest extends TestCase { * Creates a grid geometry with the given extent and scale for testing purpose. * An arbitrary translation of (2,3) is added to the "grid to CRS" conversion. */ - private static GridGeometry grid(int xmin, int ymin, int xmax, int ymax, int xScale, int yScale) throws TransformException { + private static GridGeometry grid(int xmin, int ymin, int xmax, int ymax, int xScale, int yScale) { GridExtent extent = new GridExtent(null, new long[] {xmin, ymin}, new long[] {xmax, ymax}, true); Matrix3 gridToCRS = new Matrix3(); gridToCRS.m00 = xScale; @@ -106,11 +106,9 @@ public final strictfp class GridDerivationTest extends TestCase { /** * Tests the construction from grid geometries having a linear "grid to CRS" conversion. - * - * @throws TransformException if an error occurred while computing the grid geometry. */ @Test - public void testSubgridFromOtherGrid() throws TransformException { + public void testSubgridFromOtherGrid() { GridGeometry source = grid( 10, -20, 110, 180, 100, -300); // Envelope x: [1200 … 11300] y: [-53800 … 6500] GridGeometry target = grid(2000, -1000, 9000, 8000, 2, -1); // Envelope x: [4200 … 18202] y: [ -7501 … 1500] GridDerivation change = target.derive().subgrid(source); // Envelope x: [4200 … 11300] y: [ -7501 … 1500] @@ -186,7 +184,7 @@ public final strictfp class GridDerivationTest extends TestCase { @Test @DependsOnMethod("testSubExtent") public void testSubgridFromEnvelope() throws TransformException { - final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); envelope.setRange(0, -70, +80); envelope.setRange(1, 5, 15); final MathTransform gridToCRS = MathTransforms.linear(new Matrix3( @@ -237,13 +235,11 @@ public final strictfp class GridDerivationTest extends TestCase { * Tests {@link GridDerivation#subgrid(Envelope, double...)} using an envelope in a CRS different than the * grid geometry CRS. This test constructs the same grid geometry than {@link #testSubgridFromEnvelope()} * and tests the same request with only axis order flipped. - * - * @throws TransformException if an error occurred during computation. */ @Test @DependsOnMethod("testSubgridFromEnvelope") - public void testSubgridFromEnvelopeDifferentCRS() throws TransformException { - final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + public void testSubgridFromEnvelopeDifferentCRS() { + final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); envelope.setRange(0, -70, +80); envelope.setRange(1, 5, 15); final MathTransform gridToCRS = MathTransforms.linear(new Matrix3( @@ -262,13 +258,13 @@ public final strictfp class GridDerivationTest extends TestCase { envelope.setRange(1, -50, +30); envelope.setRange(0, 8, 12); grid = grid.derive().subgrid(envelope, 2, 1).build(); - assertSame(HardCodedCRS.WGS84_φλ, grid.getCoordinateReferenceSystem()); + assertSame(HardCodedCRS.WGS84_LATITUDE_FIRST, grid.getCoordinateReferenceSystem()); assertExtentEquals(new long[] {94, 40}, new long[] {95, 119}, grid.getExtent()); /* * Before to check envelope, we need to restore the same axis order as specified in the grid geometry. * The envelope below is identical to the one used in `testSubgridFromEnvelope()`. */ - envelope.setCoordinateReferenceSystem(HardCodedCRS.WGS84_φλ); + envelope.setCoordinateReferenceSystem(HardCodedCRS.WGS84_LATITUDE_FIRST); envelope.setRange(0, -50, +30); envelope.setRange(1, 8, 12); assertEnvelopeEquals(envelope, grid.getEnvelope(), STRICT); @@ -315,7 +311,7 @@ public final strictfp class GridDerivationTest extends TestCase { final GridGeometry base = new GridGeometry( PixelInCell.CELL_CORNER, new AffineTransform2D(-0.02, 0, 0, 0.1, 55, 172), - new Envelope2D(HardCodedCRS.WGS84_φλ, 42, 172, 13, 51), + new Envelope2D(HardCodedCRS.WGS84_LATITUDE_FIRST, 42, 172, 13, 51), GridRoundingMode.NEAREST); final GridGeometry expectedResult = base.derive() @@ -628,7 +624,7 @@ public final strictfp class GridDerivationTest extends TestCase { * Test same envelope but with different axis order. The request uses a different CRS, * but the result shall stay in the same CRS than the initial grid geometry. */ - request.setCoordinateReferenceSystem(HardCodedCRS.WGS84_φλ); + request.setCoordinateReferenceSystem(HardCodedCRS.WGS84_LATITUDE_FIRST); request.setRect(25, -5, 90, 100); grid2 = new GridGeometry(null, request, GridOrientation.HOMOTHETY); subgrid = grid1.derive().subgrid(grid2).build(); diff --git a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java index 201d777..f01cd94 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java +++ b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java @@ -298,7 +298,7 @@ public final strictfp class GridGeometryTest extends TestCase { */ @Test public void testFromGeospatialEnvelope() { - final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); envelope.setRange(0, -70.001, +80.002); envelope.setRange(1, 4.997, 15.003); final MathTransform gridToCRS = MathTransforms.linear(new Matrix3( @@ -385,7 +385,7 @@ public final strictfp class GridGeometryTest extends TestCase { */ @Test public void testFromExtentAndDisplayEnvelope() { - final GeneralEnvelope aoi = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + final GeneralEnvelope aoi = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); aoi.setRange(1, 40, 55); aoi.setRange(0, -10, 70); final GridExtent extent = new GridExtent(null, @@ -530,7 +530,7 @@ public final strictfp class GridGeometryTest extends TestCase { -0.05, 0, 53.0, 0, 0.1, -8.0, 0, 0, 1)), - HardCodedCRS.WGS84_φλ); + HardCodedCRS.WGS84_LATITUDE_FIRST); final MathTransform tr = source.createTransformTo(target, PixelInCell.CELL_CENTER); assertMatrixEquals("createTransformTo", new Matrix3( diff --git a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java index 17d8c1d..fe7713c 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java +++ b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/ResampledGridCoverageTest.java @@ -295,7 +295,7 @@ public final strictfp class ResampledGridCoverageTest extends TestCase { @Test public void testAxisSwap() throws TransformException { final GridCoverage2D source = createCoverage2D(); - GridGeometry gg = new GridGeometry(null, CELL_CENTER, null, HardCodedCRS.WGS84_φλ); + GridGeometry gg = new GridGeometry(null, CELL_CENTER, null, HardCodedCRS.WGS84_LATITUDE_FIRST); final GridCoverage target = resample(source, gg); /* * We expect the same image since `ResampledGridCoverage` should have been diff --git a/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java b/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java index a554a37..2dfb81a 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java +++ b/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java @@ -209,7 +209,7 @@ public final strictfp class EnvelopeOperationTest extends TestCase { @Test public void different_crs_on_geometries() { initialize(); - final Envelope result = compute(HardCodedCRS.WGS84, HardCodedCRS.WGS84_φλ); + final Envelope result = compute(HardCodedCRS.WGS84, HardCodedCRS.WGS84_LATITUDE_FIRST); final Envelope expected = new Envelope2D(HardCodedCRS.WGS84, 4, 7, 11, 10); assertSame(HardCodedCRS.WGS84, result.getCoordinateReferenceSystem()); assertEnvelopeEquals(expected, result, STRICT); diff --git a/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureOperationsTest.java b/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureOperationsTest.java index 1badbd3..506ad12 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureOperationsTest.java +++ b/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureOperationsTest.java @@ -71,7 +71,7 @@ public final strictfp class FeatureOperationsTest extends TestCase { */ private static DefaultFeatureType school(final int defaultGeometry) throws FactoryException { final DefaultAttributeType<?> standardCRS = new DefaultAttributeType<>( - name(AttributeConvention.CRS_CHARACTERISTIC), CoordinateReferenceSystem.class, 1, 1, HardCodedCRS.WGS84_φλ); + name(AttributeConvention.CRS_CHARACTERISTIC), CoordinateReferenceSystem.class, 1, 1, HardCodedCRS.WGS84_LATITUDE_FIRST); final DefaultAttributeType<?> normalizedCRS = new DefaultAttributeType<>( name(AttributeConvention.CRS_CHARACTERISTIC), CoordinateReferenceSystem.class, 1, 1, HardCodedCRS.WGS84); @@ -100,7 +100,7 @@ public final strictfp class FeatureOperationsTest extends TestCase { * Tests the constructor. The set of attributes on which the operation depends shall include * "classes", "climbing wall" and "gymnasium" but not "name" since the later does not contain * a geometry. Furthermore the default CRS shall be {@code HardCodedCRS.WGS84}, not - * {@code HardCodedCRS.WGS84_φλ}, because this test uses "gymnasium" as the default geometry. + * {@code HardCodedCRS.WGS84_LATITUDE_FIRST}, because this test uses "gymnasium" as the default geometry. * * @throws FactoryException if an error occurred while searching for the coordinate operations. */ @@ -127,7 +127,7 @@ public final strictfp class FeatureOperationsTest extends TestCase { classes.lineTo(15, 30); classes.lineTo(15, 20); feature.setPropertyValue("classes", classes); - expected = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + expected = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); expected.setRange(0, 10, 15); expected.setRange(1, 20, 30); assertEnvelopeEquals(expected, (Envelope) feature.getPropertyValue("bounds")); @@ -135,7 +135,7 @@ public final strictfp class FeatureOperationsTest extends TestCase { // Set second geometry Point wall = new Point(18, 40); feature.setPropertyValue("climbing wall", wall); - expected = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + expected = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); expected.setRange(0, 10, 18); expected.setRange(1, 20, 40); assertEnvelopeEquals(expected, (Envelope) feature.getPropertyValue("bounds")); @@ -147,7 +147,7 @@ public final strictfp class FeatureOperationsTest extends TestCase { gymnasium.lineTo(-6, -31); gymnasium.lineTo(-5, -31); feature.setPropertyValue("gymnasium", gymnasium); - expected = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + expected = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); expected.setRange(0, -31, 18); expected.setRange(1, -6, 40); assertEnvelopeEquals(expected, (Envelope) feature.getPropertyValue("bounds")); diff --git a/core/sis-feature/src/test/java/org/apache/sis/internal/feature/GeometriesTestCase.java b/core/sis-feature/src/test/java/org/apache/sis/internal/feature/GeometriesTestCase.java index c4ddb6e..2151901 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/internal/feature/GeometriesTestCase.java +++ b/core/sis-feature/src/test/java/org/apache/sis/internal/feature/GeometriesTestCase.java @@ -211,7 +211,7 @@ public abstract strictfp class GeometriesTestCase extends TestCase { */ @Test public void testToGeometryAxisSwapping() { - final GeneralEnvelope e = new GeneralEnvelope(HardCodedCRS.WGS84_φλ); + final GeneralEnvelope e = new GeneralEnvelope(HardCodedCRS.WGS84_LATITUDE_FIRST); e.setRange(0, 2, 3); e.setRange(1, 89, 19); assertToGeometryEquals(e, WraparoundMethod.NONE, 89, 2, 89, 3, 19, 3, 19, 2, 89, 2); diff --git a/core/sis-feature/src/test/java/org/apache/sis/internal/filter/sqlmm/SQLMMTest.java b/core/sis-feature/src/test/java/org/apache/sis/internal/filter/sqlmm/SQLMMTest.java index bc1f8d3..600dedc 100644 --- a/core/sis-feature/src/test/java/org/apache/sis/internal/filter/sqlmm/SQLMMTest.java +++ b/core/sis-feature/src/test/java/org/apache/sis/internal/filter/sqlmm/SQLMMTest.java @@ -143,7 +143,7 @@ public final strictfp class SQLMMTest extends TestCase { /* * Test transform function using the full CRS object, then using only EPSG code. */ - testTransform(feature, HardCodedCRS.WGS84_φλ, HardCodedCRS.WGS84_φλ); + testTransform(feature, HardCodedCRS.WGS84_LATITUDE_FIRST, HardCodedCRS.WGS84_LATITUDE_FIRST); testTransform(feature, "EPSG:4326", CommonCRS.WGS84.geographic()); } @@ -174,13 +174,13 @@ public final strictfp class SQLMMTest extends TestCase { * but we declare it in order to verify that the information is propagated to the result. */ final Point geometry = geometryFactory.createPoint(new Coordinate(10, 20)); - geometry.setUserData(HardCodedCRS.WGS84_φλ); + geometry.setUserData(HardCodedCRS.WGS84_LATITUDE_FIRST); geometry.setSRID(4326); /* * Execute the function and check the result. */ final Polygon result = evaluate(Polygon.class, null, factory.function("ST_Buffer", factory.literal(geometry), factory.literal(1))); - assertEquals("userData", HardCodedCRS.WGS84_φλ, result.getUserData()); + assertEquals("userData", HardCodedCRS.WGS84_LATITUDE_FIRST, result.getUserData()); assertEquals("SRID", 4326, result.getSRID()); final org.locationtech.jts.geom.Envelope env = result.getEnvelopeInternal(); assertEquals( 9, env.getMinX(), STRICT); @@ -204,12 +204,12 @@ public final strictfp class SQLMMTest extends TestCase { new Coordinate(30, 20) }); geometry.setSRID(4326); - geometry.setUserData(HardCodedCRS.WGS84_φλ); + geometry.setUserData(HardCodedCRS.WGS84_LATITUDE_FIRST); /* * Execute the function and check the result. */ final Point result = evaluate(Point.class, null, factory.function("ST_Centroid", factory.literal(geometry))); - assertEquals("userData", HardCodedCRS.WGS84_φλ, result.getUserData()); + assertEquals("userData", HardCodedCRS.WGS84_LATITUDE_FIRST, result.getUserData()); assertEquals("SRID", 4326, result.getSRID()); assertEquals(20, result.getX(), STRICT); assertEquals(20, result.getY(), STRICT); @@ -371,13 +371,13 @@ public final strictfp class SQLMMTest extends TestCase { * but we declare it in order to verify that the information is propagated to the result. */ final LineString geometry = geometryFactory.createLineString(new Coordinate[]{new Coordinate(10, 20), new Coordinate(15, 20), new Coordinate(20, 20)}); - geometry.setUserData(HardCodedCRS.WGS84_φλ); + geometry.setUserData(HardCodedCRS.WGS84_LATITUDE_FIRST); geometry.setSRID(4326); /* * Execute the function and check the result. */ final LineString result = evaluate(LineString.class, null, factory.function("ST_Simplify", factory.literal(geometry), factory.literal(10))); - assertEquals("userData", HardCodedCRS.WGS84_φλ, result.getUserData()); + assertEquals("userData", HardCodedCRS.WGS84_LATITUDE_FIRST, result.getUserData()); assertEquals("SRID", 4326, result.getSRID()); Coordinate[] coordinates = result.getCoordinates(); assertEquals(2, coordinates.length); @@ -398,13 +398,13 @@ public final strictfp class SQLMMTest extends TestCase { * but we declare it in order to verify that the information is propagated to the result. */ final LineString geometry = geometryFactory.createLineString(new Coordinate[]{new Coordinate(10, 20), new Coordinate(15, 20), new Coordinate(20, 20)}); - geometry.setUserData(HardCodedCRS.WGS84_φλ); + geometry.setUserData(HardCodedCRS.WGS84_LATITUDE_FIRST); geometry.setSRID(4326); /* * Execute the function and check the result. */ final LineString result = evaluate(LineString.class, null, factory.function("ST_SimplifyPreserveTopology", factory.literal(geometry), factory.literal(10))); - assertEquals("userData", HardCodedCRS.WGS84_φλ, result.getUserData()); + assertEquals("userData", HardCodedCRS.WGS84_LATITUDE_FIRST, result.getUserData()); assertEquals("SRID", 4326, result.getSRID()); Coordinate[] coordinates = result.getCoordinates(); assertEquals(2, coordinates.length); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java b/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java index e054553..79427aa 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java @@ -302,7 +302,7 @@ public final strictfp class CoordinateFormatTest extends TestCase { public void testSetGroundPrecision() { final CoordinateFormat format = new CoordinateFormat(Locale.FRANCE, null); final DirectPosition2D pos = new DirectPosition2D(40.123456789, 9.87654321); - format.setDefaultCRS(HardCodedCRS.WGS84_φλ); + format.setDefaultCRS(HardCodedCRS.WGS84_LATITUDE_FIRST); format.setGroundPrecision(Quantities.create(0.01, Units.GRAD)); assertEquals("40°07,4′N 9°52,6′E", format.format(pos)); format.setGroundPrecision(Quantities.create(0.01, Units.METRE)); @@ -317,7 +317,7 @@ public final strictfp class CoordinateFormatTest extends TestCase { public void testSetPrecisions() { final CoordinateFormat format = new CoordinateFormat(Locale.FRANCE, null); final DirectPosition2D pos = new DirectPosition2D(40.123456789, 9.87654321); - format.setDefaultCRS(HardCodedCRS.WGS84_φλ); + format.setDefaultCRS(HardCodedCRS.WGS84_LATITUDE_FIRST); format.setPrecisions(0.05, 0.0001); assertEquals("40°07′N 9°52′35,6″E", format.format(pos)); assertArrayEquals("precisions", new double[] {1.0/60, 0.1/3600}, format.getPrecisions(), 1E-15); @@ -336,7 +336,7 @@ public final strictfp class CoordinateFormatTest extends TestCase { public void testSetGroundAccuracy() throws ParseException { final CoordinateFormat format = new CoordinateFormat(Locale.FRANCE, null); final DirectPosition2D pos = new DirectPosition2D(40.123456789, 9.87654321); - format.setDefaultCRS(HardCodedCRS.WGS84_φλ); + format.setDefaultCRS(HardCodedCRS.WGS84_LATITUDE_FIRST); format.setPrecisions(0.05, 0.0001); format.setGroundAccuracy(Quantities.create(3, Units.KILOMETRE)); assertEquals("40°07′N 9°52′35,6″E ± 3 km", format.format(pos)); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/geometry/EnvelopesTest.java b/core/sis-referencing/src/test/java/org/apache/sis/geometry/EnvelopesTest.java index 0969505..962356e 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/geometry/EnvelopesTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/geometry/EnvelopesTest.java @@ -295,7 +295,7 @@ public final strictfp class EnvelopesTest extends TransformTestCase<GeneralEnvel */ @Test public void testToTimeRange() { - final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_3D_TIME); + final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_WITH_TIME); envelope.setToNaN(); envelope.setRange(2, 58840, 59000.75); final Range<Instant> range = Envelopes.toTimeRange(envelope).get(); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java b/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java index 0756e05..1bd3ae0 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java @@ -653,7 +653,7 @@ public strictfp class GeneralEnvelopeTest extends TestCase { @Test public void testHorizontal() { GeneralEnvelope envelope = new GeneralEnvelope(new double[] {4, 5, -8}, new double[] {8, 7, -3}); - envelope.setCoordinateReferenceSystem(HardCodedCRS.GEOID_ZXY); + envelope.setCoordinateReferenceSystem(HardCodedCRS.GEOID_HEIGHT_FIRST); envelope = envelope.horizontal(); assertEnvelopeEquals(envelope, 5, -8, 7, -3); assertSame(WGS84, envelope.getCoordinateReferenceSystem()); @@ -665,7 +665,7 @@ public strictfp class GeneralEnvelopeTest extends TestCase { */ @Test public void testTimeRange() { - final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_3D_TIME); + final GeneralEnvelope envelope = new GeneralEnvelope(HardCodedCRS.WGS84_WITH_TIME); envelope.setRange(0, -20, 25); envelope.setRange(1, -30, 12); envelope.setRange(2, 58840, 59000.75); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/DefinitionVerifierTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/DefinitionVerifierTest.java index e9daf68..20add80 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/DefinitionVerifierTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/DefinitionVerifierTest.java @@ -51,7 +51,7 @@ public final strictfp class DefinitionVerifierTest extends TestCase { */ @Test public void testConformCRS() throws FactoryException { - final DefaultGeographicCRS crs = HardCodedCRS.WGS84_φλ; + final DefaultGeographicCRS crs = HardCodedCRS.WGS84_LATITUDE_FIRST; final DefinitionVerifier ver = DefinitionVerifier.withAuthority(crs, null, false); assertNotNull("Should replace by EPSG:4326", ver); assertNotSame("Should replace by EPSG:4326", crs, ver.authoritative); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/EllipsoidalHeightCombinerTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/EllipsoidalHeightCombinerTest.java index a71c9fa..fb690d9 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/EllipsoidalHeightCombinerTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/EllipsoidalHeightCombinerTest.java @@ -99,7 +99,7 @@ public final strictfp class EllipsoidalHeightCombinerTest extends TestCase { * Non-standard feature: accept (VerticalCRS + GeodeticCRS) order. * The test below use the reverse order for all axes compared to the previous test. */ - compound = services.createCompoundCRS(properties, temporal, vertical, HardCodedCRS.WGS84_φλ); + compound = services.createCompoundCRS(properties, temporal, vertical, HardCodedCRS.WGS84_LATITUDE_FIRST); final Object[] components = CRS.getSingleComponents(compound).toArray(); assertEquals(2, components.length); assertEqualsIgnoreMetadata(temporal, components[0]); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java index 7e01c6c..27ed04d 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java @@ -88,7 +88,7 @@ public final strictfp class ReferencingUtilitiesTest extends TestCase { assertNormalizedEqualsWGS84("Shall extract the 2D component.", false, HardCodedCRS.GEOID_3D); assertNormalizedEqualsWGS84("Shall extract the 2D component.", false, HardCodedCRS.GEOID_4D); assertNormalizedEqualsWGS84("Shall build a the 2D component.", true, HardCodedCRS.WGS84_3D); - assertNormalizedEqualsWGS84("Shall normalize axis order.", true, HardCodedCRS.WGS84_φλ); + assertNormalizedEqualsWGS84("Shall normalize axis order.", true, HardCodedCRS.WGS84_LATITUDE_FIRST); assertNull(toNormalizedGeographicCRS(null, false, false)); } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java index a636454..2826b1e 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java @@ -237,7 +237,7 @@ public final strictfp class CRSTest extends TestCase { assertFalse(CRS.isHorizontalCRS(HardCodedCRS.TIME)); assertFalse(CRS.isHorizontalCRS(HardCodedCRS.ELLIPSOIDAL_HEIGHT)); assertTrue (CRS.isHorizontalCRS(HardCodedCRS.WGS84)); - assertTrue (CRS.isHorizontalCRS(HardCodedCRS.WGS84_φλ)); + assertTrue (CRS.isHorizontalCRS(HardCodedCRS.WGS84_LATITUDE_FIRST)); assertFalse(CRS.isHorizontalCRS(HardCodedCRS.WGS84_3D)); assertFalse(CRS.isHorizontalCRS(HardCodedCRS.GEOID_4D)); assertFalse(CRS.isHorizontalCRS(HardCodedCRS.GEOCENTRIC)); @@ -253,9 +253,8 @@ public final strictfp class CRSTest extends TestCase { assertNull(CRS.getHorizontalComponent(HardCodedCRS.ELLIPSOIDAL_HEIGHT)); assertNull(CRS.getHorizontalComponent(HardCodedCRS.GEOCENTRIC)); - assertSame(HardCodedCRS.WGS84, CRS.getHorizontalComponent(HardCodedCRS.WGS84)); - assertSame(HardCodedCRS.WGS84_φλ, CRS.getHorizontalComponent(HardCodedCRS.WGS84_φλ)); - + assertSame(HardCodedCRS.WGS84, CRS.getHorizontalComponent(HardCodedCRS.WGS84)); + assertSame(HardCodedCRS.WGS84_LATITUDE_FIRST, CRS.getHorizontalComponent(HardCodedCRS.WGS84_LATITUDE_FIRST)); assertEqualsIgnoreMetadata(HardCodedCRS.WGS84, CRS.getHorizontalComponent(HardCodedCRS.WGS84_3D)); } @@ -286,7 +285,7 @@ public final strictfp class CRSTest extends TestCase { public void testGetTemporalComponent() { assertNull(CRS.getTemporalComponent(HardCodedCRS.ELLIPSOIDAL_HEIGHT)); assertNull(CRS.getTemporalComponent(HardCodedCRS.WGS84)); - assertNull(CRS.getTemporalComponent(HardCodedCRS.WGS84_φλ)); + assertNull(CRS.getTemporalComponent(HardCodedCRS.WGS84_LATITUDE_FIRST)); assertNull(CRS.getTemporalComponent(HardCodedCRS.WGS84_3D)); assertSame(HardCodedCRS.TIME, CRS.getTemporalComponent(HardCodedCRS.TIME)); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java index 75ccf4e..90b3a4d 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodesicsOnEllipsoidTest.java @@ -81,7 +81,7 @@ public final strictfp class GeodesicsOnEllipsoidTest extends GeodeticCalculatorT */ @Override GeodeticCalculator create(final boolean normalized) { - testedEarth = new Calculator(normalized ? HardCodedCRS.WGS84 : HardCodedCRS.WGS84_φλ); + testedEarth = new Calculator(normalized ? HardCodedCRS.WGS84 : HardCodedCRS.WGS84_LATITUDE_FIRST); return testedEarth; } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticCalculatorTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticCalculatorTest.java index c07459b..202bf8a 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticCalculatorTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticCalculatorTest.java @@ -107,7 +107,7 @@ public strictfp class GeodeticCalculatorTest extends TestCase { * @param normalized whether to force (longitude, latitude) axis order. */ GeodeticCalculator create(final boolean normalized) { - final GeodeticCalculator c = GeodeticCalculator.create(normalized ? HardCodedCRS.SPHERE : HardCodedCRS.SPHERE_φλ); + final GeodeticCalculator c = GeodeticCalculator.create(normalized ? HardCodedCRS.SPHERE : HardCodedCRS.SPHERE_LATITUDE_FIRST); assertEquals(GeodeticCalculator.class, c.getClass()); // Expect the implementation with spherical formulas. return c; } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java index e4a191d..c784132 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java @@ -95,8 +95,8 @@ public final strictfp class IdentifiedObjectsTest extends TestCase { * @see CRSTest#testIdentifiedObjectLookup() */ public static void testLookupEPSG() throws FactoryException { - assertEquals("EPSG:4326", Integer.valueOf(4326), IdentifiedObjects.lookupEPSG(HardCodedCRS.WGS84_φλ)); - String urn = IdentifiedObjects.lookupURN(HardCodedCRS.WGS84_φλ, null); + assertEquals("EPSG:4326", Integer.valueOf(4326), IdentifiedObjects.lookupEPSG(HardCodedCRS.WGS84_LATITUDE_FIRST)); + String urn = IdentifiedObjects.lookupURN(HardCodedCRS.WGS84_LATITUDE_FIRST, null); assertTrue(urn, urn.matches("urn\\:ogc\\:def\\:crs\\:EPSG\\:.*\\:4326")); } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java index 09733d0..1155c65 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java @@ -174,7 +174,7 @@ public final strictfp class DefaultCompoundCRSTest extends TestCase { */ @Test public void testNormalization() { - final DefaultGeographicCRS crs2 = HardCodedCRS.WGS84_φλ; + final DefaultGeographicCRS crs2 = HardCodedCRS.WGS84_LATITUDE_FIRST; final DefaultGeographicCRS rh2 = crs2.forConvention(AxesConvention.RIGHT_HANDED); final DefaultCompoundCRS crs3 = new DefaultCompoundCRS(singletonMap(NAME_KEY, "3D"), crs2, HEIGHT); final DefaultCompoundCRS crs4 = new DefaultCompoundCRS(singletonMap(NAME_KEY, "4D"), crs3, TIME); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java index 08209b5..79afba8 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java @@ -99,7 +99,7 @@ public final strictfp class DefaultDerivedCRSTest extends TestCase { /** * Creates a dummy derived CRS defined by a longitude rotation from Paris to Greenwich prime meridian, - * and swapping the axis order. The result is equivalent to {@link HardCodedCRS#WGS84_φλ}, + * and swapping the axis order. The result is equivalent to {@link HardCodedCRS#WGS84_LATITUDE_FIRST}, * which of course makes the returned {@code DerivedCRS} totally useless. * Its purpose is only to perform easy tests. */ diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java index f37bf16..5953881 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java @@ -35,6 +35,9 @@ import static org.apache.sis.referencing.IdentifiedObjects.getProperties; * Collection of coordinate reference systems for testing purpose. * This class defines geographic, vertical, temporal and engineering CRS, but no projected CRS. * For projected CRS, see {@link org.apache.sis.referencing.operation.HardCodedConversions}. + * Except specified otherwise, all geographic CRS have (longitude, latitude) axis order. + * This is the opposite of traditional axis order, but it matches the order used internally + * by Apache SIS. * * @author Martin Desruisseaux (Geomatys) * @version 1.1 @@ -50,7 +53,7 @@ public final strictfp class HardCodedCRS { * * <p>This CRS is equivalent to {@code EPSG:4326}.</p> */ - public static final DefaultGeographicCRS WGS84_φλ = new DefaultGeographicCRS( + public static final DefaultGeographicCRS WGS84_LATITUDE_FIRST = new DefaultGeographicCRS( properties("WGS 84 (φ,λ)", "4326"), HardCodedDatum.WGS84, HardCodedCS.GEODETIC_φλ); /** @@ -92,7 +95,7 @@ public final strictfp class HardCodedCRS { * * @since 1.1 */ - public static final DefaultCompoundCRS WGS84_3D_TIME; + public static final DefaultCompoundCRS WGS84_WITH_TIME; /** * A (λ,φ,t) CRS where <var>t</var> is the {@link #DAY_OF_YEAR}. @@ -100,7 +103,7 @@ public final strictfp class HardCodedCRS { * * @since 1.1 */ - public static final DefaultCompoundCRS WGS84_3D_TIME_CYCLIC; + public static final DefaultCompoundCRS WGS84_WITH_CYCLIC_TIME; /** * A four-dimensional geographic coordinate reference system with time as the first axis. @@ -192,7 +195,7 @@ public final strictfp class HardCodedCRS { * values increasing towards the North and longitude values increasing towards the East. * The angular units are decimal degrees and the prime meridian is Greenwich. */ - public static final DefaultGeographicCRS SPHERE_φλ = new DefaultGeographicCRS( + public static final DefaultGeographicCRS SPHERE_LATITUDE_FIRST = new DefaultGeographicCRS( getProperties(HardCodedDatum.SPHERE), HardCodedDatum.SPHERE, HardCodedCS.GEODETIC_φλ); /** @@ -283,8 +286,8 @@ public final strictfp class HardCodedCRS { getProperties(HardCodedCS.DAY_OF_YEAR), HardCodedDatum.DAY_OF_YEAR, HardCodedCS.DAY_OF_YEAR); static { - WGS84_3D_TIME = new DefaultCompoundCRS(properties("WGS 84 + time", null), WGS84, TIME); - WGS84_3D_TIME_CYCLIC = new DefaultCompoundCRS(properties("WGS 84 + day of year", null), WGS84, DAY_OF_YEAR); + WGS84_WITH_TIME = new DefaultCompoundCRS(properties("WGS 84 + time", null), WGS84, TIME); + WGS84_WITH_CYCLIC_TIME = new DefaultCompoundCRS(properties("WGS 84 + day of year", null), WGS84, DAY_OF_YEAR); } /** @@ -306,7 +309,7 @@ public final strictfp class HardCodedCRS { * This is the same CRS than {@link #GEOID_3D} but with height first. * Such axis order is unusual but we use it as a way to verify that SIS is robust to arbitrary axis order. */ - public static final DefaultCompoundCRS GEOID_ZXY = new DefaultCompoundCRS( + public static final DefaultCompoundCRS GEOID_HEIGHT_FIRST = new DefaultCompoundCRS( properties("height + WGS 84", null), GRAVITY_RELATED_HEIGHT, WGS84); /** diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java index 48440de..b23b658 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java @@ -63,16 +63,16 @@ public final strictfp class HardCodedCRSTest extends TestCase { */ @Test public void testDimensions() { - assertEquals("TIME", 1, TIME .getCoordinateSystem().getDimension()); - assertEquals("DEPTH", 1, DEPTH .getCoordinateSystem().getDimension()); - assertEquals("WGS84", 2, WGS84 .getCoordinateSystem().getDimension()); - assertEquals("WGS84_φλ", 2, WGS84_φλ .getCoordinateSystem().getDimension()); - assertEquals("WGS84_3D", 3, WGS84_3D .getCoordinateSystem().getDimension()); - assertEquals("CARTESIAN_2D", 2, CARTESIAN_2D.getCoordinateSystem().getDimension()); - assertEquals("CARTESIAN_3D", 3, CARTESIAN_3D.getCoordinateSystem().getDimension()); - assertEquals("GEOCENTRIC", 3, GEOCENTRIC .getCoordinateSystem().getDimension()); - assertEquals("SPHERICAL", 3, SPHERICAL .getCoordinateSystem().getDimension()); - assertEquals("GEOID_4D", 4, GEOID_4D .getCoordinateSystem().getDimension()); + assertEquals("TIME", 1, TIME .getCoordinateSystem().getDimension()); + assertEquals("DEPTH", 1, DEPTH .getCoordinateSystem().getDimension()); + assertEquals("WGS84", 2, WGS84 .getCoordinateSystem().getDimension()); + assertEquals("WGS84 (φ,λ)", 2, WGS84_LATITUDE_FIRST.getCoordinateSystem().getDimension()); + assertEquals("WGS84_3D", 3, WGS84_3D .getCoordinateSystem().getDimension()); + assertEquals("CARTESIAN_2D", 2, CARTESIAN_2D .getCoordinateSystem().getDimension()); + assertEquals("CARTESIAN_3D", 3, CARTESIAN_3D .getCoordinateSystem().getDimension()); + assertEquals("GEOCENTRIC", 3, GEOCENTRIC .getCoordinateSystem().getDimension()); + assertEquals("SPHERICAL", 3, SPHERICAL .getCoordinateSystem().getDimension()); + assertEquals("GEOID_4D", 4, GEOID_4D .getCoordinateSystem().getDimension()); } /** diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java index ceb458f..044a7cd 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java @@ -136,7 +136,7 @@ public final strictfp class AuthorityFactoryMock extends GeodeticAuthorityFactor } switch (n) { case 84: return HardCodedCRS.WGS84; - case 4326: return HardCodedCRS.WGS84_φλ; + case 4326: return HardCodedCRS.WGS84_LATITUDE_FIRST; case 4979: return HardCodedCRS.GEOCENTRIC; case 5714: return HardCodedCRS.GRAVITY_RELATED_HEIGHT; case 9905: return HardCodedCRS.DEPTH; diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java index 7cf697f..9feaf37 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java @@ -203,14 +203,14 @@ public final strictfp class MultiAuthoritiesFactoryTest extends TestCase { final Set<AuthorityFactoryMock> mock = Collections.singleton(new AuthorityFactoryMock("MOCK", "2.3")); final MultiAuthoritiesFactory factory = new MultiAuthoritiesFactory(mock, mock, mock, null); - assertSame("Straight", HardCodedCRS .WGS84_φλ, factory.createGeographicCRS("MOCK:4326")); - assertSame("With spaces", HardCodedCRS .WGS84, factory.createGeographicCRS(" mock : 84 ")); - assertSame("With version", HardCodedDatum.WGS84, factory.createGeodeticDatum("mock:2.3:6326")); - assertSame("Empty version", HardCodedDatum.GREENWICH, factory.createPrimeMeridian(" MoCk :: 8901")); - assertSame("With spaces", HardCodedCRS .DEPTH, factory.createVerticalCRS (" MoCk : : 9905")); - assertSame("Version 0", HardCodedDatum.SPHERE, factory.createGeodeticDatum("MOCK: 0:6047")); - assertSame("With spaces", Extents .WORLD, factory.createExtent ("MOCK: 2.3 : 1262")); - assertSame("With spaces", Units .METRE, factory.createUnit (" MoCK : : 9001 ")); + assertSame("Straight", HardCodedCRS .WGS84_LATITUDE_FIRST, factory.createGeographicCRS("MOCK:4326")); + assertSame("With spaces", HardCodedCRS .WGS84, factory.createGeographicCRS(" mock : 84 ")); + assertSame("With version", HardCodedDatum.WGS84, factory.createGeodeticDatum("mock:2.3:6326")); + assertSame("Empty version", HardCodedDatum.GREENWICH, factory.createPrimeMeridian(" MoCk :: 8901")); + assertSame("With spaces", HardCodedCRS .DEPTH, factory.createVerticalCRS (" MoCk : : 9905")); + assertSame("Version 0", HardCodedDatum.SPHERE, factory.createGeodeticDatum("MOCK: 0:6047")); + assertSame("With spaces", Extents .WORLD, factory.createExtent ("MOCK: 2.3 : 1262")); + assertSame("With spaces", Units .METRE, factory.createUnit (" MoCK : : 9001 ")); assertEquals("Greenwich", factory.getDescriptionText("MOCK:8901").toString()); try { factory.createGeodeticDatum("MOCK2:4326"); @@ -233,13 +233,13 @@ public final strictfp class MultiAuthoritiesFactoryTest extends TestCase { final Set<AuthorityFactoryMock> mock = Collections.singleton(new AuthorityFactoryMock("MOCK", "2.3")); final MultiAuthoritiesFactory factory = new MultiAuthoritiesFactory(mock, mock, mock, null); - assertSame("Empty version", HardCodedCRS .WGS84_φλ, factory.createGeographicCRS("urn:ogc:def:crs:MOCK::4326")); - assertSame("With spaces", HardCodedCRS .WGS84, factory.createGeographicCRS(" urn : ogc : def:crs : mock : : 84 ")); - assertSame("Mixed case", HardCodedCRS .DEPTH, factory.createVerticalCRS (" Urn : OGC : dEf : CRS : MoCk : : 9905")); - assertSame("With version", HardCodedDatum.WGS84, factory.createDatum ("urn:ogc:def:datum:mock:2.3:6326")); - assertSame("Empty version", HardCodedDatum.GREENWICH, factory.createObject ("urn:ogc:def:meridian: MoCk :: 8901")); - assertSame("Version 0", HardCodedDatum.SPHERE, factory.createGeodeticDatum("urn:ogc:def:datum:MOCK: 0 :6047")); - assertSame("Upper case", Units .METRE, factory.createUnit ("URN:OGC:DEF:UOM:MOCK::9001")); + assertSame("Empty version", HardCodedCRS .WGS84_LATITUDE_FIRST, factory.createGeographicCRS("urn:ogc:def:crs:MOCK::4326")); + assertSame("With spaces", HardCodedCRS .WGS84, factory.createGeographicCRS(" urn : ogc : def:crs : mock : : 84 ")); + assertSame("Mixed case", HardCodedCRS .DEPTH, factory.createVerticalCRS (" Urn : OGC : dEf : CRS : MoCk : : 9905")); + assertSame("With version", HardCodedDatum.WGS84, factory.createDatum ("urn:ogc:def:datum:mock:2.3:6326")); + assertSame("Empty version", HardCodedDatum.GREENWICH, factory.createObject ("urn:ogc:def:meridian: MoCk :: 8901")); + assertSame("Version 0", HardCodedDatum.SPHERE, factory.createGeodeticDatum("urn:ogc:def:datum:MOCK: 0 :6047")); + assertSame("Upper case", Units .METRE, factory.createUnit ("URN:OGC:DEF:UOM:MOCK::9001")); try { factory.createGeographicCRS("urn:ogc:def:datum:MOCK::4326"); fail("Should create an object of the wrong type."); @@ -262,10 +262,10 @@ public final strictfp class MultiAuthoritiesFactoryTest extends TestCase { final Set<AuthorityFactoryMock> mock = Collections.singleton(new AuthorityFactoryMock("MOCK", "2.3")); final MultiAuthoritiesFactory factory = new MultiAuthoritiesFactory(mock, mock, mock, null); - assertSame("HTTP", HardCodedCRS .WGS84_φλ, factory.createGeographicCRS("http://www.opengis.net/def/crs/mock/0/4326")); - assertSame("GML", HardCodedCRS .WGS84_φλ, factory.createObject ("http://www.opengis.net/gml/srs/mock.xml#4326")); - assertSame("With spaces", HardCodedCRS .WGS84, factory.createGeographicCRS("http://www.opengis.net/gml/srs/ mock.xml # 84 ")); - assertSame("Mixed case", HardCodedCRS .DEPTH, factory.createVerticalCRS ("HTTP://www.OpenGIS.net/GML/SRS/MoCk.xml#9905")); + assertSame("HTTP", HardCodedCRS.WGS84_LATITUDE_FIRST, factory.createGeographicCRS("http://www.opengis.net/def/crs/mock/0/4326")); + assertSame("GML", HardCodedCRS.WGS84_LATITUDE_FIRST, factory.createObject ("http://www.opengis.net/gml/srs/mock.xml#4326")); + assertSame("With spaces", HardCodedCRS.WGS84, factory.createGeographicCRS("http://www.opengis.net/gml/srs/ mock.xml # 84 ")); + assertSame("Mixed case", HardCodedCRS.DEPTH, factory.createVerticalCRS ("HTTP://www.OpenGIS.net/GML/SRS/MoCk.xml#9905")); try { factory.createDatum("http://www.opengis.net/gml/srs/mock.xml#6326"); fail("Should create an object of the wrong type."); @@ -355,7 +355,7 @@ public final strictfp class MultiAuthoritiesFactoryTest extends TestCase { { CompoundCRS crs = factory.createCompoundCRS(heightOnWGS84); assertArrayEquals("WGS 84 + MSL height", new SingleCRS[] { - HardCodedCRS.WGS84_φλ, HardCodedCRS.GRAVITY_RELATED_HEIGHT + HardCodedCRS.WGS84_LATITUDE_FIRST, HardCodedCRS.GRAVITY_RELATED_HEIGHT }, crs.getComponents().toArray()); } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/WraparoundTransformTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/WraparoundTransformTest.java index b33f7f0..c702c0c 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/WraparoundTransformTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/WraparoundTransformTest.java @@ -87,8 +87,8 @@ public final strictfp class WraparoundTransformTest extends TestCase { public void testOneAxis() throws TransformException { final AbstractCoordinateOperation op = new AbstractCoordinateOperation( Collections.singletonMap(AbstractCoordinateOperation.NAME_KEY, "Wrapper"), - HardCodedCRS.WGS84_φλ, - HardCodedCRS.WGS84_φλ.forConvention(AxesConvention.POSITIVE_RANGE), + HardCodedCRS.WGS84_LATITUDE_FIRST, + HardCodedCRS.WGS84_LATITUDE_FIRST.forConvention(AxesConvention.POSITIVE_RANGE), null, MathTransforms.scale(3, 5)); /* * Transform should be [scale & normalization] → [wraparound] → [denormalization]. @@ -145,8 +145,8 @@ public final strictfp class WraparoundTransformTest extends TestCase { public void testTwoAxes() throws TransformException { final AbstractCoordinateOperation op = new AbstractCoordinateOperation( Collections.singletonMap(AbstractCoordinateOperation.NAME_KEY, "Wrapper"), - HardCodedCRS.WGS84_3D_TIME.forConvention(AxesConvention.POSITIVE_RANGE), - HardCodedCRS.WGS84_3D_TIME_CYCLIC, null, MathTransforms.scale(3, 2, 5)); + HardCodedCRS.WGS84_WITH_TIME.forConvention(AxesConvention.POSITIVE_RANGE), + HardCodedCRS.WGS84_WITH_CYCLIC_TIME, null, MathTransforms.scale(3, 2, 5)); /* * Transform should be [scale & normalization] → [wraparound 1] → [wraparound 2] → [denormalization]. * At first an affine transform existed between the two [wraparound] operations, but that affine transform diff --git a/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4Test.java b/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4Test.java index 5a47b9e..5483cf5 100644 --- a/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4Test.java +++ b/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4Test.java @@ -41,6 +41,6 @@ public final strictfp class Proj4Test extends TestCase { @Test public void testGeographicDefinition() throws FactoryException { assertEquals("+proj=latlon +a=6378137.0 +b=6356752.314245179 +pm=0.0 +axis=enu", Proj4.definition(HardCodedCRS.WGS84)); - assertEquals("+proj=latlon +a=6378137.0 +b=6356752.314245179 +pm=0.0 +axis=neu", Proj4.definition(HardCodedCRS.WGS84_φλ)); + assertEquals("+proj=latlon +a=6378137.0 +b=6356752.314245179 +pm=0.0 +axis=neu", Proj4.definition(HardCodedCRS.WGS84_LATITUDE_FIRST)); } }
