You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by am...@apache.org on 2026/05/18 15:54:42 UTC

(sis) branch fix/image-tile-matrix-get-tile updated (ac78d7ec34 -> 3f10b8f44a)

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

alexismanin pushed a change to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git


 discard ac78d7ec34 test(Storage): add a test that shows a bug in ImageTileMatrix when trying to get the resource of a 3D tile
 discard a32122541e chore(Build): ugrade Gradle wrapper to 8.14.4 to allow building with JDK 24
     add 021bb9624f feat(Shapefile): add incremental id shapefile test
     add 45ea93f10c feat(Geometry): add physics model api from ISO 12113
     add d82902e847 fix(Shapefile): always generate an incremental feature identifier
     add 7be914eae2 Move `OptionKey` to the storage module. Retrofit `DataOptionKey` into `OptionKey`. Old classes are deprecated for removal.
     add 7d99b77b9b Add an option for allowing users to supply their own `XMLInputFactory`. Reuse the check done in `InputFactory` against unsupported properties.
     add 69a2a1c8d6 feat(Shapefile): create identifiers conform to gml requierements
     add f9ada6f7bc Be more tolerant in the comparison of members of a datum ensemble.
     add f9c3aa8b2a Replace numerical values of enumerations by text in GeoTIFF metadata. This is for making debugging easier.
     add 953ad86847 When invoking `CRS.findOperation(sourceCRS, targetCRS, context)` with a pair of CRSs created by `GridGeometry.createGridCRS(…)`, try to delegate to `GridGeometry.createTransformTo(…)`.
     add d367107cdb feat(Shapefile): generate consistant feature index when filters are used
     add 781bfe91d8 feat(DataStore): add timezone parameter name constant
     add ea81e2ea10 feat(Shapefile): add support for timezone parameter
     add faa80d5c73 Add an `InternalDataStoreException` for making easier to spot exceptions that shouldn't happen.
     add 374e94d4cd Rename the `gimi` sub-package as `geo` because the GIMI draft standard is heading toward a different approach based on RDF files.
     add 3f23779ec3 Replace `@todo` Javadoc tag by a new `@Incomplete` annotation for identifying the boxes that are not fully implemented.
     add d024c7dd36 In the tree representation of GeoHEIF nodes, indicate when a box is unsupported.
     add 7ca22a3878 Implement the support of the `tilC` box in GeoHEIF files.
     add ad86df60e5 In the tree of GeoHEIF nodes, move the nodes derived from `flags` below the "flags" node.
     add 3123aa404b Replace the internal `TreeFormatCustomization` interface by a public `TreeTable.Node.isVisible()` method.
     add 63c9dc02ec Move the storage metadata helper classes to a separated package. This is in anticipation for the addition of more types.
     new 5297d25a3c chore(Build): ugrade Gradle wrapper to 8.14.4 to allow building with JDK 24
     new 90837fcefb test(Storage): add a test that shows a bug in ImageTileMatrix when trying to get the resource of a 3D tile
     new a0449bf1b4 fix(Storage): Fix ImageTileMatrix tile indices to work with slices in N dimensions.
     new 62bbf09a54 chore(Storage): improve ImageTileMatrix test to verify multiple ways to acquire tiles
     new 08b1e097d7 fix(Storage): Properly handle user "getTiles" requests when requesting multidimensional extents
     new c99b7c431e fix(Image): fix ReshapedImage.singleTile to strictly return the designated tile, and only this tile.
     new 3f10b8f44a fix(Image): Prevent reshaped image to return data outside its domain

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ac78d7ec34)
            \
             N -- N -- N   refs/heads/fix/image-tile-matrix-get-tile (3f10b8f44a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/org/apache/sis/console/CommandRunner.java |   4 +-
 .../apache/sis/console/FormattedOutputCommand.java |   2 +-
 .../org/apache/sis/console/TranslateCommand.java   |   2 +-
 .../coverage/grid/CoordinateOperationFinder.java   |  44 +--
 .../apache/sis/coverage/grid/GridCRSBuilder.java   | 128 ++++++--
 .../sis/image/internal/shared/ReshapedImage.java   |  14 +-
 .../apache/sis/coverage/grid/GridGeometryTest.java |  48 +++
 .../image/internal/shared/ReshapedImageTest.java   |  31 ++
 .../main/org/apache/sis/metadata/TreeNode.java     |  84 ++++-
 .../org/apache/sis/metadata/TreeNodeChildren.java  |   9 +-
 .../org/apache/sis/metadata/TreeTableView.java     |  55 +---
 .../org/apache/sis/xml/PooledUnmarshaller.java     |   8 +-
 .../main/org/apache/sis/xml/TransformedEvent.java  |   2 +-
 .../main/org/apache/sis/xml/XML.java               |   4 +-
 .../sis/xml/internal/shared/InputFactory.java      |  42 ++-
 .../main/org/apache/sis/xml/package-info.java      |  24 +-
 .../apache/sis/metadata/TreeTableFormatTest.java   |  15 +-
 .../sis/xml/internal/shared/InputFactoryTest.java  |   8 +-
 .../main/org/apache/sis/io/wkt/WKTFormat.java      |   4 +-
 .../sis/referencing/cs/CoordinateSystems.java      |   2 +-
 .../referencing/datum/DefaultDatumEnsemble.java    |  30 +-
 .../apache/sis/referencing/datum/package-info.java |   2 +-
 .../factory/CommonAuthorityFactory.java            |   6 +-
 .../referencing/factory/FactoryDataException.java  |   2 +-
 .../referencing/factory/GeodeticObjectFactory.java |   2 +-
 ...xception.java => InternalFactoryException.java} |  28 +-
 .../internal/ParameterizedTransformBuilder.java    |   4 +-
 .../internal/shared/CoordinateOperations.java      |   4 +-
 .../internal/shared/OperationMethodExt.java        |  73 +++++
 .../operation/AbstractCoordinateOperation.java     |   7 +-
 .../operation/AbstractSingleOperation.java         |   4 +-
 .../operation/CoordinateOperationContext.java      |   2 +-
 .../operation/CoordinateOperationFinder.java       |  69 ++--
 .../operation/CoordinateOperationRegistry.java     |  14 +-
 .../operation/DefaultConcatenatedOperation.java    |   4 +-
 .../DefaultCoordinateOperationFactory.java         |  19 +-
 .../sis/referencing/operation/DefaultFormula.java  |   9 +-
 .../operation/DefaultOperationMethod.java          |   4 +-
 .../referencing/operation/gridded/LoadedGrid.java  |   2 +-
 .../operation/projection/ZonedGridSystem.java      |   3 +-
 .../provider/FranceGeocentricInterpolation.java    |   3 +-
 .../GeocentricAffineBetweenGeographic.java         |   3 +-
 .../operation/provider/GeocentricToGeographic.java |   3 +-
 .../operation/provider/Geographic3Dto2D.java       |   3 +-
 .../operation/provider/Spherical2Dto3D.java        |   3 +-
 .../operation/provider/VerticalOffset.java         |   3 +-
 .../transform/DefaultMathTransformFactory.java     |   3 +-
 .../transform/EllipsoidToRadiusTransform.java      |   3 +-
 .../operation/transform/MathTransformProvider.java |  31 +-
 .../test/org/apache/sis/io/wkt/WKTFormatTest.java  |  21 +-
 .../operation/DefaultTransformationTest.java       |   3 +-
 .../main/org/apache/sis/storage/landsat/Band.java  |   4 +-
 .../org/apache/sis/storage/landsat/BandGroup.java  |   2 +-
 .../apache/sis/storage/landsat/LandsatStore.java   |   2 +-
 .../apache/sis/storage/landsat/MetadataReader.java |   2 +-
 .../storage/landsat/LandsatStoreProviderTest.java  |   2 +-
 .../apache/sis/storage/geotiff/Compression.java    |   2 +-
 .../apache/sis/storage/geotiff/FormatModifier.java |   2 +-
 .../apache/sis/storage/geotiff/GeoTiffStore.java   |   4 +-
 .../apache/sis/storage/geotiff/NativeMetadata.java | 106 +++++-
 .../org/apache/sis/storage/geotiff/Writer.java     |   2 +-
 .../geotiff/reader/GridGeometryBuilder.java        |   2 +-
 .../geotiff/reader/ImageMetadataBuilder.java       |   2 +-
 .../sis/storage/geotiff/reader/Localization.java   |   3 +-
 .../sis/storage/geotiff/reader/XMLMetadata.java    |   5 +-
 .../sis/storage/geotiff/writer/GeoEncoder.java     |   2 +-
 .../storage/geotiff/reader/XMLMetadataTest.java    |   2 +-
 .../apache/sis/storage/netcdf/MetadataReader.java  |   2 +-
 .../org/apache/sis/storage/netcdf/NetcdfStore.java |   2 +-
 .../sis/storage/netcdf/NetcdfStoreProvider.java    |   2 +-
 .../apache/sis/storage/netcdf/base/Decoder.java    |   2 +-
 .../sis/storage/netcdf/base/RasterResource.java    |   2 +-
 .../sis/storage/netcdf/classic/ChannelDecoder.java |   2 +-
 .../sis/storage/netcdf/ucar/DecoderWrapper.java    |   2 +-
 .../main/org/apache/sis/storage/sql/SQLStore.java  |   4 +-
 .../apache/sis/storage/sql/feature/Database.java   |   2 +-
 .../sis/storage/sql/feature/SchemaModifier.java    |   4 +-
 .../sis/storage/sql/postgis/PostgresTest.java      |   2 +-
 .../main/org/apache/sis/storage/gpx/Store.java     |   2 +-
 .../main/org/apache/sis/storage/gpx/Types.java     |   2 +-
 .../sis/storage/xml/stream/StaxDataStore.java      |  41 +--
 .../org/apache/sis/storage/gpx/ReaderTest.java     |   2 +-
 .../org/apache/sis/storage/gpx/UpdaterTest.java    |   2 +-
 .../org/apache/sis/storage/gpx/WriterTest.java     |   2 +-
 .../org.apache.sis.storage/main/module-info.java   |  13 +
 .../apache/sis/io/stream/InternalOptionKey.java    |   2 +-
 .../org/apache/sis/storage/AbstractFeatureSet.java |   2 +-
 .../sis/storage/AbstractGridCoverageResource.java  |   2 +-
 .../org/apache/sis/storage/AbstractResource.java   |   2 +-
 .../org/apache/sis/storage/CoverageSubset.java     |   2 +-
 .../main/org/apache/sis/storage/DataOptionKey.java |  83 +----
 .../main/org/apache/sis/storage/DataStore.java     |   3 +-
 .../org/apache/sis/storage/DataStoreProvider.java  |  13 +
 .../org/apache/sis/storage/DataStoreRegistry.java  |   2 +-
 .../main/org/apache/sis/storage/FeatureSubset.java |   2 +-
 .../sis/storage/InternalDataStoreException.java    |   9 +-
 .../main/org/apache/sis/storage/OptionKey.java     | 297 +++++++++++++++++
 .../org/apache/sis/storage/StorageConnector.java   |  19 +-
 .../storage/aggregate/AggregatedFeatureSet.java    |   2 +-
 .../sis/storage/aggregate/AggregatedResource.java  |   2 +-
 .../aggregate/BandAggregateGridResource.java       |   2 +-
 .../aggregate/ConcatenatedGridResource.java        |   2 +-
 .../sis/storage/aggregate/GroupAggregate.java      |   2 +-
 .../main/org/apache/sis/storage/base/CodeType.java |  12 +-
 .../sis/storage/base/DocumentedStoreProvider.java  |   2 +-
 .../org/apache/sis/storage/base/PRJDataStore.java  |   2 +-
 .../org/apache/sis/storage/base/URIDataStore.java  |  12 +-
 .../sis/storage/base/URIDataStoreProvider.java     |  14 +-
 .../org/apache/sis/storage/base/package-info.java  |   2 +-
 .../main/org/apache/sis/storage/csv/Store.java     |   9 +-
 .../org/apache/sis/storage/csv/StoreProvider.java  |   6 +-
 .../org/apache/sis/storage/csv/package-info.java   |   2 +-
 .../apache/sis/storage/esri/AsciiGridStore.java    |   6 +-
 .../org/apache/sis/storage/esri/RasterStore.java   |   2 +-
 .../main/org/apache/sis/storage/folder/Store.java  |   7 +-
 .../apache/sis/storage/folder/StoreProvider.java   |   4 +-
 .../apache/sis/storage/folder/WritableStore.java   |   2 +-
 .../apache/sis/storage/image/WorldFileStore.java   |   4 +-
 .../apache/sis/storage/image/WritableStore.java    |   2 +-
 .../storage/{base => metadata}/LegalSymbols.java   |   3 +-
 .../{base => metadata}/MetadataBuilder.java        |   3 +-
 .../{base => metadata}/MetadataFetcher.java        |   8 +-
 .../{base => metadata}/ResourceLineage.java        |   2 +-
 .../apache/sis/storage/metadata}/package-info.java |   6 +-
 .../sis/storage/modifier/CoverageModifier.java     |  10 +-
 .../apache/sis/storage/tiling/ImageTileMatrix.java | 140 ++++++--
 .../org/apache/sis/storage/tiling/TileMatrix.java  |   2 +-
 .../apache/sis/storage/tiling/TileMatrixSet.java   |   2 +-
 .../main/org/apache/sis/storage/wkt/Store.java     |   4 +-
 .../main/org/apache/sis/storage/xml/Store.java     |   4 +-
 .../org/apache/sis/storage/DataOptionKeyTest.java  |  46 ---
 .../org/apache/sis/storage}/OptionKeyTest.java     |  23 +-
 .../apache/sis/storage/StorageConnectorTest.java   |   1 -
 .../apache/sis/storage/csv/StoreProviderTest.java  |   2 +-
 .../test/org/apache/sis/storage/csv/StoreTest.java |   5 +-
 .../apache/sis/storage/esri/WritableStoreTest.java |   2 +-
 .../sis/storage/image/WorldFileStoreTest.java      |   2 +-
 .../{base => metadata}/MetadataBuilderTest.java    |   2 +-
 .../sis/storage/tiling/ImageTileMatrixTest.java    | 152 +++++++--
 .../main/org/apache/sis/setup/GeometryLibrary.java |   2 +-
 .../main/org/apache/sis/setup/OptionKey.java       |  46 +--
 .../main/org/apache/sis/setup/package-info.java    |   5 +-
 .../main/org/apache/sis/util/Exceptions.java       |   6 +-
 .../org/apache/sis/util/collection/TreeTable.java  |  18 +-
 .../sis/util/collection/TreeTableFormat.java       |  40 +--
 .../apache/sis/util/internal/shared/Constants.java |   2 +-
 .../internal/shared/TreeFormatCustomization.java   |  51 ---
 .../org/apache/sis/util/resources/Vocabulary.java  |  10 +
 .../sis/util/resources/Vocabulary.properties       |   2 +
 .../sis/util/resources/Vocabulary_fr.properties    |   2 +
 .../org/apache/sis/geometries/scene/SceneNode.java |  76 +++++
 .../main/org/apache/sis/geometries/scene/Skin.java |   1 +
 .../sis/geometries/scene/physics/Collider.java     |  83 +++++
 .../geometries/scene/physics/ColliderGeometry.java |  65 ++++
 .../geometries/scene/physics/CollisionFilter.java  |  85 +++++
 .../apache/sis/geometries/scene/physics/Joint.java | 360 +++++++++++++++++++++
 .../sis/geometries/scene/physics/Motion.java       | 180 +++++++++++
 .../geometries/scene/physics/PhysicalMaterial.java | 130 ++++++++
 .../sis/geometries/scene/physics/Trigger.java      |  87 +++++
 .../storage/coveragejson/CoverageJsonStore.java    |   2 +-
 .../sis/storage/geoheif/CoverageBuilder.java       |   9 +-
 .../apache/sis/storage/geoheif/GeoHeifStore.java   |   5 +-
 .../sis/storage/geoheif/UncompressedImage.java     |   2 +-
 .../main/org/apache/sis/storage/isobmff/Box.java   |   4 +-
 .../apache/sis/storage/isobmff/BoxRegistry.java    |   9 +
 .../apache/sis/storage/isobmff/ContainerBox.java   |  15 +-
 .../org/apache/sis/storage/isobmff/Extension.java  |  16 +-
 .../org/apache/sis/storage/isobmff/FullBox.java    |  36 +--
 .../org/apache/sis/storage/isobmff/Incomplete.java |  17 +-
 .../sis/storage/isobmff/MainBoxRegistry.java       |   2 +-
 .../org/apache/sis/storage/isobmff/Reader.java     |  11 +-
 .../main/org/apache/sis/storage/isobmff/Root.java  |   2 +-
 .../org/apache/sis/storage/isobmff/TreeNode.java   |  82 ++++-
 .../apache/sis/storage/isobmff/base/Copyright.java |   2 +-
 .../storage/isobmff/base/FDItemInfoExtension.java  |   2 +-
 .../apache/sis/storage/isobmff/base/GroupList.java |   2 +-
 .../apache/sis/storage/isobmff/base/ItemInfo.java  |  11 +-
 .../sis/storage/isobmff/base/ItemInfoEntry.java    |   2 +-
 .../sis/storage/isobmff/base/ItemProperties.java   |  32 +-
 .../isobmff/base/ItemPropertyAssociation.java      |  34 +-
 .../isobmff/base/ItemPropertyContainer.java        |   2 +-
 .../sis/storage/isobmff/base/ItemReference.java    |   5 +-
 .../org/apache/sis/storage/isobmff/base/Meta.java  |   5 +-
 .../org/apache/sis/storage/isobmff/base/Movie.java |   2 +-
 .../sis/storage/isobmff/base/MovieHeader.java      |   5 +-
 .../sis/storage/isobmff/base/OriginalFileType.java |   2 +-
 .../isobmff/base/ProgressiveDownloadInfo.java      |   5 +-
 .../org/apache/sis/storage/isobmff/base/Track.java |   2 +-
 .../sis/storage/isobmff/base/TrackHeader.java      |  24 +-
 .../apache/sis/storage/isobmff/base/UserData.java  |   2 +-
 .../storage/isobmff/{gimi => geo}/ModelCRS.java    |   6 +-
 .../isobmff/{gimi => geo}/ModelTiePoint.java       |   6 +-
 .../isobmff/{gimi => geo}/ModelTransformation.java |   6 +-
 .../isobmff/geo/TiledImageConfiguration.java       | 163 ++++++++++
 .../isobmff/{gimi => geo}/UnknownProperty.java     |   4 +-
 .../isobmff/{gimi => geo}/package-info.java        |   2 +-
 .../isobmff/gimi/TiledImageConfiguration.java      |  56 ----
 .../sis/storage/isobmff/image/UserDescription.java |   2 +-
 .../sis/storage/isobmff/mpeg/ChromaLocation.java   |   5 +-
 .../isobmff/mpeg/ComponentReferenceLevel.java      |   5 +-
 .../isobmff/mpeg/DepthMappingInformation.java      |   5 +-
 .../storage/isobmff/mpeg/DisparityInformation.java |   5 +-
 .../sis/storage/isobmff/mpeg/FieldInterlace.java   |   5 +-
 .../storage/isobmff/mpeg/FieldInterlaceType.java   |   5 +-
 .../isobmff/mpeg/FramePackingInformation.java      |   5 +-
 .../mpeg/PolarizationPatternDefinition.java        |   5 +-
 .../storage/isobmff/mpeg/SensorBadPixelsMap.java   |   5 +-
 .../mpeg/SensorNonUniformityCorrection.java        |   5 +-
 .../sis/storage/isobmff/mpeg/TAIClockInfo.java     |   6 +-
 .../sis/storage/isobmff/mpeg/TAITimeStamp.java     |   5 +-
 .../storage/isobmff/video/ContentDescribes.java    |   5 +-
 .../isobmff/{gimi => geo}/ExtensionTest.java       |   4 +-
 .../org/apache/sis/storage/geopackage/Content.java |   2 +-
 .../sis/storage/geopackage/GpkgStoreProvider.java  |   2 +-
 .../apache/sis/storage/geopackage/Initializer.java |   2 +-
 .../sis/storage/geopackage/GpkgStoreTest.java      |   2 +-
 .../conformance/CoreConformanceTest.java           |   2 +-
 .../main/org/apache/sis/storage/gsf/GSFStore.java  |   2 +-
 .../sis/storage/shapefile/ShapefileProvider.java   |  13 +-
 .../sis/storage/shapefile/ShapefileStore.java      |  39 +--
 .../apache/sis/storage/shapefile/dbf/DBFField.java |   2 +-
 .../sis/storage/shapefile/shp/ShapeRecord.java     |   1 +
 .../sis/storage/shapefile/ShapefileStoreTest.java  |  32 ++
 .../sis/storage/shapefile/dbf/DBFIOTest.java       |   2 +-
 .../apache/sis/storage/shapefile/dbf/Snippets.java |   2 +-
 .../storage/shapefile/{multipoint.cpg => noid.cpg} |   0
 .../test/org/apache/sis/storage/shapefile/noid.dbf | Bin 0 -> 147 bytes
 .../storage/shapefile/{multipoint.prj => noid.prj} |   0
 .../test/org/apache/sis/storage/shapefile/noid.shp | Bin 0 -> 128 bytes
 .../test/org/apache/sis/storage/shapefile/noid.shx | Bin 0 -> 108 bytes
 .../sis/storage/shapefile/shp/ShapeIOTest.java     |   2 +-
 .../apache/sis/storage/shapefile/shp/Snippets.java |   2 +-
 .../org/apache/sis/storage/gdal/GDALStore.java     |   4 +-
 .../apache/sis/storage/gdal/GDALStoreProvider.java |   2 +-
 .../org/apache/sis/storage/gdal/TiledResource.java |   2 +-
 235 files changed, 3082 insertions(+), 1036 deletions(-)
 copy endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/{FactoryDataException.java => InternalFactoryException.java} (68%)
 create mode 100644 endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/shared/OperationMethodExt.java
 create mode 100644 endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/OptionKey.java
 rename endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/{base => metadata}/LegalSymbols.java (99%)
 rename endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/{base => metadata}/MetadataBuilder.java (99%)
 rename endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/{base => metadata}/MetadataFetcher.java (98%)
 rename endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/{base => metadata}/ResourceLineage.java (99%)
 copy {optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal => endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/metadata}/package-info.java (89%)
 delete mode 100644 endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/DataOptionKeyTest.java
 rename endorsed/src/{org.apache.sis.util/test/org/apache/sis/setup => org.apache.sis.storage/test/org/apache/sis/storage}/OptionKeyTest.java (79%)
 rename endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/{base => metadata}/MetadataBuilderTest.java (99%)
 delete mode 100644 endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/TreeFormatCustomization.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/Collider.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/ColliderGeometry.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/CollisionFilter.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/Joint.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/Motion.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/PhysicalMaterial.java
 create mode 100644 incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/Trigger.java
 copy endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/bind/UseLegacyMetadata.java => incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Incomplete.java (69%)
 rename incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/{gimi => geo}/ModelCRS.java (96%)
 rename incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/{gimi => geo}/ModelTiePoint.java (95%)
 rename incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/{gimi => geo}/ModelTransformation.java (95%)
 create mode 100644 incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/geo/TiledImageConfiguration.java
 rename incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/{gimi => geo}/UnknownProperty.java (95%)
 rename incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/{gimi => geo}/package-info.java (96%)
 delete mode 100644 incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/gimi/TiledImageConfiguration.java
 rename incubator/src/org.apache.sis.storage.geoheif/test/org/apache/sis/storage/isobmff/{gimi => geo}/ExtensionTest.java (93%)
 copy incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/{multipoint.cpg => noid.cpg} (100%)
 create mode 100644 incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/noid.dbf
 copy incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/{multipoint.prj => noid.prj} (100%)
 create mode 100644 incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/noid.shp
 create mode 100644 incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/noid.shx


(sis) 02/07: test(Storage): add a test that shows a bug in ImageTileMatrix when trying to get the resource of a 3D tile

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 90837fcefbfc99336320a26a2c6236e6afe9853c
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Thu May 7 18:20:32 2026 +0200

    test(Storage): add a test that shows a bug in ImageTileMatrix when trying to get the resource of a 3D tile
---
 .../sis/storage/tiling/ImageTileMatrixTest.java    | 188 +++++++++++++++++++++
 1 file changed, 188 insertions(+)

diff --git a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java
new file mode 100644
index 0000000000..372713b087
--- /dev/null
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.tiling;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+import java.awt.image.SampleModel;
+import java.awt.image.WritableRaster;
+import java.util.List;
+import java.util.Optional;
+import org.apache.sis.storage.GridCoverageResource;
+import org.opengis.metadata.spatial.DimensionNameType;
+import org.opengis.util.GenericName;
+import org.apache.sis.coverage.SampleDimension;
+import org.apache.sis.coverage.grid.GridExtent;
+import org.apache.sis.coverage.grid.GridGeometry;
+import org.apache.sis.coverage.grid.PixelInCell;
+import org.apache.sis.referencing.operation.matrix.Matrices;
+import org.apache.sis.referencing.operation.matrix.MatrixSIS;
+import org.apache.sis.referencing.operation.transform.MathTransforms;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.util.iso.Names;
+
+// Test dependencies
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.*;
+import org.apache.sis.test.TestCase;
+import org.apache.sis.referencing.crs.HardCodedCRS;
+
+
+/**
+ * Minimal test case for image tile matrices
+ *
+ * @author  Alexis Manin (Geomatys)
+ */
+@SuppressWarnings("exports")
+public final class ImageTileMatrixTest extends TestCase {
+
+    private static final BufferedImage MODEL = new BufferedImage(4, 4, BufferedImage.TYPE_BYTE_GRAY);
+    private static final int TILE_WIDTH  = 4;
+    private static final int TILE_HEIGHT = 4;
+    private static final int NUM_COLS    = 3;
+    private static final int NUM_ROWS    = 3;
+    private static final int NUM_SLICES  = 2;
+
+    /**
+     * Test that a tile from a 3D dataset can return its associated resource.
+     * This is an anti-regression test because of a bug encountered while fetching tile resource.
+     *
+     * @throws DataStoreException if a data store error occurred.
+     */
+    @Test
+    public void testGetResourceFromTile3D() throws DataStoreException {
+        final var resource = new MockTiledResource();
+        final var tileMatrixSets = resource.getTileMatrixSets();
+        assertFalse(tileMatrixSets.isEmpty());
+        final TileMatrixSet tms = tileMatrixSets.iterator().next();
+        assertFalse(tms.getTileMatrices().isEmpty());
+        final TileMatrix matrix = tms.getTileMatrices().values().iterator().next();
+
+        final GridExtent tilingExtent = matrix.getTilingScheme().getExtent();
+        assertEquals(3, tilingExtent.getDimension());
+        final long[] indices = new long[] {
+            tilingExtent.getLow(0),
+            tilingExtent.getLow(1),
+            tilingExtent.getLow(2)
+        };
+
+        final Optional<Tile> optTile = matrix.getTile(indices);
+        assertTrue(optTile.isPresent());
+        final var tile = optTile.get();
+        assertEquals(TileStatus.EXISTS, tile.getStatus());
+        final var tResource = tile.getResource();
+        assertNotNull(tResource);
+        if (!(tResource instanceof GridCoverageResource tileGridResource)) {
+            throw new AssertionError("Tile resource is not a grid resource");
+        }
+        var tileImage = tileGridResource.read(null).render(null);
+        assertEquals(TILE_WIDTH, tileImage.getWidth());
+        assertEquals(TILE_HEIGHT, tileImage.getHeight());
+    }
+
+    /**
+     * A minimal {@link TiledGridCoverageResource} for testing.
+     */
+    private static final class MockTiledResource extends TiledGridCoverageResource {
+
+        private final GridGeometry gridGeometry;
+        private final List<SampleDimension> sampleDimensions;
+
+        MockTiledResource() {
+            super(null);
+            final var extent = new GridExtent(
+                    new DimensionNameType[] {
+                        DimensionNameType.COLUMN,
+                        DimensionNameType.ROW,
+                        DimensionNameType.VERTICAL
+                    },
+                    new long[3],
+                    new long[] {
+                        NUM_COLS * TILE_WIDTH  - 1,
+                        NUM_ROWS * TILE_HEIGHT - 1,
+                        NUM_SLICES - 1
+                    },
+                    true);
+
+            final int dimension = 3;
+            final MatrixSIS gridToCRS = Matrices.createIdentity(dimension + 1);
+            gridToCRS.setNumber(0, 0, 0.5);
+            gridToCRS.setNumber(1, 1, 0.5);
+            gridToCRS.setNumber(2, 2, 100);
+            gridGeometry = new GridGeometry(extent, PixelInCell.CELL_CORNER,
+                    MathTransforms.linear(gridToCRS), HardCodedCRS.WGS84_3D);
+
+            sampleDimensions = List.of(new SampleDimension.Builder().setName("data").build());
+        }
+
+        @Override
+        public GridGeometry getGridGeometry() {
+            return gridGeometry;
+        }
+
+        @Override
+        public List<SampleDimension> getSampleDimensions() {
+            return sampleDimensions;
+        }
+
+        @Override
+        protected int[] getTileSize() {
+            return new int[] {TILE_WIDTH, TILE_HEIGHT, 1};
+        }
+
+        @Override
+        protected ColorModel getColorModel(int[] bands) {
+            return MODEL.getColorModel();
+        }
+
+        @Override
+        protected SampleModel getSampleModel(int[] bands) {
+            return MODEL.getSampleModel();
+        }
+
+        @Override
+        protected TiledGridCoverage read(Subset subset) {
+            return new MockTiledCoverage(subset);
+        }
+    }
+
+    /**
+     * A minimal {@link TiledGridCoverage} that creates empty rasters on demand.
+     */
+    private static final class MockTiledCoverage extends TiledGridCoverage {
+
+        MockTiledCoverage(TiledGridCoverageResource.Subset subset) {
+            super(subset);
+        }
+
+        @Override
+        protected GenericName getIdentifier() {
+            return Names.createLocalName(null, null, "test");
+        }
+
+        @Override
+        protected Raster[] readTiles(TileIterator iterator) {
+            final Raster[] tiles = new Raster[iterator.tileCountInQuery];
+            do {
+                final WritableRaster raster = iterator.createRaster();
+                tiles[iterator.getTileIndexInResultArray()] = raster;
+            } while (iterator.next());
+            return tiles;
+        }
+    }
+}
\ No newline at end of file


(sis) 04/07: chore(Storage): improve ImageTileMatrix test to verify multiple ways to acquire tiles

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 62bbf09a548be167a738d7c9d5395609d79cc5ff
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Mon May 18 12:30:56 2026 +0200

    chore(Storage): improve ImageTileMatrix test to verify multiple ways to acquire tiles
---
 .../sis/storage/tiling/ImageTileMatrixTest.java    | 152 +++++++++++++++++----
 1 file changed, 126 insertions(+), 26 deletions(-)

diff --git a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java
index 372713b087..899f80e4b7 100644
--- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java
+++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/tiling/ImageTileMatrixTest.java
@@ -21,8 +21,8 @@ import java.awt.image.ColorModel;
 import java.awt.image.Raster;
 import java.awt.image.SampleModel;
 import java.awt.image.WritableRaster;
+import java.util.Arrays;
 import java.util.List;
-import java.util.Optional;
 import org.apache.sis.storage.GridCoverageResource;
 import org.opengis.metadata.spatial.DimensionNameType;
 import org.opengis.util.GenericName;
@@ -44,7 +44,11 @@ import org.apache.sis.referencing.crs.HardCodedCRS;
 
 
 /**
- * Minimal test case for image tile matrices
+ * Verify behavior of {@link ImageTileMatrix} in a 3D space.
+ * </br>
+ * This test creates a {@link MockTiledResource coverage mockup} that contains two 2D slices.
+ * Each slice contains {@link #NUM_COLS} tile columns and {@link #NUM_ROWS} tile rows.
+ * Each tile is a single band image whose diagonal is filled with its tile indices.
  *
  * @author  Alexis Manin (Geomatys)
  */
@@ -61,38 +65,130 @@ public final class ImageTileMatrixTest extends TestCase {
     /**
      * Test that a tile from a 3D dataset can return its associated resource.
      * This is an anti-regression test because of a bug encountered while fetching tile resource.
-     *
-     * @throws DataStoreException if a data store error occurred.
      */
     @Test
-    public void testGetResourceFromTile3D() throws DataStoreException {
+    public void testGetIndividualTiles3D() throws DataStoreException {
+        final var matrix = get3DMockupTileMatrix();
+        final var tilingExtent = matrix.getTilingScheme().getExtent();
+        assertEquals(3, tilingExtent.getDimension());
+        tilingExtent.latticePointStream(true)
+                .map(tileCoord -> loadTile(tileCoord, matrix))
+                .forEach(ImageTileMatrixTest::checkTileContent);
+    }
+
+    /**
+     * Check another path to obtain and validate tiles: get a batch of (all in fact) tiles using {@link TileMatrix#getTiles(GridExtent, boolean)}
+     */
+    @Test
+    public void testGetTileBatch3D() throws DataStoreException {
+        final var matrix = get3DMockupTileMatrix();
+        matrix.getTiles(null, true)
+              .forEach(ImageTileMatrixTest::checkTileContent);
+    }
+
+    /**
+     * Check tile content by querying a full rendering on each slice in the 3D coverage mockup.
+     * The aim is to ensure that coverage rendering properly returns a tiled image,
+     * and that each tile in the rendered image gives back its associated Tile content.
+     * Said otherwise, it checks that there's no tile mismatch or mixup when using ImageIO accessor.
+     */
+    @Test
+    public void testGetTilesViaRender() throws DataStoreException {
+        final var resource = new MockTiledResource();
+        final var coverage = resource.read((GridGeometry) null);
+        final var overallExtent = coverage.getGridGeometry().getExtent();
+        overallExtent.resize(1, 1).latticePointStream(true)
+                .forEach(temporalSlice -> {
+                    var sliceHigh = temporalSlice.clone();
+                    sliceHigh[0] = overallExtent.getHigh(0);
+                    sliceHigh[1] = overallExtent.getHigh(1);
+                    final var renderExtent = new GridExtent(null, temporalSlice, sliceHigh, true);
+
+                    final var image = coverage.render(renderExtent);
+                    for (int col = 0; col < NUM_COLS; col++) {
+                        for (int row = 0; row < NUM_ROWS; row++) {
+                            final var tileIndices = temporalSlice.clone();
+                            tileIndices[0] = col;
+                            tileIndices[1] = row;
+                            final var tileRaster = image.getTile(col, row);
+                            checkTileOrigin(tileRaster, tileIndices);
+                            checkTileRaster(tileRaster, tileIndices);
+                        }
+                    }
+                });
+    }
+
+    private void checkTileOrigin(Raster tileRaster, long[] tileIndices) {
+        final var expectedTileOrigin = new int[] {
+                Math.toIntExact(Math.multiplyExact(tileIndices[0], TILE_WIDTH)),
+                Math.toIntExact(Math.multiplyExact(tileIndices[1], TILE_HEIGHT))
+        };
+        final var actualTileOrigin = new int[] { tileRaster.getMinX(), tileRaster.getMinY() };
+        assertArrayEquals(expectedTileOrigin, actualTileOrigin,
+                () -> String.format(
+                        "Tile (%s): raster origin does not match rendering location. Expected: (%s) but was (%s)",
+                        Arrays.toString(tileIndices), Arrays.toString(expectedTileOrigin), Arrays.toString(actualTileOrigin)
+                )
+        );
+    }
+
+    private TileMatrix get3DMockupTileMatrix() throws DataStoreException {
         final var resource = new MockTiledResource();
         final var tileMatrixSets = resource.getTileMatrixSets();
         assertFalse(tileMatrixSets.isEmpty());
-        final TileMatrixSet tms = tileMatrixSets.iterator().next();
-        assertFalse(tms.getTileMatrices().isEmpty());
-        final TileMatrix matrix = tms.getTileMatrices().values().iterator().next();
+        final var tms = tileMatrixSets.iterator().next();
+        final var tileMatrixIterator = tms.getTileMatrices().values().iterator();
+        assertTrue(tileMatrixIterator.hasNext());
+        final var matrix = tileMatrixIterator.next();
+        assertFalse(tileMatrixIterator.hasNext());
+        return matrix;
+    }
 
-        final GridExtent tilingExtent = matrix.getTilingScheme().getExtent();
-        assertEquals(3, tilingExtent.getDimension());
-        final long[] indices = new long[] {
-            tilingExtent.getLow(0),
-            tilingExtent.getLow(1),
-            tilingExtent.getLow(2)
-        };
+    /**
+     * Load a specific tile from the given tile matrix.
+     * This method expects that tile content will respect this test
+     */
+    private Tile loadTile(long[] requestedTileIndices, TileMatrix matrix) {
+        try {
+            final var optTile = matrix.getTile(requestedTileIndices);
+            assertTrue(optTile.isPresent());
+            final var tile = optTile.get();
+            final var tIndices = tile.getIndices();
+            assertArrayEquals(requestedTileIndices, tIndices, "Tile indices differ from request");
+            return tile;
+        } catch (DataStoreException e) {
+            throw new AssertionError("Extraction of tile ("+ Arrays.toString(requestedTileIndices)+") failed", e);
+        }
+    }
+
+    private static void checkTileContent(Tile tile) {
+        final var tileIndices = tile.getIndices();
+        try {
+            assertEquals(TileStatus.EXISTS, tile.getStatus());
+            final var tResource = tile.getResource();
+            assertNotNull(tResource);
+            if (!(tResource instanceof GridCoverageResource tileGridResource)) {
+                throw new AssertionError("Tile resource is not a grid resource");
+            }
+            final var tileImage = tileGridResource.read(null).render(null);
+            assertEquals(TILE_WIDTH, tileImage.getWidth());
+            assertEquals(TILE_HEIGHT, tileImage.getHeight());
+
+            assertEquals(1, tileImage.getNumXTiles() * tileImage.getNumYTiles(),
+                    "Tile image should contain only a single raster tile.");
+            final var tileRaster = tileImage.getTile(tileImage.getMinTileX(), tileImage.getMinTileY());
+            checkTileRaster(tileRaster, tileIndices);
+        } catch (DataStoreException e) {
+            fail("Validation of tile ("+ Arrays.toString(tileIndices)+") failed", e);
+        }
+    }
 
-        final Optional<Tile> optTile = matrix.getTile(indices);
-        assertTrue(optTile.isPresent());
-        final var tile = optTile.get();
-        assertEquals(TileStatus.EXISTS, tile.getStatus());
-        final var tResource = tile.getResource();
-        assertNotNull(tResource);
-        if (!(tResource instanceof GridCoverageResource tileGridResource)) {
-            throw new AssertionError("Tile resource is not a grid resource");
+    private static void checkTileRaster(Raster tileRaster, long[] tileIndices) {
+        for (int i=0 ; i < tileIndices.length ; i++) {
+            final var index = i;
+            assertEquals(tileIndices[i], tileRaster.getSample(tileRaster.getMinX() + i, tileRaster.getMinY() + i, 0),
+                    () -> String.format("Tile sample at coordinate (%1$d, %1$d) should be the tile coordinate at dimension %1$d", index));
         }
-        var tileImage = tileGridResource.read(null).render(null);
-        assertEquals(TILE_WIDTH, tileImage.getWidth());
-        assertEquals(TILE_HEIGHT, tileImage.getHeight());
     }
 
     /**
@@ -180,6 +276,10 @@ public final class ImageTileMatrixTest extends TestCase {
             final Raster[] tiles = new Raster[iterator.tileCountInQuery];
             do {
                 final WritableRaster raster = iterator.createRaster();
+                final var tileCoords = iterator.getTileCoordinatesInResource();
+                for (int i = 0; i < tileCoords.length; i++) {
+                    raster.setSample(raster.getMinX() + i, raster.getMinY() + i, 0, tileCoords[i]);
+                }
                 tiles[iterator.getTileIndexInResultArray()] = raster;
             } while (iterator.next());
             return tiles;


(sis) 06/07: fix(Image): fix ReshapedImage.singleTile to strictly return the designated tile, and only this tile.

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit c99b7c431e042b472a9384d5f38b5600da21d64e
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Mon May 18 17:09:41 2026 +0200

    fix(Image): fix ReshapedImage.singleTile to strictly return the designated tile, and only this tile.
---
 .../sis/image/internal/shared/ReshapedImage.java   | 10 ++++++++-
 .../image/internal/shared/ReshapedImageTest.java   | 24 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java
index 7db4d35660..17bebfaab5 100644
--- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java
+++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java
@@ -128,7 +128,7 @@ public final class ReshapedImage extends PlanarImage {
                 0, 0,
                 tileWidth,
                 tileHeight,
-                0, 0);
+                tileX, tileY);
         return image.isIdentity() ? image.source : image;
     }
 
@@ -298,6 +298,14 @@ public final class ReshapedImage extends PlanarImage {
      */
     @Override
     public Raster getTile(final int tileX, final int tileY) {
+        // Ensure reshaped image strictly respect its boundaries and does not access source tiles outside its domain.
+        if (!(
+                getMinTileX() <= tileX && tileX < getMinTileX() + getNumXTiles()
+                &&
+                getMinTileY() <= tileY && tileY < getMinTileY() + getNumYTiles()
+        )) {
+            throw new IllegalArgumentException("Requested tile is outside Image domain");
+        }
         return offset(source.getTile(tileX, tileY));
     }
 
diff --git a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java
index 35973b6908..10884f8d3b 100644
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java
@@ -198,4 +198,28 @@ public final class ReshapedImageTest extends TestCase {
             {1210, 1211, 1212  ,  1310, 1311, 1312  ,  1410, 1411, 1412}
         });
     }
+
+    /**
+     * Verify a reshaped image created to expose a single tile from a source tiled image only serves the requested tile.
+     */
+    @Test
+    public void testExposeSingleTileFromTiledImage() {
+        var source  = new TiledImageMock(DataBuffer.TYPE_USHORT, 1, 0, 0, 4, 4, 2, 2, 0, 0, false);
+        source.validate();
+        source.initializeAllTiles(0);
+
+        var lastTile = ReshapedImage.singleTile(source, 1, 1);
+        try {
+            lastTile.getTile(0, 0);
+            fail("Tile (0, 0) should not be available");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        final var exposedTile = lastTile.getTile(1, 1);
+        assertValuesEqual(exposedTile, 0, new int[][] {
+                { 400, 401 },
+                { 410, 411 }
+        });
+    }
 }


(sis) 05/07: fix(Storage): Properly handle user "getTiles" requests when requesting multidimensional extents

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 08b1e097d708c00c0a098e29bdc87d26204c15f1
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Mon May 18 16:37:44 2026 +0200

    fix(Storage): Properly handle user "getTiles" requests when requesting multidimensional extents
    
    Previously, the code was simply ignoring extra dimensions to only focus on coverage X and Y dimensions.
    This causes a serious problem when a user tries to navigate in other dimensions, because the ImageTileMatrix was not able to take proper action to handle it.
    
    This change is as conservative as possible regarding previous caching behavior. We still check if a user request lies in the boundary of the previous user request, to return an already cached image if possible.
    The main differences are:
    
     1. We check all dimensions of user extent: If user requests tiles in a different additional cell/extent, we reprocess a fresh image
     2. We try to split input multidimensional requests into separate 2D slices, to remain on a "per image" loading strategy.
---
 .../apache/sis/storage/tiling/ImageTileMatrix.java | 103 ++++++++++++++++-----
 1 file changed, 78 insertions(+), 25 deletions(-)

diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java
index 84087f6e29..c0bf1791e2 100644
--- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java
+++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java
@@ -33,7 +33,6 @@ import org.apache.sis.storage.MemoryGridCoverageResource;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.NoSuchDataException;
 import org.apache.sis.storage.UnsupportedQueryException;
-import org.apache.sis.storage.InternalDataStoreException;
 import org.apache.sis.storage.Resource;
 import org.apache.sis.coverage.grid.GridExtent;
 import org.apache.sis.coverage.grid.GridGeometry;
@@ -132,6 +131,12 @@ final class ImageTileMatrix implements TileMatrix {
      */
     private RenderedImage image;
 
+    /**
+     * Extent of {@link #image} in the {@link #coverage} {@link TileMatrix#getTilingScheme() tiling scheme}.
+     * Id {@link #image} is null, this should also be null. If image is not null, this must not be null.
+     */
+    private GridExtent imageTilingExtent;
+
     /**
      * The grid coverage processor to use when tiles use a subset of the bands.
      *
@@ -350,6 +355,15 @@ final class ImageTileMatrix implements TileMatrix {
         if (indiceRanges == null) {
             indiceRanges = tilingScheme.getExtent();
         }
+
+        final var coverage = coverage();
+        for (int dim = 0 ; dim < indiceRanges.getDimension(); dim++) {
+            if (dim != coverage.xDimension && dim != coverage.yDimension && dim > 1) {
+                return slice(indiceRanges, coverage.xDimension, coverage.yDimension, parallel);
+            }
+        }
+
+        assert indiceRanges.getDegreesOfFreedom() <= 2 : "This code should only be reached if requested extent is 2D";
         try {
             return StreamSupport.stream(iterator(indiceRanges).iterator(), parallel);
         } catch (ArithmeticException e) {
@@ -357,6 +371,46 @@ final class ImageTileMatrix implements TileMatrix {
         }
     }
 
+    /**
+     * Split given extent in a lazy sequence of 2D extents. For each 2D slice,
+     * we query all tiles contained in user requested area.
+     *
+     * @param indiceRanges N-D tile extent to slice and to load tiles for.
+     * @param xDim X dimension of the coverage, first axis of the 2D part to preserve in slices.
+     * @param yDim Y dimension of the coverage, second axis of the 2D part to preserve in slices.
+     * @param parallel True if we want a parallel stream returned, false otherwise.
+     * @return A lazy sequence of all tiles contained in the given tile range.
+     */
+    private Stream<Tile> slice(GridExtent indiceRanges, int xDim, int yDim, boolean parallel) {
+        final var slicingStart = indiceRanges.getLow().getCoordinateValues();
+        final var slicingEnd   = indiceRanges.getHigh().getCoordinateValues();
+        final long xMax = slicingEnd[xDim];
+        final long yMax = slicingEnd[yDim];
+        slicingEnd[xDim] = slicingStart[xDim];
+        slicingEnd[yDim] = slicingStart[yDim];
+
+        final var slicingExtent = new GridExtent(null, slicingStart, slicingEnd, true);
+        // NOTE: not sure here, but depending on stream fork policy,
+        // allowing parallel extents ould hurt performance,
+        // because it potentially allows to load tiles from different slices in parallel.
+        // As this class image caching strategy is based on 2D extents,
+        // we instead push parallelism down on tile loading level directly (see flatMap block).
+        return slicingExtent.latticePointStream(false)
+                .map(slicePoint -> {
+                    final var sliceHigh = Arrays.copyOf(slicePoint, slicePoint.length);
+                    sliceHigh[xDim] = xMax;
+                    sliceHigh[yDim] = yMax;
+                    return new GridExtent(null, slicePoint, sliceHigh, true);
+                })
+                .flatMap(slice -> {
+                    try {
+                        return StreamSupport.stream(iterator(slice).iterator(), parallel);
+                    } catch (DataStoreException e) {
+                        throw new BackingStoreException("Cannot load tiles for 2D extent", e);
+                    }
+                });
+    }
+
     /**
      * Creates an object which can be used for retrieving a single tile or a stream tiles.
      *
@@ -368,26 +422,12 @@ final class ImageTileMatrix implements TileMatrix {
     private synchronized IterationDomain<Tile> iterator(final GridExtent indiceRanges) throws DataStoreException {
         @SuppressWarnings("LocalVariableHidesMemberVariable")
         final TiledGridCoverage coverage = coverage();
-        boolean retry = false;
-        do {    // This loop will be executed only 1 or 2 times.
-            if (image != null) {
-                final long xmin, ymin, xmax, ymax;
-                xmin = Math.subtractExact(indiceRanges.getLow (coverage.xDimension), imageToTileX);
-                xmax = Math.subtractExact(indiceRanges.getHigh(coverage.xDimension), imageToTileX);
-                final long x0 = image.getMinTileX();
-                if (xmin >= x0 && xmax < x0 + image.getNumXTiles()) {
-                    ymin = Math.subtractExact(indiceRanges.getLow (coverage.yDimension), imageToTileY);
-                    ymax = Math.subtractExact(indiceRanges.getHigh(coverage.yDimension), imageToTileY);
-                    final long y0 = image.getMinTileY();
-                    if (ymin >= y0 && ymax < y0 + image.getNumYTiles()) {
-                        return new Iterator(Math.toIntExact(xmin),
-                                            Math.toIntExact(ymin),
-                                            Math.toIntExact(xmax),
-                                            Math.toIntExact(ymax),
-                                            indiceRanges.getLow().getCoordinateValues());
-                    }
-                }
-            }
+        assert Arrays.equals(indiceRanges.getSubspaceDimensions(2), new int[] {coverage.xDimension, coverage.yDimension})
+                : "Iterator can only return tiles for a 2D slice over coverage XY dimensions.";
+
+        // Returns currently cached image if it
+        final var indiceRangesLow = indiceRanges.getLow().getCoordinateValues();
+        if (image == null || !imageTilingExtent.contains(indiceRanges)) {
             /*
              * Gets the bounds of the image to read. If deferred reading is supported,
              * we can expand to the bounds of the whole coverage in order to perform a
@@ -400,7 +440,7 @@ final class ImageTileMatrix implements TileMatrix {
             for (int i=0; i<dimension; i++) {
                 final long limit = Math.incrementExact(extent.getHigh(i));
                 high[i] = Math.min(limit, tileToCell(Math.incrementExact(indiceRanges.getHigh(i)), i));
-                low [i] = Math.max(extent.getLow(i), tileToCell(indiceRanges.getLow(i), i));
+                low [i] = Math.max(extent.getLow(i), tileToCell(indiceRangesLow[i], i));
                 final long span = high[i] - low[i];
                 if (span < 0 || span > Integer.MAX_VALUE) {
                     throw new ArithmeticException(resource.errors().getString(Errors.Keys.IntegerOverflow_1, Integer.SIZE));
@@ -413,11 +453,24 @@ final class ImageTileMatrix implements TileMatrix {
                     high[i] += after;
                 }
             }
-            image = coverage.render(extent.reshape(low, high, false));
+
+
+            final var imagePixelExtent = extent.reshape(low, high, false);
+            imageTilingExtent = imagePixelExtent
+                    .translate(Arrays.stream(tileToCell).map(v -> -v).toArray())
+                    .subsample(Arrays.stream(tileSize).mapToLong(v -> v).toArray());
+            image = coverage.render(imagePixelExtent);
             imageToTileX = low[coverage.xDimension];
             imageToTileY = low[coverage.yDimension];
-        } while ((retry = !retry) == true);
-        throw new InternalDataStoreException();     // Should never happen.
+        }
+
+        return new Iterator(
+                Math.toIntExact(Math.subtractExact(indiceRangesLow[coverage.xDimension], imageToTileX)),
+                Math.toIntExact(Math.subtractExact(indiceRangesLow[coverage.yDimension], imageToTileY)),
+                Math.toIntExact(Math.subtractExact(indiceRanges.getHigh(coverage.xDimension), imageToTileX)),
+                Math.toIntExact(Math.subtractExact(indiceRanges.getHigh(coverage.yDimension), imageToTileY)),
+                indiceRangesLow
+        );
     }
 
     /**


(sis) 03/07: fix(Storage): Fix ImageTileMatrix tile indices to work with slices in N dimensions.

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit a0449bf1b4032052a7a0457995d9542ec3724c3c
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Mon May 18 08:45:12 2026 +0200

    fix(Storage): Fix ImageTileMatrix tile indices to work with slices in N dimensions.
    
    Previously, tiles from the ImageTileMatrix were assuming that its tiles were set in a 2D space.
    However, an ImageTileMatrix can be a 2D slice in higher dimension space (for example, CRS:84 + single elevation coordinate). In such cases, the code that was relying on tile coordinates broke.
---
 .../apache/sis/storage/tiling/ImageTileMatrix.java | 41 ++++++++++++++++++----
 1 file changed, 34 insertions(+), 7 deletions(-)

diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java
index 38d09e96e8..84087f6e29 100644
--- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java
+++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/tiling/ImageTileMatrix.java
@@ -383,7 +383,8 @@ final class ImageTileMatrix implements TileMatrix {
                         return new Iterator(Math.toIntExact(xmin),
                                             Math.toIntExact(ymin),
                                             Math.toIntExact(xmax),
-                                            Math.toIntExact(ymax));
+                                            Math.toIntExact(ymax),
+                                            indiceRanges.getLow().getCoordinateValues());
                     }
                 }
             }
@@ -448,19 +449,42 @@ final class ImageTileMatrix implements TileMatrix {
          */
         private final long offsetX, offsetY;
 
+        /**
+         * Dimension indices for the X and Y axes in the tile matrix coordinate system.
+         */
+        private final int xDim, yDim;
+
+        /**
+         * Base template of tile indices.
+         * Used when returning {@link Tile#getIndices() tile indices}.
+         * Tiles will use these coordinates, replacing {link #xDim X} and {link #yDim Y} dimensions.
+         */
+        private final long[] baseIndices;
+
         /**
          * Creates a new request for tile iterators.
          *
-         * @param xmin  first column index of tiles, inclusive.
-         * @param xmin  first row index of tiles, inclusive.
-         * @param xmax  last column index of tiles, inclusive.
-         * @param ymax  last row index of tiles, inclusive.
+         * @param xmin        first column index of tiles, inclusive.
+         * @param ymin        first row index of tiles, inclusive.
+         * @param xmax        last column index of tiles, inclusive.
+         * @param ymax        last row index of tiles, inclusive.
+         * @param baseIndices tile coordinate template.
+         *                    It can be any valid coordinate of the tiles managed by this iterator.
+         *                    It serves as base to build correct tile coordinate for each returned tile.
+         *                    Each tile will clone this array and replace its X and Y indices with its own.
+         *                    Therefore, it is important that it represent properly the "slice" of extra-dimensions
+         *                    this iterator operates on.
          */
-        Iterator(final int xmin, final int ymin, final int xmax, final int ymax) {
+        Iterator(final int xmin, final int ymin, final int xmax, final int ymax,
+                 final long[] baseIndices)
+        {
             super(xmin, ymin, xmax, ymax);
             tiles   = image;
             offsetX = imageToTileX;
             offsetY = imageToTileY;
+            xDim    = coverage.xDimension;
+            yDim    = coverage.yDimension;
+            this.baseIndices = baseIndices;
         }
 
         /**
@@ -481,7 +505,10 @@ final class ImageTileMatrix implements TileMatrix {
 
                 /** Returns the indices of this tile in the {@code TileMatrix}. */
                 @Override public long[] getIndices() {
-                    return new long[] {offsetX + tileX, offsetY + tileY};
+                    final long[] indices = baseIndices.clone();
+                    indices[xDim] = offsetX + tileX;
+                    indices[yDim] = offsetY + tileY;
+                    return indices;
                 }
 
                 /** Returns information about whether the tile failed to load. */


(sis) 07/07: fix(Image): Prevent reshaped image to return data outside its domain

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 3f10b8f44ae15733cf7c08e908d11aefc53315d3
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Mon May 18 17:54:22 2026 +0200

    fix(Image): Prevent reshaped image to return data outside its domain
    
    Avoid user to be able to access areas in source images that are not accesible from current reshaped image
---
 .../main/org/apache/sis/image/internal/shared/ReshapedImage.java   | 4 ++++
 .../org/apache/sis/image/internal/shared/ReshapedImageTest.java    | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java
index 17bebfaab5..778800f1f7 100644
--- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java
+++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/ReshapedImage.java
@@ -95,8 +95,12 @@ public final class ReshapedImage extends PlanarImage {
             final var r = (ReshapedImage) source;
             offsetX = addExact(offsetX, r.offsetX);
             offsetY = addExact(offsetY, r.offsetY);
+            if (offsetX < r.offsetX || offsetY < r.offsetY || offsetX + width > r.offsetX + r.width || offsetY + height > r.offsetY + r.height) {
+                throw new IllegalArgumentException("It is forbidden to try to expand access over source image");
+            }
             source  = r.source;
         }
+
         this.source   = source;
         this.offsetX  = toIntExact(offsetX);
         this.offsetY  = toIntExact(offsetY);
diff --git a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java
index 10884f8d3b..1407f6bf85 100644
--- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java
+++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/image/internal/shared/ReshapedImageTest.java
@@ -221,5 +221,12 @@ public final class ReshapedImageTest extends TestCase {
                 { 400, 401 },
                 { 410, 411 }
         });
+
+        try {
+            ReshapedImage.singleTile(lastTile, 1, 0);
+            fail("Tile data should not be accessible from previously restricted reshaped image");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
     }
 }


(sis) 01/07: chore(Build): ugrade Gradle wrapper to 8.14.4 to allow building with JDK 24

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexismanin pushed a commit to branch fix/image-tile-matrix-get-tile
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 5297d25a3c08183a513b95dcac22da3d07740fad
Author: Alexis Manin <al...@geomatys.com>
AuthorDate: Wed May 6 16:57:22 2026 +0200

    chore(Build): ugrade Gradle wrapper to 8.14.4 to allow building with JDK 24
---
 gradle/wrapper/gradle-wrapper.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a4413138c9..aaaabb3cb9 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
 networkTimeout=10000
 validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME