This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits 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 b45dfc6001 feat(GeoHeif): extend URIDataStore instead of DataStore
b45dfc6001 is described below
commit b45dfc6001d378a7d304fdfb9e24b846f794ab0a
Author: jsorel <[email protected]>
AuthorDate: Fri Jun 5 09:27:25 2026 +0200
feat(GeoHeif): extend URIDataStore instead of DataStore
---
.../apache/sis/storage/geoheif/GeoHeifStore.java | 34 +++++++++-------------
.../sis/storage/geoheif/GeoHeifStoreProvider.java | 18 ++++--------
2 files changed, 18 insertions(+), 34 deletions(-)
diff --git
a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStore.java
b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStore.java
index 0a1643f888..77ebf64122 100644
---
a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStore.java
+++
b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStore.java
@@ -18,6 +18,7 @@ package org.apache.sis.storage.geoheif;
import java.net.URI;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.Collection;
@@ -41,6 +42,8 @@ import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreClosedException;
import org.apache.sis.storage.Resource;
import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.base.AuxiliaryContent;
+import org.apache.sis.storage.base.URIDataStore;
import org.apache.sis.storage.metadata.MetadataBuilder;
import org.apache.sis.storage.base.URIDataStoreOption;
import org.apache.sis.storage.modifier.CoverageModifier;
@@ -59,23 +62,7 @@ import org.apache.sis.util.resources.Errors;
* @author Johann Sorel (Geomatys)
* @author Martin Desruisseaux (Geomatys)
*/
-public class GeoHeifStore extends DataStore implements Aggregate {
- /**
- * The {@link GeoHeifStoreProvider#LOCATION} parameter value, or {@code
null} if none.
- * This is used for information purpose only, not for actual reading
operations.
- *
- * @see #getOpenParameters()
- */
- private final URI location;
-
- /**
- * Same value as {@link #location} but as a path, or {@code null} if none.
- * Stored separately because conversion from path to URI then back to path
- * is not looseness (relative paths become absolutes).
- *
- * @see #getFileSet()
- */
- private final Path path;
+public class GeoHeifStore extends URIDataStore implements Aggregate {
/**
* The data store identifier created from the filename, or {@code null} if
none.
@@ -141,8 +128,6 @@ public class GeoHeifStore extends DataStore implements
Aggregate {
*/
public GeoHeifStore(final DataStoreProvider provider, final
StorageConnector connector) throws DataStoreException {
super(provider, connector);
- location = connector.getStorageAs(URI.class);
- path = connector.getStorageAs(Path.class);
input = connector.commit(ChannelImageInputStream.class,
GeoHeifStoreProvider.NAME);
customizer = CoverageModifier.getOrDefault(connector);
nameFactory = DefaultNameFactory.provider();
@@ -176,8 +161,8 @@ public class GeoHeifStore extends DataStore implements
Aggregate {
*/
@Override
public Optional<FileSet> getFileSet() throws DataStoreException {
- if (path != null) {
- return Optional.of(new FileSet(path));
+ if (locationAsPath != null) {
+ return Optional.of(new FileSet(locationAsPath));
}
return Optional.empty();
}
@@ -364,4 +349,11 @@ public class GeoHeifStore extends DataStore implements
Aggregate {
}
}
}
+
+ /**
+ * TODO refactor
+ */
+ AuxiliaryContent readAuxiliaryPath(String ext) throws URISyntaxException,
IOException, DataStoreException {
+ return readAuxiliaryFile(ext, false);
+ }
}
diff --git
a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStoreProvider.java
b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStoreProvider.java
index 1c22ec59df..d866d7aad5 100644
---
a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStoreProvider.java
+++
b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStoreProvider.java
@@ -17,6 +17,7 @@
package org.apache.sis.storage.geoheif;
import java.nio.ByteBuffer;
+import org.apache.sis.parameter.ParameterBuilder;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.apache.sis.storage.Aggregate;
import org.apache.sis.storage.DataStore;
@@ -28,6 +29,7 @@ import org.apache.sis.storage.GridCoverageResource;
import org.apache.sis.storage.base.Capability;
import org.apache.sis.storage.base.StoreMetadata;
import org.apache.sis.storage.base.URIDataStoreOption;
+import org.apache.sis.storage.base.URIDataStoreProvider;
import org.apache.sis.storage.tiling.TiledResource;
import org.apache.sis.storage.isobmff.base.FileType;
@@ -43,7 +45,7 @@ import org.apache.sis.storage.isobmff.base.FileType;
fileSuffixes = {"heif", "heij", "heic", "avif"},
capabilities = {Capability.READ},
resourceTypes = {Aggregate.class, GridCoverageResource.class,
TiledResource.class})
-public class GeoHeifStoreProvider extends DataStoreProvider {
+public class GeoHeifStoreProvider extends URIDataStoreProvider {
/**
* Format name.
*/
@@ -54,11 +56,6 @@ public class GeoHeifStoreProvider extends DataStoreProvider {
*/
private static final String MIME_TYPE = "image/heif";
- /**
- * The parameter descriptor to be returned by {@link #getOpenParameters()}.
- */
- private static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
URIDataStoreOption.createForLocationOnly(NAME);
-
/**
* Creates a new provider.
*/
@@ -75,14 +72,9 @@ public class GeoHeifStoreProvider extends DataStoreProvider {
return NAME;
}
- /**
- * Returns a description of all parameters accepted by this provider for
opening a GeoHEIF file.
- *
- * @return description of available parameters for opening a GeoHEIF file.
- */
@Override
- public ParameterDescriptorGroup getOpenParameters() {
- return OPEN_DESCRIPTOR;
+ protected ParameterDescriptorGroup createOpenParameters(ParameterBuilder
builder) {
+ return super.createOpenParameters(builder);
}
/**