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 544e733c29338a7021164dd12c4153f8184f68fa Author: Martin Desruisseaux <[email protected]> AuthorDate: Fri Nov 9 16:29:45 2018 +0100 Change the abbreviations used for spherical coordinates axes for matching latest revision of ISO 19111: Radius "R" become "r" and spherical latitude φ′ become Ω. --- .../sis/internal/metadata/AxisDirections.java | 34 +++++++++++++++++++--- .../apache/sis/internal/metadata/AxisNames.java | 20 ++++++------- .../java/org/apache/sis/io/wkt/Transliterator.java | 16 ++++++---- .../org/apache/sis/io/wkt/TransliteratorTest.java | 8 ++--- .../sis/referencing/StandardDefinitions.java | 4 +-- .../operation/transform/SphericalToCartesian.java | 2 +- .../sis/internal/metadata/AxisDirectionsTest.java | 10 +++---- .../referencing/crs/DefaultEngineeringCRSTest.java | 14 ++++----- .../cs/DefaultCoordinateSystemAxisTest.java | 6 ++-- .../sis/referencing/cs/DefaultSphericalCSTest.java | 4 +-- .../apache/sis/referencing/cs/HardCodedAxes.java | 27 +++++++++-------- 11 files changed, 88 insertions(+), 57 deletions(-) diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java index d1e2be1..fdff560 100644 --- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java +++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java @@ -626,11 +626,11 @@ public final class AxisDirections extends Static { return name; // Most common cases are "x", "y", "z", "t", "i" and "j". } /* - * Direction may be both "compass" (e.g. North) or "non-compass" (e.g. away from). - * Even if the radius at θ = 0° is oriented toward North, but we do not want the "N" abbreviation. + * Direction may be both "compass" (e.g. "North") or "non-compass" (e.g. "Away from"). + * Even if the radius at θ = 0° is oriented toward North, we do not want the "N" abbreviation. */ if (contains(name, "radius", true)) { - return contains(name, "Geocentric", false) ? "R" : "r"; + return "r"; } if (isCompass(direction)) { /* @@ -640,7 +640,7 @@ public final class AxisDirections extends Static { */ if (!isIntercardinal(direction) && Units.isAngular(unit)) { if (contains(name, "Spherical", false)) { - return NORTH.equals(absolute(direction)) ? "φ′" : "θ"; + return NORTH.equals(absolute(direction)) ? "Ω" : "θ"; } else { return NORTH.equals(absolute(direction)) ? "φ" : "λ"; } @@ -674,6 +674,32 @@ public final class AxisDirections extends Static { } /** + * Returns an axis direction for the given abbreviation. This method is (partially) the converse + * of {@link #suggestAbbreviation(String, AxisDirection, Unit)}. Current implementation does not + * recognize all abbreviation generated by above method, but only the main ones. + * + * @param abbreviation the abbreviation. + * @return axis direction for the given abbreviation, or {@code null} if unrecognized. + */ + public static AxisDirection fromAbbreviation(char abbreviation) { + if (abbreviation >= 'a' && abbreviation <= 'z') { + abbreviation -= ('a' - 'A'); // To upper case, but only for latin characters. + } + final AxisDirection dir; + switch (abbreviation) { + case 'W': dir = AxisDirection.WEST; break; + case 'S': dir = AxisDirection.SOUTH; break; + case 'θ': case 'λ': case 'E': dir = AxisDirection.EAST; break; + case 'Ω': case 'φ': case 'N': dir = AxisDirection.NORTH; break; + case 'R': case 'H': dir = AxisDirection.UP; break; + case 'D': dir = AxisDirection.DOWN; break; + case 'T': dir = AxisDirection.FUTURE; break; + default: dir = null; break; + } + return dir; + } + + /** * Builds a coordinate system name from the given array of axes. * This method expects a {@code StringBuilder} pre-filled with the coordinate system name. * The axis directions and abbreviations will be appended after the CS name. diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java index de96e81..cebcfe2 100644 --- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java +++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java @@ -27,7 +27,7 @@ import org.apache.sis.internal.system.Modules; * Constants for axis names specified by ISO 19111 and ISO 19162. * * @author Martin Desruisseaux (Geomatys) - * @version 0.6 + * @version 1.0 * @since 0.6 * @module */ @@ -53,9 +53,9 @@ public final class AxisNames { public static final String GEODETIC_LATITUDE = "Geodetic latitude"; /** - * The ISO 19111 <cite>"spherical longitude"</cite> name. Abbreviation used by SIS is "θ" (theta) - * for consistency with ISO 19162 <cite>Axis name and abbreviation</cite> section, - * but some other conventions use φ or Ω instead. + * The ISO 19111 <cite>"spherical longitude"</cite> name, also called <cite>"azimuthal angle"</cite>. + * Abbreviation used by SIS is "θ" (theta) for consistency with ISO 19111 and ISO 19162 + * <cite>Axis name and abbreviation</cite> section, but some other conventions use φ or Ω instead. * Direction in the EPSG database is "East", but "counterClockwise" may also be used. * * @see <a href="http://en.wikipedia.org/wiki/Spherical_coordinate_system">Spherical coordinate system on Wikipedia</a> @@ -64,9 +64,9 @@ public final class AxisNames { public static final String SPHERICAL_LONGITUDE = "Spherical longitude"; /** - * The ISO 19111 <cite>"spherical latitude"</cite> name. Abbreviation used by SIS is "φ′" (phi prime) - * for consistency with ISO 19162 <cite>Axis name and abbreviation</cite> section, - * but some other conventions use θ, Ω or Ψ instead. + * The ISO 19111 <cite>"spherical latitude"</cite> name, also called <cite>"polar (zenith) angle"</cite>. + * Abbreviation used by SIS is "Ω" (omega) for consistency with ISO 19111 + * <cite>Axis name and abbreviation</cite> section, but some other conventions use θ, Ω or Ψ instead. * Direction in the EPSG database is "North", but the "Up" direction may also be used with a similar * axis named "elevation". */ @@ -103,10 +103,10 @@ public final class AxisNames { public static final String GEOCENTRIC_Z = "Geocentric Z"; /** - * The ISO 19111 <cite>"geocentric radius"</cite> name. Abbreviation is upper case <cite>"R"</cite> - * for consistency with EPSG database. + * The ISO 19111 <cite>"geocentric radius"</cite> name. Abbreviation is lower case <cite>"r"</cite> + * for consistency with ISO 19111. * - * <div class="note"><b>Note:</b>Lower case <cite>"r"</cite> is used for non-geocentric radius + * <div class="note"><b>Note:</b>Lower case <cite>"r"</cite> is also used for non-geocentric radius * or axes named "distance" with "awayFrom" direction.</div> */ public static final String GEOCENTRIC_RADIUS = "Geocentric radius"; diff --git a/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java b/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java index 367d0a9..d5f1ad9 100644 --- a/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java +++ b/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java @@ -64,7 +64,7 @@ import org.apache.sis.util.Characters; * (<var>B</var>, <var>L</var>) from German “Breite” and “Länge” used in academic texts worldwide, or * (<var>lat</var>, <var>long</var>).</li> * <li>(<var>U</var>) for (θ) in {@linkplain org.apache.sis.referencing.cs.DefaultPolarCS polar coordinate systems}.</li> - * <li>(<var>U</var>, <var>V</var>) for (φ′, θ) in + * <li>(<var>U</var>, <var>V</var>) for (Ω, θ) in * {@linkplain org.apache.sis.referencing.cs.DefaultSphericalCS spherical coordinate systems}.</li> * </ul> * @@ -89,7 +89,7 @@ import org.apache.sis.util.Characters; * methods are responsible for doing the transliteration at formatting and parsing time, respectively. * * @author Martin Desruisseaux (Geomatys) - * @version 0.6 + * @version 1.0 * * @see org.apache.sis.util.Characters#isValidWKT(int) * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#39">WKT 2 specification §7.5.3</a> @@ -311,7 +311,7 @@ public abstract class Transliterator implements Serializable { * {@linkplain org.apache.sis.referencing.cs.DefaultEllipsoidalCS ellipsoidal CS}.</li> * <li>φ → <var>B</var> (from German <cite>Breite</cite>) if used in an * {@linkplain org.apache.sis.referencing.cs.DefaultEllipsoidalCS ellipsoidal CS}.</li> - * <li>φ or φ′ or φ<sub>c</sub> → <var>U</var> if used in a + * <li>φ or φ′ or φ<sub>c</sub> or Ω → <var>U</var> if used in a * {@linkplain org.apache.sis.referencing.cs.DefaultSphericalCS spherical CS}, regardless of whether the * coordinate system follows <a href="http://en.wikipedia.org/wiki/Spherical_coordinate_system">physics, * mathematics or other conventions</a>.</li> @@ -360,6 +360,12 @@ public abstract class Transliterator implements Serializable { } break; } + case 'Ω': { // Used instead of 'φ' in ISO 19111. + if (cs instanceof SphericalCS) { + abbreviation = "U"; + } + break; + } case 'λ': { if (cs instanceof EllipsoidalCS) { abbreviation = "L"; // From German "Länge", used in academic texts worldwide. @@ -395,7 +401,7 @@ public abstract class Transliterator implements Serializable { * <ul> * <li><var>P</var> or <var>L</var> → λ if {@code csType} is {@code "ellipsoidal"}.</li> * <li><var>B</var> → φ if {@code csType} is {@code "ellipsoidal"}.</li> - * <li><var>U</var> → φ′ if {@code csType} is {@code "spherical"}, regardless of coordinate system convention.</li> + * <li><var>U</var> → Ω if {@code csType} is {@code "spherical"}, regardless of coordinate system convention.</li> * <li><var>V</var> → θ if {@code csType} is {@code "spherical"}, regardless of coordinate system convention.</li> * <li><var>U</var> → θ if {@code csType} is {@code "polar"}.</li> * </ul> @@ -411,7 +417,7 @@ public abstract class Transliterator implements Serializable { final String condition; switch (abbreviation.charAt(0)) { case 'U': if (WKTKeywords.polar.equals(csType)) return "θ"; - replacement = "φ′"; condition = WKTKeywords.spherical; break; + replacement = "Ω"; condition = WKTKeywords.spherical; break; case 'V': replacement = "θ"; condition = WKTKeywords.spherical; break; case 'L': replacement = "λ"; condition = WKTKeywords.ellipsoidal; break; case 'P': // Transliteration of "phi". diff --git a/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java b/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java index 6a4e1f1..c1f35d7 100644 --- a/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java +++ b/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java @@ -35,7 +35,7 @@ import static org.junit.Assert.*; * Tests the {@link Transliterator} class. * * @author Martin Desruisseaux (Geomatys) - * @version 0.6 + * @version 1.0 * @since 0.6 * @module */ @@ -87,7 +87,7 @@ public final strictfp class TransliteratorTest extends TestCase { @Test public void testToShortAxisName() { assertShortAxisNameEquals("Latitude", new Geographic(AxisNames.GEODETIC_LATITUDE, "φ")); - assertShortAxisNameEquals("Spherical latitude", new Geocentric(AxisNames.SPHERICAL_LATITUDE, "φ′")); + assertShortAxisNameEquals("Spherical latitude", new Geocentric(AxisNames.SPHERICAL_LATITUDE, "Ω")); assertShortAxisNameEquals("Longitude", new Geographic(AxisNames.GEODETIC_LONGITUDE, "λ")); assertShortAxisNameEquals("Spherical longitude", new Geocentric(AxisNames.SPHERICAL_LONGITUDE, "θ")); } @@ -102,7 +102,7 @@ public final strictfp class TransliteratorTest extends TestCase { assertEquals("B", "φ", t.toUnicodeAbbreviation("ellipsoidal", AxisDirection.NORTH, "B")); assertEquals("L", "λ", t.toUnicodeAbbreviation("ellipsoidal", AxisDirection.EAST, "L")); assertEquals("U", "θ", t.toUnicodeAbbreviation("polar", AxisDirection.OTHER, "U")); - assertEquals("U", "φ′", t.toUnicodeAbbreviation("spherical", AxisDirection.NORTH, "U")); + assertEquals("U", "Ω", t.toUnicodeAbbreviation("spherical", AxisDirection.NORTH, "U")); assertEquals("V", "θ", t.toUnicodeAbbreviation("spherical", AxisDirection.EAST, "V")); } @@ -112,7 +112,7 @@ public final strictfp class TransliteratorTest extends TestCase { @Test public void testToLatinAbbreviation() { assertAbbreviationEquals("B", new Geographic(AxisNames.GEODETIC_LATITUDE, "φ")); - assertAbbreviationEquals("U", new Geocentric(AxisNames.SPHERICAL_LATITUDE, "φ′")); + assertAbbreviationEquals("U", new Geocentric(AxisNames.SPHERICAL_LATITUDE, "Ω")); assertAbbreviationEquals("L", new Geographic(AxisNames.GEODETIC_LONGITUDE, "λ")); assertAbbreviationEquals("V", new Geocentric(AxisNames.SPHERICAL_LONGITUDE, "θ")); } diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java index e55c93f..b075dde 100644 --- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java +++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java @@ -373,7 +373,7 @@ final class StandardDefinitions { dir = AxisDirection.NORTH; break; case 60: name = "Spherical latitude"; - abrv = "φ′"; // See HardCodedAxes.SPHERICAL_LATITUDE in tests. + abrv = "Ω"; // See HardCodedAxes.SPHERICAL_LATITUDE in tests. unit = Units.DEGREE; dir = AxisDirection.NORTH; min = Latitude.MIN_VALUE; @@ -389,7 +389,7 @@ final class StandardDefinitions { rm = RangeMeaning.WRAPAROUND; break; case 62: name = "Geocentric radius"; - abrv = "R"; // See HardCodedAxes.GEOCENTRIC_RADIUS in tests. + abrv = "r"; // See HardCodedAxes.GEOCENTRIC_RADIUS in tests. dir = AxisDirection.UP; rm = RangeMeaning.EXACT; min = 0; diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java index 15fcac4..9c8ecd0 100644 --- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java +++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java @@ -33,7 +33,7 @@ import static java.lang.Math.*; * <ul> * <li>Spherical longitude (θ), also noted Ω or λ.</li> * <li>Spherical latitude (Ω), also noted θ or φ′ (confusing).</li> - * <li>Spherical radius (r), also noted <var>r</var> in ISO 19111.</li> + * <li>Spherical radius (r).</li> * </ul> * <div class="note"><b>Note:</b> * the spherical latitude is related to geodetic latitude φ by {@literal Ω(φ) = atan((1-ℯ²)⋅tan(φ))}.</div> diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java index 4902fb4..3ceaad2 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java @@ -421,11 +421,11 @@ public final strictfp class AxisDirectionsTest extends TestCase { assertEquals("λ", AxisDirections.suggestAbbreviation("Geodetic longitude", EAST, Units.DEGREE)); assertEquals("φ", AxisDirections.suggestAbbreviation("Geodetic latitude", NORTH, Units.DEGREE)); assertEquals("θ", AxisDirections.suggestAbbreviation("Spherical longitude", EAST, Units.DEGREE)); - assertEquals("φ′", AxisDirections.suggestAbbreviation("Spherical latitude", NORTH, Units.DEGREE)); + assertEquals("Ω", AxisDirections.suggestAbbreviation("Spherical latitude", NORTH, Units.DEGREE)); assertEquals("h", AxisDirections.suggestAbbreviation("Ellipsoidal height", UP, Units.METRE)); assertEquals("H", AxisDirections.suggestAbbreviation("Gravity-related height", UP, Units.METRE)); assertEquals("φ", AxisDirections.suggestAbbreviation("Elevation", UP, Units.METRE)); - assertEquals("R", AxisDirections.suggestAbbreviation("Geocentric radius", UP, Units.METRE)); + assertEquals("r", AxisDirections.suggestAbbreviation("Geocentric radius", UP, Units.METRE)); assertEquals("r", AxisDirections.suggestAbbreviation("Distance", AWAY_FROM, Units.METRE)); assertEquals("θ", AxisDirections.suggestAbbreviation("Bearing", CLOCKWISE, Units.DEGREE)); assertEquals("X", AxisDirections.suggestAbbreviation("not needed", GEOCENTRIC_X, Units.METRE)); @@ -453,9 +453,9 @@ public final strictfp class AxisDirectionsTest extends TestCase { /** * Verifies that the abbreviations used in {@link HardCodedAxes} constants are consistent with the abbreviations * suggested by {@link AxisDirections#suggestAbbreviation(String, AxisDirection, Unit)}. Note that a failure in - * this verification does not necessarily means that the {@code suggestAbbreviation(…)}. It could also be the - * hard-coded constant which need a revision, or we may decide that the different abbreviations are intended and - * should not be compared. + * this verification does not necessarily means that {@code suggestAbbreviation(…)} has a bug. It could also be + * the hard-coded constant which need a revision, or we may decide that the different abbreviations are intended + * and should not be compared. * * @throws IllegalAccessException should never happen since we inspect only for public fields. * diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java index 99e66d2..8b75811 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java @@ -36,7 +36,7 @@ import static org.apache.sis.test.MetadataAssert.*; * Tests {@link DefaultEngineeringCRS}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.6 + * @version 1.0 * @since 0.6 * @module */ @@ -86,7 +86,7 @@ public final strictfp class DefaultEngineeringCRSTest extends TestCase { " CS[spherical, 3],\n" + " AXIS[“Spherical latitude (U)”, north, ORDER[1], ANGLEUNIT[“degree”, 0.017453292519943295]],\n" + " AXIS[“Spherical longitude (V)”, east, ORDER[2], ANGLEUNIT[“degree”, 0.017453292519943295]],\n" + - " AXIS[“Geocentric radius (R)”, up, ORDER[3], LENGTHUNIT[“metre”, 1]]]", + " AXIS[“Geocentric radius (r)”, up, ORDER[3], LENGTHUNIT[“metre”, 1]]]", crs); } @@ -102,7 +102,7 @@ public final strictfp class DefaultEngineeringCRSTest extends TestCase { " CS[spherical, 3],\n" + " Axis[“Spherical latitude (U)”, north, Unit[“degree”, 0.017453292519943295]],\n" + " Axis[“Spherical longitude (V)”, east, Unit[“degree”, 0.017453292519943295]],\n" + - " Axis[“Geocentric radius (R)”, up, Unit[“metre”, 1]]]", + " Axis[“Geocentric radius (r)”, up, Unit[“metre”, 1]]]", crs); } @@ -172,7 +172,7 @@ public final strictfp class DefaultEngineeringCRSTest extends TestCase { " <gml:axis>\n" + " <gml:CoordinateSystemAxis uom=\"urn:ogc:def:uom:EPSG::9122\" gml:id=\"SphericalLatitude\">\n" + " <gml:name>Spherical latitude</gml:name>\n" + - " <gml:axisAbbrev>φ′</gml:axisAbbrev>\n" + + " <gml:axisAbbrev>Ω</gml:axisAbbrev>\n" + " <gml:axisDirection codeSpace=\"EPSG\">north</gml:axisDirection>\n" + " <gml:minimumValue>-90.0</gml:minimumValue>\n" + " <gml:maximumValue>90.0</gml:maximumValue>\n" + @@ -192,7 +192,7 @@ public final strictfp class DefaultEngineeringCRSTest extends TestCase { " <gml:axis>\n" + " <gml:CoordinateSystemAxis uom=\"urn:ogc:def:uom:EPSG::9001\" gml:id=\"GeocentricRadius\">\n" + " <gml:name>Geocentric radius</gml:name>\n" + - " <gml:axisAbbrev>R</gml:axisAbbrev>\n" + + " <gml:axisAbbrev>r</gml:axisAbbrev>\n" + " <gml:axisDirection codeSpace=\"EPSG\">up</gml:axisDirection>\n" + " <gml:minimumValue>0.0</gml:minimumValue>\n" + " <gml:rangeMeaning codeSpace=\"EPSG\">exact</gml:rangeMeaning>\n" + @@ -220,8 +220,8 @@ public final strictfp class DefaultEngineeringCRSTest extends TestCase { assertEquals("cs.axis[0].name", "Spherical latitude", cs.getAxis(0).getName().getCode()); assertEquals("cs.axis[1].name", "Spherical longitude", cs.getAxis(1).getName().getCode()); assertEquals("cs.axis[2].name", "Geocentric radius", cs.getAxis(2).getName().getCode()); - assertEquals("cs.axis[0].abbreviation", "φ′", cs.getAxis(0).getAbbreviation()); + assertEquals("cs.axis[0].abbreviation", "Ω", cs.getAxis(0).getAbbreviation()); assertEquals("cs.axis[1].abbreviation", "θ", cs.getAxis(1).getAbbreviation()); - assertEquals("cs.axis[2].abbreviation", "R", cs.getAxis(2).getAbbreviation()); + assertEquals("cs.axis[2].abbreviation", "r", cs.getAxis(2).getAbbreviation()); } } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java index 2a592cb..5ce1c2c 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java @@ -37,7 +37,7 @@ import static org.apache.sis.referencing.IdentifiedObjects.getProperties; * Tests the {@link DefaultCoordinateSystemAxis} class. * * @author Martin Desruisseaux (IRD, Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.4 * @module */ @@ -98,7 +98,7 @@ public final strictfp class DefaultCoordinateSystemAxisTest extends TestCase { assertWktEquals("AXIS[“Longitude (λ)”, east, ANGLEUNIT[“degree”, 0.017453292519943295]]", GEODETIC_LONGITUDE); assertWktEquals("AXIS[“Spherical longitude (θ)”, east, ANGLEUNIT[“degree”, 0.017453292519943295]]", SPHERICAL_LONGITUDE); assertWktEquals("AXIS[“Latitude (φ)”, north, ANGLEUNIT[“degree”, 0.017453292519943295]]", GEODETIC_LATITUDE); - assertWktEquals("AXIS[“Spherical latitude (φ')”, north, ANGLEUNIT[“degree”, 0.017453292519943295]]", SPHERICAL_LATITUDE); + assertWktEquals("AXIS[“Spherical latitude (Ω)”, north, ANGLEUNIT[“degree”, 0.017453292519943295]]", SPHERICAL_LATITUDE); assertWktEquals(Convention.WKT1, "AXIS[“x”, EAST]", X); assertWktEquals(Convention.WKT1, "AXIS[“y”, NORTH]", Y); @@ -106,7 +106,7 @@ public final strictfp class DefaultCoordinateSystemAxisTest extends TestCase { assertWktEquals(Convention.INTERNAL, "Axis[“Geodetic longitude (λ)”, east, Unit[“degree”, 0.017453292519943295, Id[“EPSG”, 9102]]]", GEODETIC_LONGITUDE); assertWktEquals(Convention.INTERNAL, "Axis[“Spherical longitude (θ)”, east, Unit[“degree”, 0.017453292519943295, Id[“EPSG”, 9102]]]", SPHERICAL_LONGITUDE); assertWktEquals(Convention.INTERNAL, "Axis[“Geodetic latitude (φ)”, north, Unit[“degree”, 0.017453292519943295, Id[“EPSG”, 9102]]]", GEODETIC_LATITUDE); - assertWktEquals(Convention.INTERNAL, "Axis[“Spherical latitude (φ′)”, north, Unit[“degree”, 0.017453292519943295, Id[“EPSG”, 9102]]]", SPHERICAL_LATITUDE); + assertWktEquals(Convention.INTERNAL, "Axis[“Spherical latitude (Ω)”, north, Unit[“degree”, 0.017453292519943295, Id[“EPSG”, 9102]]]", SPHERICAL_LATITUDE); } /** diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java index 5475574..88a22a9 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java @@ -41,7 +41,7 @@ public final strictfp class DefaultSphericalCSTest extends TestCase { * Expected axes are: * * <ol> - * <li>Spherical latitude (φ′)</li> + * <li>Spherical latitude (Ω)</li> * <li>Spherical longitude (θ)</li> * <li>Geocentric radius (R)</li> * </ol> @@ -49,7 +49,7 @@ public final strictfp class DefaultSphericalCSTest extends TestCase { @Test public void testGeodetic() { final DefaultSphericalCS cs = HardCodedCS.SPHERICAL; - assertEquals("EPSG abbreviation for geocentric radius should be upper-case", "R", cs.getAxis(2).getAbbreviation()); + assertEquals("EPSG abbreviation for geocentric radius should be lower-case", "r", cs.getAxis(2).getAbbreviation()); final DefaultSphericalCS normalized = cs.forConvention(AxesConvention.CONVENTIONALLY_ORIENTED); assertNotSame("Should create a new CoordinateSystem.", cs, normalized); diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java index 0f1539e..562d740 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java @@ -30,7 +30,7 @@ import org.apache.sis.measure.Units; * Collection of axes for testing purpose. * * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.4 * @module */ @@ -174,13 +174,13 @@ public final strictfp class HardCodedAxes { * Axis for radius in a {@linkplain org.apache.sis.referencing.crs.DefaultGeocentricCRS geocentric CRS} * using {@linkplain org.apache.sis.referencing.cs.DefaultSphericalCS spherical CS}. * Increasing ordinates values go {@linkplain AxisDirection#UP up} and units are {@linkplain Units#METRE metres}. - * The ISO 19111 name is <cite>"geocentric radius"</cite> and the abbreviation is upper-case <cite>"R"</cite>. + * The ISO 19111 name is <cite>"geocentric radius"</cite> and the abbreviation is lower-case <cite>"r"</cite>. * * <div class="note"><b>Note:</b> - * The uses upper-case <cite>"R"</cite> come from EPSG dataset 8.9. + * EPSG dataset 8.9 uses upper-case <cite>"R"</cite>. * ISO 19111 and 19162 use lower-case <cite>"r"</cite> instead, * but with "awayFrom" direction instead of "geocentricRadius". - * In this class, <cite>"r"</cite> is taken by {@link #DISTANCE}.</div> + * In this class, <cite>"r"</cite> is also used by {@link #DISTANCE}.</div> * * <p>This axis is usually part of a {@link #SPHERICAL_LONGITUDE}, {@link #SPHERICAL_LATITUDE}, * {@link #GEOCENTRIC_RADIUS} set.</p> @@ -191,7 +191,7 @@ public final strictfp class HardCodedAxes { * @see #GRAVITY_RELATED_HEIGHT * @see #DEPTH */ - public static final DefaultCoordinateSystemAxis GEOCENTRIC_RADIUS = create(AxisNames.GEOCENTRIC_RADIUS, "R", + public static final DefaultCoordinateSystemAxis GEOCENTRIC_RADIUS = create(AxisNames.GEOCENTRIC_RADIUS, "r", AxisDirection.UP, Units.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT); /** @@ -199,12 +199,11 @@ public final strictfp class HardCodedAxes { * using {@linkplain org.apache.sis.referencing.cs.DefaultSphericalCS spherical CS}. * Increasing ordinates values go {@linkplain AxisDirection#EAST East} * and units are {@linkplain Units#DEGREE degrees}. - * The ISO 19111 name is <cite>"spherical longitude"</cite> and the abbreviation is "θ" (theta). + * The ISO 19111 name is <cite>"spherical longitude"</cite> (also called <cite>"azimuthal angle"</cite>) + * and the abbreviation is "θ" (theta). * * <p>This axis is close to the definition found in the EPSG database, except for the "long" abbreviation which * is replaced by "θ". Note that other conventions exist, in which the meaning of φ and θ are interchanged. - * ISO mentions also the symbol Ω, but it is not clear if it applies to longitude or latitude. - * The "θ" abbreviation used here is found in ISO 19162. * See {@link AxisNames#SPHERICAL_LONGITUDE} for other information.</p> * * <p>This axis is usually part of a {@link #SPHERICAL_LONGITUDE}, {@link #SPHERICAL_LATITUDE}, @@ -224,13 +223,13 @@ public final strictfp class HardCodedAxes { * using {@linkplain org.apache.sis.referencing.cs.DefaultSphericalCS spherical CS}. * Increasing ordinates values go {@linkplain AxisDirection#NORTH North} * and units are {@linkplain Units#DEGREE degrees}. - * The ISO 19111 name is <cite>"spherical latitude"</cite> and the abbreviation is "φ′" (phi prime). + * The ISO 19111 name is <cite>"spherical latitude"</cite> (also called <cite>"polar (zenith) angle"</cite>) + * and the abbreviation is "Ω". * * <p>This axis is close to the definition found in the EPSG database, except for the "lat" abbreviation - * which is replaced by "φ′". Note that other conventions exist, in which the meaning of φ and θ are - * interchanged or in which this axis is named "elevation" and is oriented toward "Up". - * Other conventions use symbol Ψ or Ω. - * The "φ" abbreviation used here is found in ISO 19162. + * which is replaced by "Ω". Note that other conventions exist, in which the meaning of φ and θ are interchanged + * or in which this axis is named "elevation" and is oriented toward "Up". + * Other conventions use symbol Ψ or φ′. * See {@link AxisNames#SPHERICAL_LATITUDE} for other information.</p> * * <p>This axis is usually part of a {@link #SPHERICAL_LONGITUDE}, {@link #SPHERICAL_LATITUDE}, @@ -239,7 +238,7 @@ public final strictfp class HardCodedAxes { * @see #GEODETIC_LATITUDE * @see #SPHERICAL_LONGITUDE */ - public static final DefaultCoordinateSystemAxis SPHERICAL_LATITUDE = create(AxisNames.SPHERICAL_LATITUDE, "φ′", + public static final DefaultCoordinateSystemAxis SPHERICAL_LATITUDE = create(AxisNames.SPHERICAL_LATITUDE, "Ω", AxisDirection.NORTH, Units.DEGREE, -90, 90, RangeMeaning.EXACT); /**
