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

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


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 68dd68b6c2 `SampleDimension` implements `IdentifiedType`. It gives us 
a common parent interface between `FeatureType` and `SampleDimension`.
68dd68b6c2 is described below

commit 68dd68b6c27ff61218f039dd065f0e0be2f3d95a
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Mon Aug 4 10:37:50 2025 +0200

    `SampleDimension` implements `IdentifiedType`.
    It gives us a common parent interface between `FeatureType` and 
`SampleDimension`.
---
 .../org/apache/sis/coverage/SampleDimension.java   | 27 ++++++++++++++++++++--
 .../main/org/apache/sis/coverage/package-info.java |  2 +-
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git 
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java
 
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java
index f70aead042..c082297388 100644
--- 
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java
+++ 
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java
@@ -44,6 +44,9 @@ import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.iso.Names;
 
+// Specific to the geoapi-3.1 and geoapi-4.0 branches:
+import org.opengis.feature.IdentifiedType;
+
 
 /**
  * Describes the data values in a coverage (the range). For a raster, a sample 
dimension is a band.
@@ -75,13 +78,13 @@ import org.apache.sis.util.iso.Names;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Alexis Manin (Geomatys)
- * @version 1.2
+ * @version 1.5
  *
  * @see org.opengis.metadata.content.SampleDimension
  *
  * @since 1.0
  */
-public class SampleDimension implements Serializable {
+public class SampleDimension implements IdentifiedType, Serializable {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -212,10 +215,30 @@ public class SampleDimension implements Serializable {
      *
      * @see org.opengis.metadata.content.RangeDimension#getSequenceIdentifier()
      */
+    @Override
     public GenericName getName() {
         return name;
     }
 
+    /**
+     * Returns a concise definition of this sample dimensions.
+     * This definition may be shown in user interfaces and should be 
considered as indicative only.
+     * The default implementation may change between different versions of 
Apache <abbr>SIS</abbr>.
+     *
+     * @return concise definition of the sample dimension.
+     *
+     * @since 1.5
+     */
+    @Override
+    public InternationalString getDefinition() {
+        for (Category category : categories) {
+            if (category.isQuantitative()) {
+                return category.getName();
+            }
+        }
+        return getName().toInternationalString();
+    }
+
     /**
      * Returns all categories in this sample dimension. Note that a {@link 
Category} object may apply to an arbitrary range
      * of sample values. Consequently, the first element in this collection 
may not be directly related to the sample value
diff --git 
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/package-info.java
 
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/package-info.java
index 65ea533405..cf2ce3869a 100644
--- 
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/package-info.java
+++ 
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/package-info.java
@@ -23,7 +23,7 @@
  * {@link org.apache.sis.coverage.grid}.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 1.4
+ * @version 1.5
  * @since   1.0
  */
 package org.apache.sis.coverage;

Reply via email to