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 161a5fe3c8e79997b5b64d566067fd359a0e241b Merge: 39df6c6024 20ded9bfa1 Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Tue Apr 16 16:37:44 2024 +0200 Merge branch 'geoapi-3.1', but without the assumption that `ProjectedCRS` extends `DerivedCRS`. IT means that `GeneralDerivedCRS` needs to be used more often than on the `geoapi-3.1` branch. .../apache/sis/io/wkt/GeodeticObjectParser.java | 2 +- .../org/apache/sis/io/wkt/MathTransformParser.java | 2 +- .../main/org/apache/sis/io/wkt/WKTFormat.java | 4 ++-- .../main/org/apache/sis/referencing/CRS.java | 4 ++-- .../sis/referencing/crs/DefaultDerivedCRS.java | 5 ++--- .../referencing/datum/DefaultVerticalDatum.java | 1 - .../referencing/factory/sql/AuthorityCodes.java | 10 +++++---- .../referencing/factory/sql/EPSGCodeFinder.java | 2 +- .../sis/referencing/factory/sql/TableInfo.java | 24 +++++++++++++++++++++- .../operation/CoordinateOperationFinder.java | 12 +++++------ .../operation/transform/ConcatenatedTransform.java | 2 +- 11 files changed, 45 insertions(+), 23 deletions(-) diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java index 96e209538a,e0a3a531aa..4f911e51e5 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java @@@ -18,7 -18,7 +18,6 @@@ package org.apache.sis.referencing.datu import java.util.Map; import java.util.Objects; --import java.util.Optional; import jakarta.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlRootElement; diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/sql/TableInfo.java index 1682f75053,906f1e94a6..12e1769ed8 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/sql/TableInfo.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/sql/TableInfo.java @@@ -254,6 -251,28 +255,27 @@@ final class TableInfo return CharSequences.isAcronymForWords(name, expected); } + /** + * Appends a {@code WHERE} clause together with a condition for searching the specified object. + * This method delegates to {@link #where(Class, StringBuilder)} with the type of the given object, + * except that some object properties may be inspected for resolving ambiguities. + * + * @param object the object to search in the database. + * @param buffer where to append the {@code WHERE} clause. + */ - @SuppressWarnings("deprecation") + final void where(final IdentifiedObject object, final StringBuilder buffer) { + Class<?> userType = object.getClass(); + if (object instanceof GeodeticCRS) { + final CoordinateSystem cs = ((GeodeticCRS) object).getCoordinateSystem(); + if (cs instanceof EllipsoidalCS) { + userType = GeographicCRS.class; + } else if (cs instanceof CartesianCS || cs instanceof SphericalCS) { + userType = GeocentricCRS.class; + } + } + where(userType, buffer); + } + /** * Appends a {@code WHERE} clause together with a condition for searching the most specific subtype, * if such condition can be added. The clause appended by this method looks like the following example diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationFinder.java index 91d78cbf25,82eeff00dc..35f9d4d476 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationFinder.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationFinder.java @@@ -367,13 -368,13 +367,13 @@@ public class CoordinateOperationFinder /** * Creates operations from an arbitrary single CRS to a derived coordinate reference system. * Conversions from {@code GeographicCRS} to {@code ProjectedCRS} are also handled by this method, - * since projected CRS are a special kind of {@code DerivedCRS}. + * since projected CRS are a special kind of {@code GeneralDerivedCRS}. * * <p>The default implementation constructs the following operation chain:</p> - * <blockquote><code>sourceCRS → {@linkplain GeneralDerivedCRS#getBaseCRS() baseCRS} → targetCRS</code></blockquote> + * <blockquote><code>sourceCRS → {@linkplain DerivedCRS#getBaseCRS() baseCRS} → targetCRS</code></blockquote> * * where the conversion from {@code baseCRS} to {@code targetCRS} is obtained from - * <code>targetCRS.{@linkplain GeneralDerivedCRS#getConversionFromBase() getConversionFromBase()}</code>. + * <code>targetCRS.{@linkplain DerivedCRS#getConversionFromBase() getConversionFromBase()}</code>. * * <p>This method returns only <em>one</em> step for a chain of concatenated operations (to be built by the caller). * But a list is returned because the same step may be implemented by different operation methods. Only one element @@@ -403,13 -405,13 +403,13 @@@ /** * Creates an operation from a derived CRS to an arbitrary single coordinate reference system. * Conversions from {@code ProjectedCRS} to {@code GeographicCRS} are also handled by this method, - * since projected CRS are a special kind of {@code DerivedCRS}. + * since projected CRS are a special kind of {@code GeneralDerivedCRS}. * * <p>The default implementation constructs the following operation chain:</p> - * <blockquote><code>sourceCRS → {@linkplain GeneralDerivedCRS#getBaseCRS() baseCRS} → targetCRS</code></blockquote> + * <blockquote><code>sourceCRS → {@linkplain DerivedCRS#getBaseCRS() baseCRS} → targetCRS</code></blockquote> * * where the conversion from {@code sourceCRS} to {@code baseCRS} is obtained from the inverse of - * <code>sourceCRS.{@linkplain GeneralDerivedCRS#getConversionFromBase() getConversionFromBase()}</code>. + * <code>sourceCRS.{@linkplain DerivedCRS#getConversionFromBase() getConversionFromBase()}</code>. * * <p>This method returns only <em>one</em> step for a chain of concatenated operations (to be built by the caller). * But a list is returned because the same step may be implemented by different operation methods. Only one element