You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2024/04/16 14:41:06 UTC

(sis) branch main updated (00b4a72d2f -> 161a5fe3c8)

This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/sis.git


    from 00b4a72d2f 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.
     new 39df6c6024 Add warnings about `GeodeticCRS` type that may be replaced by `GeodeticCRS` type in a future version.
     add d9303f1d7d Temporarily use "2.0" as the version number for methods that are deprecated in the `geoapi-3.1` branch but not yet on main.
     add 6fd7c530f7 Use the SIS-specific `DefaultGeocentricCRS` class in one place where we removed the `GeocentricCRS` interface. This is needed for avoiding an ambiguity when searching codes in an EPSG database.
     add 6c50bd371c Update for the removal of `GeneralDerivedCRS` from GeoAPI 4.0. This is replaced by direct usage of `DerivedCRS`.
     add 20ded9bfa1 Merge branch 'geoapi-4.0' into geoapi-3.1, but keep checking for `GeneralDerivedCRS` in `instanceof` checks.
     new 161a5fe3c8 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.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../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 -
 .../factory/ConcurrentAuthorityFactory.java        |  4 ++++
 .../factory/GeodeticAuthorityFactory.java          |  4 ++++
 .../referencing/factory/GeodeticObjectFactory.java |  8 ++++++++
 .../factory/MultiAuthoritiesFactory.java           |  4 ++++
 .../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 +-
 15 files changed, 65 insertions(+), 23 deletions(-)


(sis) 02/02: 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.

Posted by de...@apache.org.
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 <ma...@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


(sis) 01/02: Add warnings about `GeodeticCRS` type that may be replaced by `GeodeticCRS` type in a future version.

Posted by de...@apache.org.
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 39df6c6024da0ad136d1f1cebb39aaff8d501727
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Tue Apr 16 13:59:09 2024 +0200

    Add warnings about `GeodeticCRS` type that may be replaced by `GeodeticCRS` type in a future version.
---
 .../sis/referencing/factory/ConcurrentAuthorityFactory.java       | 4 ++++
 .../apache/sis/referencing/factory/GeodeticAuthorityFactory.java  | 4 ++++
 .../org/apache/sis/referencing/factory/GeodeticObjectFactory.java | 8 ++++++++
 .../apache/sis/referencing/factory/MultiAuthoritiesFactory.java   | 4 ++++
 4 files changed, 20 insertions(+)

diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
index 2688f607cd..63527e9e79 100644
--- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
+++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
@@ -935,6 +935,10 @@ public abstract class ConcurrentAuthorityFactory<DAO extends GeodeticAuthorityFa
      *       {@link #createCoordinateReferenceSystem(String)} method cached a value before to try that method.</li>
      * </ul>
      *
+     * <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 coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
index a5d86d0ee3..db8b1d7f60 100644
--- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
+++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
@@ -344,6 +344,10 @@ public abstract class GeodeticAuthorityFactory extends AbstractFactory implement
      *   <tr><td>EPSG:4984</td> <td>World Geodetic System 1972</td></tr>
      * </table>
      *
+     * <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>
+     *
      * <h4>Default implementation</h4>
      * The default implementation delegates to {@link #createCoordinateReferenceSystem(String)} and casts the result.
      * If the result cannot be casted, then a {@link NoSuchAuthorityCodeException} is thrown.
diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java
index 771df2dd98..7c8d8f2d31 100644
--- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java
+++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java
@@ -320,6 +320,10 @@ public class GeodeticObjectFactory extends AbstractFactory implements CRSFactory
      * An {@linkplain #createGeocentricCRS(Map, GeodeticDatum, SphericalCS) alternate method} allows creation of the
      * same kind of CRS with spherical coordinate system instead of a Cartesian one.
      *
+     * <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>
+     *
      * <h4>Dependencies</h4>
      * The components needed by this method can be created by the following methods:
      * <ol>
@@ -398,6 +402,10 @@ public class GeodeticObjectFactory extends AbstractFactory implements CRSFactory
      * An {@linkplain #createGeocentricCRS(Map, GeodeticDatum, CartesianCS) alternate method} allows creation of the
      * same kind of CRS with Cartesian coordinate system instead of a spherical one.
      *
+     * <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>
+     *
      * <h4>Dependencies</h4>
      * The components needed by this method can be created by the following methods:
      * <ol>
diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
index ead0363423..03f1fb1498 100644
--- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
+++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
@@ -954,6 +954,10 @@ public class MultiAuthoritiesFactory extends GeodeticAuthorityFactory implements
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
+     * <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 coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */