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

jsorel 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 9497307b88 Add getMetadata method on Tile,TileMatrix,TileMatrixSet
9497307b88 is described below

commit 9497307b88a401a54287cd28fcd8a048af2a94d0
Author: jsorel <johann.so...@geomatys.com>
AuthorDate: Thu Apr 25 14:55:50 2024 +0200

    Add getMetadata method on Tile,TileMatrix,TileMatrixSet
---
 .../main/org/apache/sis/storage/tiling/Tile.java           | 14 ++++++++++++++
 .../main/org/apache/sis/storage/tiling/TileMatrix.java     | 14 ++++++++++++++
 .../main/org/apache/sis/storage/tiling/TileMatrixSet.java  | 13 +++++++++++++
 3 files changed, 41 insertions(+)

diff --git 
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/Tile.java
 
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/Tile.java
index 93d195d778..2961cedf96 100644
--- 
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/Tile.java
+++ 
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/Tile.java
@@ -21,6 +21,7 @@ import org.apache.sis.coverage.grid.GridGeometry;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.GridCoverageResource;
 import org.apache.sis.storage.Resource;
+import org.opengis.metadata.Metadata;
 
 
 /**
@@ -63,6 +64,19 @@ public interface Tile {
      */
     long[] getIndices();
 
+    /**
+     * Returns information about this tile.
+     *
+     * Tile metadata may differ from the tile resource metadata.
+     * It may be a subset of the resource metadata or it may be unrelated.
+     * The tile metadata may be null if it does not contain any revelant 
information or
+     * that are already in the tile matrix or tile matrix set metadata.
+     *
+     * @return information about this tile. Can be {@code null}.
+     * @throws DataStoreException if an error occurred while reading the 
metadata.
+     */
+    Metadata getMetadata() throws DataStoreException;
+
     /**
      * Returns information about whether the tile failed to load.
      * The return value can be {@link TileStatus#EXISTS} or {@link 
TileStatus#IN_ERROR};
diff --git 
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrix.java
 
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrix.java
index 63f4a7574e..a6538cdc74 100644
--- 
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrix.java
+++ 
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrix.java
@@ -24,6 +24,7 @@ import org.apache.sis.coverage.grid.GridExtent;
 import org.apache.sis.coverage.grid.GridGeometry;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.NoSuchDataException;
+import org.opengis.metadata.Metadata;
 
 
 /**
@@ -49,6 +50,19 @@ public interface TileMatrix {
      */
     GenericName getIdentifier();
 
+    /**
+     * Returns information about this tile matrix.
+     *
+     * Returned metadata should contain a description of the tile format at 
path :
+     * {@code Metadata/identificationInfo/resourceFormat}.
+     * The tile metadata may be null if it does not contain any revelant 
information or
+     * that are already in the tile matrix set metadata.
+     *
+     * @return information about this tile matrix. Can be {@code null}.
+     * @throws DataStoreException if an error occurred while reading the 
metadata.
+     */
+    Metadata getMetadata() throws DataStoreException;
+
     /*
      * There is no `getTileSize()` method because tiles are not necessarily 
for grid coverages.
      * Tile size do not apply to vector tiles, quantized mesh or 3D tiles.
diff --git 
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrixSet.java
 
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrixSet.java
index 24bf9d23aa..0370882a1d 100644
--- 
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrixSet.java
+++ 
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/TileMatrixSet.java
@@ -18,7 +18,9 @@ package org.apache.sis.storage.tiling;
 
 import java.util.Optional;
 import java.util.SortedMap;
+import org.apache.sis.storage.DataStoreException;
 import org.opengis.geometry.Envelope;
+import org.opengis.metadata.Metadata;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.util.GenericName;
 
@@ -58,6 +60,17 @@ public interface TileMatrixSet {
      */
     GenericName getIdentifier();
 
+    /**
+     * Returns information about this tile matrix set.
+     *
+     * Returned metadata should contain a description of the tile format at 
path :
+     * {@code Metadata/identificationInfo/resourceFormat}.
+     *
+     * @return information about this tile matrix set. Should not be {@code 
null}.
+     * @throws DataStoreException if an error occurred while reading the 
metadata.
+     */
+    Metadata getMetadata() throws DataStoreException;
+
     /**
      * Returns the coordinate reference system of all {@code TileMatrix} 
instances in this set.
      * This is the value returned by {@code 
TileMatrix.getTilingScheme().getCoordinateReferenceSystem()}.

Reply via email to