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

desruisseaux pushed a commit to branch geoapi-3.1
in repository https://gitbox.apache.org/repos/asf/sis.git

commit abe39d4ffccdf0e5209169c26bde265bf9e27377
Merge: 72bf4148b1 938f77504b
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Tue Apr 9 11:16:12 2024 +0200

    Merge branch 'geoapi-4.0' into geoapi-3.1.
    This merge avoid deprecated `getScope()` and `getDomainOfValidity()` 
methods.
    Those methods are replaced by `getDomains()`.

 .../sis/buildtools/coding/ReorganizeImports.java   |  1 +
 .../apache/sis/coverage/grid/GridExtentCRS.java    |  9 ++--
 .../sis/metadata/iso/extent/DefaultExtent.java     |  3 +-
 .../apache/sis/metadata/iso/extent/Extents.java    |  4 ++
 .../metadata/simple/SimpleIdentifiedObject.java    |  1 +
 .../referencing/gazetteer/FinalLocationType.java   |  9 ++--
 .../gazetteer/ModifiableLocationType.java          |  2 +-
 .../gazetteer/ReferencingByIdentifiers.java        | 38 ++++++---------
 .../gazetteer/ReferencingByIdentifiersTest.java    |  5 +-
 .../main/org/apache/sis/io/wkt/ElementKind.java    | 50 ++++++++++++--------
 .../apache/sis/io/wkt/GeodeticObjectParser.java    |  8 ++--
 .../sis/referencing/AbstractIdentifiedObject.java  | 13 +++---
 .../main/org/apache/sis/referencing/Builder.java   |  4 +-
 .../main/org/apache/sis/referencing/CRS.java       | 26 ++++-------
 .../apache/sis/referencing/IdentifiedObjects.java  | 54 +++++++++++++++++++++-
 .../org/apache/sis/referencing/Properties.java     |  7 +--
 .../sis/referencing/StandardDefinitions.java       |  2 +-
 .../apache/sis/referencing/crs/AbstractCRS.java    |  5 +-
 .../sis/referencing/crs/DefaultDerivedCRS.java     |  4 +-
 .../sis/referencing/datum/BursaWolfParameters.java |  5 +-
 .../referencing/factory/GeodeticObjectFactory.java |  4 +-
 .../referencing/factory/sql/EPSGDataAccess.java    |  7 +--
 .../operation/AbstractCoordinateOperation.java     |  5 +-
 .../operation/AbstractSingleOperation.java         |  3 +-
 .../operation/CoordinateOperationFinder.java       |  3 +-
 .../operation/CoordinateOperationSorter.java       |  3 +-
 .../operation/DefaultConcatenatedOperation.java    |  3 +-
 .../referencing/operation/DefaultConversion.java   |  4 +-
 .../DefaultCoordinateOperationFactory.java         | 18 ++++----
 .../operation/DefaultPassThroughOperation.java     |  3 +-
 .../operation/DefaultTransformation.java           |  4 +-
 .../operation/InverseOperationMethod.java          |  5 +-
 .../operation/transform/AbstractMathTransform.java |  2 +-
 .../operation/transform/DomainDefinition.java      |  2 +-
 .../operation/transform/MathTransforms.java        |  2 +-
 .../privy/EllipsoidalHeightCombiner.java           | 11 +++--
 .../referencing/privy/GeodeticObjectBuilder.java   |  5 +-
 .../referencing/privy/NilReferencingObject.java    | 21 ++++++---
 .../referencing/AbstractReferenceSystemTest.java   | 15 ++++--
 .../test/org/apache/sis/referencing/CRSTest.java   |  5 +-
 .../sis/referencing/GeodeticObjectVerifier.java    | 37 ++++++++++-----
 .../referencing/crs/DefaultGeodeticCRSTest.java    |  3 +-
 .../referencing/crs/DefaultProjectedCRSTest.java   |  3 +-
 .../apache/sis/referencing/crs/HardCodedCRS.java   |  4 +-
 .../datum/DefaultGeodeticDatumTest.java            | 12 +++--
 .../datum/DefaultTemporalDatumTest.java            | 16 ++++---
 .../datum/DefaultVerticalDatumTest.java            |  5 +-
 .../sis/referencing/datum/HardCodedDatum.java      | 26 +++++++++--
 .../operation/SingleOperationMarshallingTest.java  | 12 +++--
 .../apache/sis/test/integration/MetadataTest.java  |  3 +-
 .../sis/test/integration/MetadataVerticalTest.java |  5 +-
 .../apache/sis/storage/base/MetadataBuilder.java   |  5 +-
 .../main/org/apache/sis/util/ComparisonMode.java   |  4 +-
 .../org/apache/sis/util/LenientComparable.java     |  3 +-
 .../test/org/apache/sis/test/TestUtilities.java    | 32 +++++++++++++
 geoapi/snapshot                                    |  2 +-
 .../org/apache/sis/gui/referencing/CRSChooser.java | 24 ++++++----
 .../gui/referencing/RecentReferenceSystems.java    |  2 +-
 .../main/org/apache/sis/gui/referencing/Utils.java | 24 ++++++----
 59 files changed, 390 insertions(+), 207 deletions(-)

diff --cc 
endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/GeodeticObjectParser.java
index 1b9ca46297,b882cec7f4..798c00d7e8
--- 
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/GeodeticObjectParser.java
+++ 
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/GeodeticObjectParser.java
@@@ -85,9 -84,13 +84,12 @@@ import org.apache.sis.util.privy.String
  import org.apache.sis.util.resources.Errors;
  import org.apache.sis.util.iso.Types;
  
 -// Specific to the geoapi-4.0 branch:
 -import org.apache.sis.referencing.crs.DefaultImageCRS;
 -import org.apache.sis.referencing.datum.DefaultImageDatum;
 +// Specific to the main and geoapi-3.1 branches:
 +import org.opengis.referencing.ReferenceIdentifier;
  
+ // Specific to the geoapi-3.1 and geoapi-4.0 branches:
+ import org.opengis.referencing.ObjectDomain;
+ 
  
  /**
   * Well Known Text (WKT) parser for referencing objects. This include, but is 
not limited too,
diff --cc 
endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/privy/NilReferencingObject.java
index 5c60061a72,24d4cb655e..6d95249674
--- 
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/privy/NilReferencingObject.java
+++ 
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/privy/NilReferencingObject.java
@@@ -67,11 -66,11 +67,20 @@@ public final class NilReferencingObjec
          return NilReason.TEMPLATE;
      }
  
-     /*
-      * Simple properties. Not all of them are optional, but SIS is tolerant 
to null values.
-      * Returning null for collection are okay in the particular case of SIS 
implementation,
-      * because the constructor will replace empty collections by null 
references anyway.
+     /**
+      * Returns the localized "unnamed" name because this property is 
mandatory.
+      */
+     @Override
 -    public Identifier getName() {
++    public ReferenceIdentifier getName() {
+         return UNNAMED;
+     }
++
++    /**
++     * For avoiding ambiguity.
 +     */
-     @Override public ReferenceIdentifier getName()  {return UNNAMED;}
-     @Override public InternationalString getScope() {return null;}
++    @Override
++    @Deprecated
++    public InternationalString getScope() {
++        return null;
++    }
  }
diff --cc 
endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/GeodeticObjectVerifier.java
index 63c6dfb55a,0163c3330c..d5a6fc3dd1
--- 
a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/GeodeticObjectVerifier.java
+++ 
b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/GeodeticObjectVerifier.java
@@@ -203,9 -218,9 +218,9 @@@ public final class GeodeticObjectVerifi
       * @param  isExtentMandatory  {@code true} if the domain of validity is 
required to contain an
       *                            {@code Extent} element for the world, or 
{@code false} if optional.
       */
 -    public static void assertIsWGS84(final GeodeticDatum datum, boolean 
isExtentMandatory) {
 +    public static void assertIsWGS84(final GeodeticDatum datum, final boolean 
isExtentMandatory) {
          assertEquals("World Geodetic System 1984", datum.getName().getCode(), 
"name");
-         assertIsWorld    (datum.getDomainOfValidity(), isExtentMandatory);
+         assertIsWorld    (datum, isExtentMandatory);
          assertIsGreenwich(datum.getPrimeMeridian());
          assertIsWGS84    (datum.getEllipsoid());
      }
diff --cc 
endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/datum/HardCodedDatum.java
index 9c3c6a0c0c,bd7f3702d2..dd71d69c9d
--- 
a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/datum/HardCodedDatum.java
+++ 
b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/datum/HardCodedDatum.java
@@@ -115,8 -118,8 +118,9 @@@ public final class HardCodedDatum 
       * Ellipsoid for measurements of height above the ellipsoid.
       * This is not a valid datum according ISO 19111, but is used by Apache 
SIS for internal calculation.
       */
++    @SuppressWarnings("deprecation")
      public static final DefaultVerticalDatum ELLIPSOID = new 
DefaultVerticalDatum(
-             properties("Ellipsoid", null, SPHERE.getScope()),
+             properties("Ellipsoid", null, getScope(SPHERE)),
              VerticalDatumTypes.ELLIPSOIDAL);
  
      /**
@@@ -150,7 -153,7 +154,7 @@@
      /**
       * Image with {@link PixelInCell#CELL_CENTER}.
       */
--    @SuppressWarnings("deprecation")
++    @SuppressWarnings("removal")
      public static final DefaultImageDatum IMAGE = new DefaultImageDatum(
              properties("Image", null, null),
              PixelInCell.CELL_CENTER);
@@@ -176,6 -183,13 +184,14 @@@
          return properties;
      }
  
+     /**
+      * Returns the scope of the given object.
+      */
++    @SuppressWarnings("deprecation")
+     private static CharSequence getScope(final AbstractDatum object) {
 -        return object.getDomains().iterator().next().getScope();
++        return object.getScope();
+     }
+ 
      /**
       * Do not allow instantiation of this class.
       */
diff --cc geoapi/snapshot
index 4235801918,ae7a832b6a..d7b6639c48
--- a/geoapi/snapshot
+++ b/geoapi/snapshot
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 4235801918a06f807a93b490fcc12d060f81004e
 -Subproject commit ae7a832b6ae7cfc073cc5596bde39481b5b905df
++Subproject commit d7b6639c48044ae88ed1da656f9aa62092b2cac5
diff --cc 
optional/src/org.apache.sis.gui/main/org/apache/sis/gui/referencing/CRSChooser.java
index e5265d2672,8ba3e2497e..313f1ac979
--- 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/referencing/CRSChooser.java
+++ 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/referencing/CRSChooser.java
@@@ -345,13 -347,17 +347,17 @@@ public class CRSChooser extends Dialog<
      /**
       * Sets the text that describes the domain of validity.
       */
-     private void setDomainOfValidity(final Extent domainOfValidity, final 
Locale locale) {
-         String text  = Extents.getDescription(domainOfValidity, locale);
-         String tip   = text;
 -    private void setDomainOfValidity(CoordinateReferenceSystem crs, final 
Locale locale) {
++    private void setDomainOfValidity(final CoordinateReferenceSystem crs, 
final Locale locale) {
+         String extent = null;
+         for (ObjectDomain c : crs.getDomains()) {
+             extent = Extents.getDescription(c.getDomainOfValidity(), locale);
+             if (extent != null) break;
+         }
+         String tip   = extent;
          Color  color = Styles.NORMAL_TEXT;
-         if (!Utils.intersects(areaOfInterest, domainOfValidity)) {
+         if (!Utils.intersects(areaOfInterest, crs)) {
              tip   = 
Resources.forLocale(locale).getString(Resources.Keys.DoesNotCoverAOI);
-             text  = Styles.WARNING_ICON + " " + (text != null ? text : tip);
+             extent  = Styles.WARNING_ICON + " " + (extent != null ? extent : 
tip);
              color = Styles.ERROR_TEXT;
          }
          domain.setTextFill(color);

Reply via email to