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 a5db7e310668372fd6e2f142f45ca56f7f6dc5cf
Merge: b35ebd489f f173cc01f5
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Fri Apr 5 23:44:04 2024 +0200

    Merge branch 'geoapi-3.1'.

 .../main/org/apache/sis/io/wkt/Convention.java       |  7 +------
 .../org/apache/sis/io/wkt/GeodeticObjectParser.java  |  8 ++++----
 .../main/org/apache/sis/referencing/CRS.java         | 20 ++++++++++++++------
 .../sis/referencing/crs/DefaultEngineeringCRS.java   |  4 ++++
 .../apache/sis/referencing/crs/DefaultImageCRS.java  |  6 +++---
 .../sis/referencing/cs/DefaultUserDefinedCS.java     |  4 ++--
 .../sis/referencing/datum/DefaultImageDatum.java     |  6 +++---
 .../referencing/factory/GeodeticObjectFactory.java   |  2 +-
 .../apache/sis/referencing/internal/Resources.java   |  5 +++++
 .../sis/referencing/internal/Resources.properties    |  1 +
 .../sis/referencing/internal/Resources_fr.properties |  1 +
 .../sis/referencing/AuthorityFactoriesTest.java      |  3 ++-
 .../referencing/factory/AuthorityFactoryMock.java    |  3 +++
 13 files changed, 44 insertions(+), 26 deletions(-)

diff --cc 
endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/GeodeticObjectParser.java
index 80d33f41ed,1b9ca46297..bf1888bd5c
--- 
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
@@@ -1578,9 -1563,10 +1578,9 @@@ class GeodeticObjectParser extends Math
       *
       * @param  mode    {@link #FIRST}, {@link #OPTIONAL} or {@link 
#MANDATORY}.
       * @param  parent  the parent element.
-      * @return the {@code "ImageDatum"} element as an {@link ImageDatum} 
object.
+      * @return the {@code "ImageDatum"} element.
       * @throws ParseException if the {@code "ImageDatum"} element cannot be 
parsed.
       */
 -    @SuppressWarnings("deprecation")
      private ImageDatum parseImageDatum(final int mode, final Element parent) 
throws ParseException {
          final Element element = parent.pullElement(mode, 
WKTKeywords.ImageDatum, WKTKeywords.IDatum);
          if (element == null) {
diff --cc 
endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CRS.java
index f2df4e7307,5a757e688a..763e9465ef
--- 
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CRS.java
+++ 
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CRS.java
@@@ -913,9 -958,9 +913,9 @@@ public final class CRS extends Static 
  
      /**
       * Returns the epoch to which the coordinates of stations defining the 
dynamic CRS are referenced.
-      * If the CRS is associated to a dynamic reference frame, then the 
reference
-      * epoch of that datum is returned. Otherwise if the CRS is {@linkplain 
CompoundCRS compound},
-      * then the first reference epoch found in a component is returned.
 -     * If the CRS is associated to a {@linkplain DynamicReferenceFrame 
dynamic datum}, then the epoch
++     * If the CRS is associated to a dynamic datum, then the epoch
+      * of that datum is returned. Otherwise if the CRS is {@linkplain 
CompoundCRS compound}, then this
+      * method requires that all dynamic components have the same epoch.
       *
       * @param  crs  the coordinate reference frame from which to get the 
epoch, or {@code null}.
       * @return epoch to which the coordinates of stations defining the 
dynamic CRS frame are referenced.
@@@ -926,13 -973,19 +928,19 @@@
          if (crs instanceof SingleCRS) {
              final Datum datum = ((SingleCRS) crs).getDatum();
              if (datum instanceof DynamicReferenceFrame) {
-                 return Optional.of(((DynamicReferenceFrame) 
datum).getFrameReferenceEpoch());
+                 epoch = ((DynamicReferenceFrame) 
datum).getFrameReferenceEpoch();
              }
          } else if (crs instanceof CompoundCRS) {
 -            for (SingleCRS component : ((CompoundCRS) 
crs).getSingleComponents()) {
 +            for (SingleCRS component : getSingleComponents(crs)) {
                  final Datum datum = component.getDatum();
                  if (datum instanceof DynamicReferenceFrame) {
-                     return Optional.of(((DynamicReferenceFrame) 
datum).getFrameReferenceEpoch());
+                     final Temporal t = ((DynamicReferenceFrame) 
datum).getFrameReferenceEpoch();
+                     if (t != null) {
+                         if (epoch == null) epoch = t;
+                         else if (!epoch.equals(t)) {
+                             throw new 
GeodeticException(Resources.format(Resources.Keys.InconsistentEpochs_2, epoch, 
t));
+                         }
+                     }
                  }
              }
          }
diff --cc 
endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
index 35344e3953,291317e1d0..11385f8901
--- 
a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
+++ 
b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
@@@ -103,8 -103,12 +103,11 @@@ public final class AuthorityFactoryMoc
  
      /**
       * Returns the authority codes for the given type.
+      *
+      * @param  type  the type of referencing object for which to get 
authority codes.
+      * @return the set of authority codes for referencing objects of the 
given type.
       */
      @Override
 -    @SuppressWarnings("deprecation")
      public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> 
type) {
          assertFalse(isClosed());
          final Set<String> codes = new LinkedHashSet<>();

Reply via email to