This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/sis.git
commit 00b4a72d2fe4edc40cb3617e4657b181a1f9f87f Merge: 2c90ee97ab 798a145e1e Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Tue Apr 16 12:51:22 2024 +0200 Merge branch 'geoapi-3.1': reduce usage of `GeocentricCRS`, to be deprecated in GeoAPI 3.1. This merge skips the replacement of `createGeocentricCRS(…)` by `createGeodeticCRS(…)` because the GeoAPI 3.0 factory interfaces does not have the latter methods. .../apache/sis/io/wkt/GeodeticObjectParser.java | 3 +- .../main/org/apache/sis/referencing/CommonCRS.java | 8 ++++ .../apache/sis/referencing/crs/AbstractCRS.java | 23 ++++++++++ .../sis/referencing/crs/DefaultDerivedCRS.java | 51 +++++++++++++--------- .../sis/referencing/crs/DefaultGeocentricCRS.java | 34 ++++++++++----- .../sis/referencing/crs/DefaultGeodeticCRS.java | 15 ++++++- .../sis/referencing/crs/DefaultGeographicCRS.java | 32 +++++++------- .../sis/referencing/crs/DefaultParametricCRS.java | 1 + .../sis/referencing/crs/DefaultTemporalCRS.java | 1 + .../sis/referencing/crs/DefaultVerticalCRS.java | 1 + .../sis/referencing/crs/SC_GeographicCRS.java | 5 +-- .../org/apache/sis/referencing/crs/SubTypes.java | 32 +++----------- .../apache/sis/referencing/internal/Legacy.java | 14 ++++++ .../operation/DefaultOperationMethod.java | 1 - .../operation/provider/AbstractProvider.java | 2 +- .../referencing/privy/ReferencingUtilities.java | 2 +- .../apache/sis/referencing/privy/WKTKeywords.java | 5 ++- .../apache/sis/xml/bind/referencing/SC_CRS.java | 4 +- .../sis/io/wkt/GeodeticObjectParserTest.java | 2 +- .../org/apache/sis/referencing/CommonCRSTest.java | 6 +-- .../sis/referencing/EPSGFactoryFallbackTest.java | 13 ++++-- .../sis/referencing/crs/DefaultDerivedCRSTest.java | 24 +++++----- .../referencing/factory/AuthorityFactoryMock.java | 4 +- .../factory/MultiAuthoritiesFactoryTest.java | 2 - .../referencing/factory/sql/EPSGFactoryTest.java | 2 +- .../operation/CoordinateOperationFinderTest.java | 4 +- .../sis/referencing/privy/WKTKeywordsTest.java | 4 +- .../sis/storage/geotiff/reader/CRSBuilder.java | 10 ++--- .../apache/sis/storage/netcdf/base/CRSBuilder.java | 4 +- .../org/apache/sis/gui/referencing/CRSChooser.java | 4 +- 30 files changed, 189 insertions(+), 124 deletions(-) diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CommonCRS.java index b49766e6f0,0a436f01a3..622d9c2836 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CommonCRS.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CommonCRS.java @@@ -741,6 -740,6 +741,10 @@@ public enum CommonCRS * <tr><td>WGS 84</td> <td>{@link #WGS84}</td> <td>4978</td></tr> * </table></blockquote> * ++ * <div class="warning"><b>Warning:</b> In a future SIS version, the return type may be changed to the ++ * {@link GeodeticCRS} parent interface. This is because ISO 19111 does not defines specific interface ++ * for the geocentric case. Users should assign the return value to a {@code GeodeticCRS} type.</div> ++ * * @return the geocentric CRS associated to this enum. * * @see CRS#forCode(String) @@@ -793,6 -792,6 +797,10 @@@ * <li>Geocentric radius in metres oriented toward {@linkplain AxisDirection#UP up}.</li> * </ol> * ++ * <div class="warning"><b>Warning:</b> In a future SIS version, the return type may be changed to the ++ * {@link GeodeticCRS} parent interface. This is because ISO 19111 does not defines specific interface ++ * for the geocentric case. Users should assign the return value to a {@code GeodeticCRS} type.</div> ++ * * @return the geocentric CRS associated to this enum. * * @see DefaultGeocentricCRS diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultDerivedCRS.java index 2606e972ce,6a01107efb..9f17303c75 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultDerivedCRS.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultDerivedCRS.java @@@ -57,10 -58,13 +58,11 @@@ import static org.apache.sis.referencin import org.apache.sis.io.wkt.Convention; import org.apache.sis.io.wkt.Formatter; import org.apache.sis.util.ComparisonMode; + import org.apache.sis.util.collection.Containers; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.referencing.datum.DatumEnsemble; -import org.opengis.referencing.datum.ParametricDatum; -import org.opengis.referencing.crs.ParametricCRS; -import org.opengis.referencing.cs.ParametricCS; +// Specific to the main branch: +import org.apache.sis.referencing.cs.DefaultParametricCS; +import org.apache.sis.referencing.datum.DefaultParametricDatum; /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java index 779e8ccf68,e616c6f151..0a88f7685b --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java @@@ -47,13 -50,13 +50,13 @@@ import org.apache.sis.io.wkt.Formatter * The other choices provide more freedom. * * <ol> - * <li>Create a {@code GeocentricCRS} from one of the static convenience shortcuts listed in + * <li>Create a {@code GeodeticCRS} from one of the static convenience shortcuts listed in * {@link org.apache.sis.referencing.CommonCRS#geocentric()}.</li> - * <li>Create a {@code GeocentricCRS} from an identifier in a database by invoking + * <li>Create a {@code GeodeticCRS} from an identifier in a database by invoking - * {@link org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createGeodeticCRS(String)}.</li> - * <li>Create a {@code GeodeticCRS} by invoking the {@code CRSFactory.createGeodeticCRS(…)} method + * {@link org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createGeocentricCRS(String)}.</li> - * <li>Create a {@code GeocentricCRS} by invoking the {@code CRSFactory.createGeocentricCRS(…)} method ++ * <li>Create a {@code GeodeticCRS} by invoking the {@code CRSFactory.createGeocentricCRS(…)} method * (implemented for example by {@link org.apache.sis.referencing.factory.GeodeticObjectFactory}).</li> - * <li>Create a {@code GeocentricCRS} by invoking the + * <li>Create a {@code GeodeticCRS} by invoking the * {@linkplain #DefaultGeocentricCRS(Map, GeodeticDatum, CartesianCS) constructor}.</li> * </ol> * diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java index 27c7110737,c754bc93af..a8f60eeeb7 --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java @@@ -175,7 -175,7 +175,7 @@@ public final class EPSGFactoryTest exte @Test public void testGeocentric() throws FactoryException { final EPSGFactory factory = dataEPSG.factory(); - final GeocentricCRS crs = factory.createGeocentricCRS("epsg:4915"); - final GeodeticCRS crs = factory.createGeodeticCRS("epsg:4915"); ++ final GeodeticCRS crs = factory.createGeocentricCRS("epsg:4915"); assertEpsgNameAndIdentifierEqual("ITRF93", 4915, crs); assertEpsgNameAndIdentifierEqual("International Terrestrial Reference Frame 1993", 6652, crs.getDatum()); assertAxisDirectionsEqual(crs.getCoordinateSystem(), AxisDirection.GEOCENTRIC_X, AxisDirection.GEOCENTRIC_Y, AxisDirection.GEOCENTRIC_Z); diff --cc endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/CRSBuilder.java index 73654cbcba,0412578521..00f70cc1b5 --- a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/CRSBuilder.java +++ b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/CRSBuilder.java @@@ -1141,7 -1141,7 +1141,7 @@@ public final class CRSBuilder extends R if (!Units.METRE.equals(linearUnit)) { cs = replaceLinearUnit(cs, linearUnit); } - final GeocentricCRS crs = getCRSFactory().createGeocentricCRS(properties(getOrDefault(names, GCRS)), datum, cs); - final GeodeticCRS crs = getCRSFactory().createGeodeticCRS(properties(getOrDefault(names, GCRS)), datum, cs); ++ final GeodeticCRS crs = getCRSFactory().createGeocentricCRS(properties(getOrDefault(names, GCRS)), datum, cs); lastName = crs.getName(); return crs; } @@@ -1151,7 -1151,7 +1151,7 @@@ * But if the file also defines the components, verify that those components are consistent * with what we would expect for a CRS of the given EPSG code. */ - final GeocentricCRS crs = getCRSAuthorityFactory().createGeocentricCRS(String.valueOf(epsg)); - final GeodeticCRS crs = getCRSAuthorityFactory().createGeodeticCRS(String.valueOf(epsg)); ++ final GeodeticCRS crs = getCRSAuthorityFactory().createGeocentricCRS(String.valueOf(epsg)); verify(crs); return crs; }