You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2026/01/30 22:29:14 UTC
(sis) 01/02: Remove the modules to be excluded from 1.6 release.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to tag 1.6
in repository https://gitbox.apache.org/repos/asf/sis.git
commit 95fced0f36b834e287bbcfad8e4d8cd02c0ff442
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Tue Jan 27 16:08:54 2026 +0100
Remove the modules to be excluded from 1.6 release.
---
.asf.yaml | 22 -
README.md | 1 -
.../org.apache.sis.feature/main/module-info.java | 12 +-
.../org.apache.sis.metadata/main/module-info.java | 5 +-
.../main/module-info.java | 1 -
.../org.apache.sis.storage/main/module-info.java | 9 -
.../src/org.apache.sis.util/main/module-info.java | 5 -
gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 0 bytes
gradle/wrapper/gradle-wrapper.properties | 7 -
gradlew | 249 ---
gradlew.bat | 92 --
incubator/README.md | 10 -
incubator/build.gradle.kts | 232 ---
.../org.apache.sis.storage.DataStoreProvider | 4 -
.../main/module-info.java | 54 -
.../storage/coveragejson/CoverageJsonStore.java | 192 ---
.../coveragejson/CoverageJsonStoreProvider.java | 105 --
.../sis/storage/coveragejson/CoverageResource.java | 724 ---------
.../sis/storage/coveragejson/binding/Axe.java | 153 --
.../sis/storage/coveragejson/binding/Axes.java | 63 -
.../sis/storage/coveragejson/binding/Category.java | 76 -
.../coveragejson/binding/CategoryEncoding.java | 82 -
.../sis/storage/coveragejson/binding/Coverage.java | 147 --
.../coveragejson/binding/CoverageCollection.java | 103 --
.../coveragejson/binding/CoverageJsonObject.java | 58 -
.../storage/coveragejson/binding/Dictionary.java | 73 -
.../sis/storage/coveragejson/binding/Domain.java | 99 --
.../coveragejson/binding/GeographicCRS.java | 79 -
.../sis/storage/coveragejson/binding/I18N.java | 125 --
.../storage/coveragejson/binding/IdentifierRS.java | 95 --
.../storage/coveragejson/binding/Identifiers.java | 31 -
.../sis/storage/coveragejson/binding/NdArray.java | 116 --
.../coveragejson/binding/ObservedProperty.java | 94 --
.../storage/coveragejson/binding/Parameter.java | 105 --
.../coveragejson/binding/ParameterGroup.java | 98 --
.../storage/coveragejson/binding/Parameters.java | 78 -
.../storage/coveragejson/binding/ProjectedCRS.java | 71 -
.../sis/storage/coveragejson/binding/Ranges.java | 74 -
.../binding/ReferenceSystemConnection.java | 74 -
.../sis/storage/coveragejson/binding/Symbol.java | 65 -
.../coveragejson/binding/TargetConcept.java | 59 -
.../storage/coveragejson/binding/TemporalRS.java | 86 -
.../sis/storage/coveragejson/binding/TileSet.java | 81 -
.../storage/coveragejson/binding/TiledNdArray.java | 90 --
.../sis/storage/coveragejson/binding/Unit.java | 85 -
.../storage/coveragejson/binding/VerticalCRS.java | 68 -
.../storage/coveragejson/binding/package-info.java | 23 -
.../sis/storage/coveragejson/package-info.java | 23 -
.../coveragejson/CoverageJsonStoreTest.java | 144 --
.../storage/coveragejson/binding/BindingTest.java | 232 ---
.../sis/storage/coveragejson/binding/LICENSE.md | 5 -
.../storage/coveragejson/binding/axe_bounds.json | 12 -
.../storage/coveragejson/binding/axe_polygon.json | 33 -
.../storage/coveragejson/binding/axe_regular.json | 5 -
.../storage/coveragejson/binding/axe_tuples.json | 20 -
.../binding/coverage_vertical_profile.json | 91 --
.../binding/coverage_vertical_profile_nocs.json | 80 -
.../coveragejson/binding/coveragecollection.json | 92 --
.../storage/coveragejson/binding/domain_grid.json | 26 -
.../coveragejson/binding/domain_trajectory.json | 27 -
.../coveragejson/binding/domaintype_grid.json | 5 -
.../binding/domaintype_multipoint.json | 30 -
.../binding/domaintype_multipointseries.json | 31 -
.../binding/domaintype_multipolygon.json | 32 -
.../binding/domaintype_multipolygonseries.json | 32 -
.../coveragejson/binding/domaintype_point.json | 24 -
.../binding/domaintype_pointseries.json | 26 -
.../coveragejson/binding/domaintype_polygon.json | 29 -
.../binding/domaintype_polygonseries.json | 31 -
.../coveragejson/binding/domaintype_section.json | 31 -
.../binding/domaintype_trajectory.json | 30 -
.../binding/domaintype_vertical_profile.json | 26 -
.../binding/geographiccrs_longlat.json | 4 -
.../binding/geographiccrs_longlatheight.json | 4 -
.../sis/storage/coveragejson/binding/ndarray.json | 10 -
.../binding/parameter_categoricaldata.json | 33 -
.../binding/parameter_continuousdata.json | 24 -
.../binding/parametergroup_uncertainty.json | 13 -
.../binding/parametergroup_vectorquantity.json | 9 -
.../binding/projectedcrs_britishnationalgrid.json | 4 -
.../binding/reference_system_connection.json | 7 -
.../storage/coveragejson/binding/temporalrs.json | 4 -
.../storage/coveragejson/binding/tiledndarray.json | 16 -
.../coveragejson/binding/verticalcrs_navd88.json | 4 -
.../sis/storage/coveragejson/coverage_xyzt.json | 58 -
.../org.apache.sis.storage.DataStoreProvider | 4 -
.../main/module-info.java | 47 -
.../sis/storage/geoheif/CoverageBuilder.java | 699 --------
.../apache/sis/storage/geoheif/FromImageIO.java | 165 --
.../apache/sis/storage/geoheif/GeoHeifStore.java | 366 -----
.../sis/storage/geoheif/GeoHeifStoreProvider.java | 134 --
.../main/org/apache/sis/storage/geoheif/Group.java | 73 -
.../main/org/apache/sis/storage/geoheif/Image.java | 143 --
.../apache/sis/storage/geoheif/ImageResource.java | 473 ------
.../org/apache/sis/storage/geoheif/Pyramid.java | 52 -
.../sis/storage/geoheif/ResourceBuilder.java | 467 ------
.../sis/storage/geoheif/UncompressedImage.java | 123 --
.../apache/sis/storage/geoheif/package-info.java | 28 -
.../main/org/apache/sis/storage/isobmff/Box.java | 114 --
.../apache/sis/storage/isobmff/BoxRegistry.java | 92 --
.../org/apache/sis/storage/isobmff/ByteRanges.java | 163 --
.../apache/sis/storage/isobmff/ContainerBox.java | 76 -
.../org/apache/sis/storage/isobmff/Extension.java | 89 --
.../org/apache/sis/storage/isobmff/FullBox.java | 111 --
.../sis/storage/isobmff/MainBoxRegistry.java | 207 ---
.../org/apache/sis/storage/isobmff/Reader.java | 393 -----
.../main/org/apache/sis/storage/isobmff/Root.java | 53 -
.../org/apache/sis/storage/isobmff/TreeNode.java | 377 -----
.../isobmff/UnsupportedVersionException.java | 44 -
.../apache/sis/storage/isobmff/VectorReader.java | 134 --
.../storage/isobmff/base/ColourInformation.java | 124 --
.../sis/storage/isobmff/base/CombinaisonType.java | 63 -
.../apache/sis/storage/isobmff/base/Copyright.java | 92 --
.../sis/storage/isobmff/base/EntityToGroup.java | 62 -
.../sis/storage/isobmff/base/ExtendedType.java | 76 -
.../storage/isobmff/base/FDItemInfoExtension.java | 110 --
.../apache/sis/storage/isobmff/base/FileType.java | 80 -
.../apache/sis/storage/isobmff/base/FreeSpace.java | 57 -
.../apache/sis/storage/isobmff/base/GroupList.java | 63 -
.../sis/storage/isobmff/base/HandlerReference.java | 79 -
.../apache/sis/storage/isobmff/base/HeaderBox.java | 102 --
.../storage/isobmff/base/IdentifiedMediaData.java | 76 -
.../apache/sis/storage/isobmff/base/ItemData.java | 100 --
.../apache/sis/storage/isobmff/base/ItemInfo.java | 113 --
.../sis/storage/isobmff/base/ItemInfoEntry.java | 193 ---
.../sis/storage/isobmff/base/ItemLocation.java | 298 ----
.../sis/storage/isobmff/base/ItemProperties.java | 207 ---
.../isobmff/base/ItemPropertyAssociation.java | 180 ---
.../isobmff/base/ItemPropertyContainer.java | 64 -
.../sis/storage/isobmff/base/ItemReference.java | 79 -
.../apache/sis/storage/isobmff/base/MediaData.java | 58 -
.../org/apache/sis/storage/isobmff/base/Meta.java | 102 --
.../org/apache/sis/storage/isobmff/base/Movie.java | 59 -
.../sis/storage/isobmff/base/MovieHeader.java | 81 -
.../sis/storage/isobmff/base/OriginalFileType.java | 61 -
.../sis/storage/isobmff/base/PrimaryItem.java | 72 -
.../isobmff/base/ProgressiveDownloadInfo.java | 62 -
.../isobmff/base/SingleItemTypeReference.java | 69 -
.../org/apache/sis/storage/isobmff/base/Track.java | 61 -
.../sis/storage/isobmff/base/TrackHeader.java | 124 --
.../apache/sis/storage/isobmff/base/UserData.java | 59 -
.../sis/storage/isobmff/base/package-info.java | 29 -
.../apache/sis/storage/isobmff/gimi/ModelCRS.java | 140 --
.../sis/storage/isobmff/gimi/ModelTiePoint.java | 121 --
.../storage/isobmff/gimi/ModelTransformation.java | 113 --
.../isobmff/gimi/TiledImageConfiguration.java | 56 -
.../sis/storage/isobmff/gimi/UnknownProperty.java | 63 -
.../sis/storage/isobmff/gimi/package-info.java | 25 -
.../sis/storage/isobmff/image/CreationTime.java | 69 -
.../isobmff/image/DerivedImageReference.java | 54 -
.../sis/storage/isobmff/image/ImagePyramid.java | 118 --
.../storage/isobmff/image/ImageSpatialExtents.java | 79 -
.../storage/isobmff/image/ModificationTime.java | 69 -
.../storage/isobmff/image/PixelInformation.java | 70 -
.../sis/storage/isobmff/image/UserDescription.java | 102 --
.../sis/storage/isobmff/image/package-info.java | 28 -
.../sis/storage/isobmff/mpeg/ChromaLocation.java | 59 -
.../apache/sis/storage/isobmff/mpeg/Component.java | 138 --
.../storage/isobmff/mpeg/ComponentDefinition.java | 96 --
.../sis/storage/isobmff/mpeg/ComponentPalette.java | 160 --
.../isobmff/mpeg/ComponentPatternDefinition.java | 91 --
.../isobmff/mpeg/ComponentReferenceLevel.java | 59 -
.../sis/storage/isobmff/mpeg/ComponentType.java | 188 ---
.../isobmff/mpeg/DepthMappingInformation.java | 59 -
.../storage/isobmff/mpeg/DisparityInformation.java | 59 -
.../sis/storage/isobmff/mpeg/FieldInterlace.java | 59 -
.../storage/isobmff/mpeg/FieldInterlaceType.java | 56 -
.../isobmff/mpeg/FramePackingInformation.java | 59 -
.../sis/storage/isobmff/mpeg/InterleavingMode.java | 101 --
.../mpeg/PolarizationPatternDefinition.java | 59 -
.../storage/isobmff/mpeg/SensorBadPixelsMap.java | 59 -
.../mpeg/SensorNonUniformityCorrection.java | 59 -
.../sis/storage/isobmff/mpeg/TAIClockInfo.java | 85 -
.../sis/storage/isobmff/mpeg/TAITimeStamp.java | 75 -
.../isobmff/mpeg/UncompressedFrameConfig.java | 269 ----
.../sis/storage/isobmff/mpeg/package-info.java | 28 -
.../apache/sis/storage/isobmff/package-info.java | 48 -
.../storage/isobmff/video/ContentDescribes.java | 56 -
.../sis/storage/isobmff/video/package-info.java | 28 -
.../org/apache/sis/storage/isobmff/BoxTest.java | 57 -
.../sis/storage/isobmff/gimi/ExtensionTest.java | 50 -
.../storage/isobmff/mpeg/ComponentTypeTest.java | 60 -
.../org.apache.sis.storage.DataStoreProvider | 4 -
.../main/module-info.java | 57 -
.../org/apache/sis/storage/geopackage/Content.java | 466 ------
.../sis/storage/geopackage/ContentHandler.java | 91 --
.../sis/storage/geopackage/ContentWriter.java | 232 ---
.../org/apache/sis/storage/geopackage/Core.sql | 126 --
.../sis/storage/geopackage/Extension Metadata.sql | 38 -
.../sis/storage/geopackage/Extension Schema.sql | 40 -
.../Extension Tiled Gridded Coverage Data.sql | 47 -
.../apache/sis/storage/geopackage/GpkgStore.java | 458 ------
.../sis/storage/geopackage/GpkgStoreProvider.java | 284 ----
.../apache/sis/storage/geopackage/Initializer.java | 178 ---
.../sis/storage/geopackage/package-info.java | 33 -
.../apache/sis/storage/geopackage/FeatureSet.sql | 164 --
.../storage/geopackage/GpkgStoreProviderTest.java | 55 -
.../sis/storage/geopackage/GpkgStoreTest.java | 346 ----
.../conformance/CoreConformanceTest.java | 220 ---
.../main/module-info.java | 30 -
.../main/org/apache/sis/storage/gsf/Attitude.java | 82 -
.../main/org/apache/sis/storage/gsf/Comment.java | 59 -
.../main/org/apache/sis/storage/gsf/DataID.java | 64 -
.../main/org/apache/sis/storage/gsf/GSF.java | 976 ------------
.../org/apache/sis/storage/gsf/GSFException.java | 35 -
.../apache/sis/storage/gsf/GSFRecordReader.java | 123 --
.../main/org/apache/sis/storage/gsf/GSFStore.java | 103 --
.../apache/sis/storage/gsf/GSFStoreProvider.java | 212 ---
.../apache/sis/storage/gsf/HVNavigationError.java | 84 -
.../main/org/apache/sis/storage/gsf/Header.java | 45 -
.../main/org/apache/sis/storage/gsf/History.java | 100 --
.../apache/sis/storage/gsf/NavigationError.java | 90 --
.../main/org/apache/sis/storage/gsf/Position.java | 74 -
.../apache/sis/storage/gsf/PositionOffsets.java | 84 -
.../sis/storage/gsf/ProcessingParameters.java | 61 -
.../main/org/apache/sis/storage/gsf/Records.java | 143 --
.../apache/sis/storage/gsf/SBSensorSpecific.java | 105 --
.../main/org/apache/sis/storage/gsf/SVP.java | 85 -
.../org/apache/sis/storage/gsf/ScaleFactors.java | 66 -
.../main/org/apache/sis/storage/gsf/ScaleInfo.java | 79 -
.../apache/sis/storage/gsf/SensorParameters.java | 100 --
.../org/apache/sis/storage/gsf/SensorSpecific.java | 104 --
.../org/apache/sis/storage/gsf/SingleBeamPing.java | 210 ---
.../org/apache/sis/storage/gsf/StructClass.java | 226 ---
.../org/apache/sis/storage/gsf/SwathBathyPing.java | 350 -----
.../apache/sis/storage/gsf/SwathBathySummary.java | 88 --
.../main/org/apache/sis/storage/gsf/TimeSpec.java | 54 -
.../org/apache/sis/storage/gsf/package-info.java | 23 -
.../sis/storage/gsf/panama/LibraryLoader.java | 123 --
.../sis/storage/gsf/panama/LibraryStatus.java | 42 -
.../sis/storage/gsf/panama/NativeFunctions.java | 84 -
.../sis/storage/gsf/panama/package-info.java | 25 -
.../org/apache/sis/storage/gsf/specific/BDB.java | 126 --
.../apache/sis/storage/gsf/specific/CmpSass.java | 65 -
.../apache/sis/storage/gsf/specific/DeltaT.java | 398 -----
.../org/apache/sis/storage/gsf/specific/EM100.java | 138 --
.../org/apache/sis/storage/gsf/specific/EM12.java | 217 ---
.../apache/sis/storage/gsf/specific/EM121A.java | 267 ----
.../org/apache/sis/storage/gsf/specific/EM3.java | 321 ----
.../sis/storage/gsf/specific/EM3Imagery.java | 290 ----
.../apache/sis/storage/gsf/specific/EM3Raw.java | 515 ------
.../sis/storage/gsf/specific/EM3RawTxSector.java | 290 ----
.../sis/storage/gsf/specific/EM3RunTime.java | 746 ---------
.../org/apache/sis/storage/gsf/specific/EM4.java | 492 ------
.../sis/storage/gsf/specific/EM4Imagery.java | 391 -----
.../sis/storage/gsf/specific/EM4TxSector.java | 315 ----
.../org/apache/sis/storage/gsf/specific/EM950.java | 193 ---
.../sis/storage/gsf/specific/EMPUStatus.java | 217 ---
.../apache/sis/storage/gsf/specific/EMRunTime.java | 873 ----------
.../apache/sis/storage/gsf/specific/Echotrac.java | 117 --
.../apache/sis/storage/gsf/specific/ElacMkII.java | 217 ---
.../sis/storage/gsf/specific/GeoSwathPlus.java | 694 --------
.../org/apache/sis/storage/gsf/specific/KMALL.java | 981 ------------
.../sis/storage/gsf/specific/KMALLExtraDet.java | 140 --
.../sis/storage/gsf/specific/KMALLImagery.java | 89 --
.../sis/storage/gsf/specific/KMALLTxSector.java | 392 -----
.../sis/storage/gsf/specific/Klein5410Bss.java | 493 ------
.../storage/gsf/specific/Klein5410BssImagery.java | 187 ---
.../org/apache/sis/storage/gsf/specific/MGD77.java | 193 ---
.../apache/sis/storage/gsf/specific/NOSHDB.java | 92 --
.../apache/sis/storage/gsf/specific/R2Sonic.java | 906 -----------
.../sis/storage/gsf/specific/R2SonicImagery.java | 784 ---------
.../apache/sis/storage/gsf/specific/Reson7100.java | 1287 ---------------
.../sis/storage/gsf/specific/Reson7100Imagery.java | 115 --
.../apache/sis/storage/gsf/specific/Reson8100.java | 743 ---------
.../sis/storage/gsf/specific/Reson8100Imagery.java | 89 --
.../sis/storage/gsf/specific/ResonTSeries.java | 1661 --------------------
.../storage/gsf/specific/ResonTSeriesImagery.java | 115 --
.../org/apache/sis/storage/gsf/specific/SBAmp.java | 193 ---
.../org/apache/sis/storage/gsf/specific/SBBDB.java | 266 ----
.../sis/storage/gsf/specific/SBEchotrac.java | 191 ---
.../apache/sis/storage/gsf/specific/SBMGD77.java | 242 ---
.../apache/sis/storage/gsf/specific/SBNOSHDB.java | 140 --
.../sis/storage/gsf/specific/SBNavisound.java | 115 --
.../apache/sis/storage/gsf/specific/SeaBat.java | 193 ---
.../sis/storage/gsf/specific/SeaBat8101.java | 492 ------
.../apache/sis/storage/gsf/specific/SeaBatII.java | 292 ----
.../sis/storage/gsf/specific/SeaBeam2112.java | 315 ----
.../apache/sis/storage/gsf/specific/Seabeam.java | 67 -
.../apache/sis/storage/gsf/specific/Seamap.java | 313 ----
.../apache/sis/storage/gsf/specific/TypeIII.java | 192 ---
.../test/org/apache/sis/storage/gsf/StoreTest.java | 21 -
.../org.apache.sis.storage.DataStoreProvider | 4 -
.../main/module-info.java | 35 -
.../sis/storage/shapefile/ShapefileProvider.java | 106 --
.../sis/storage/shapefile/ShapefileStore.java | 1286 ---------------
.../apache/sis/storage/shapefile/cpg/CpgFiles.java | 75 -
.../sis/storage/shapefile/cpg/package-info.java | 21 -
.../apache/sis/storage/shapefile/dbf/DBFField.java | 495 ------
.../sis/storage/shapefile/dbf/DBFHeader.java | 157 --
.../sis/storage/shapefile/dbf/DBFReader.java | 138 --
.../sis/storage/shapefile/dbf/DBFWriter.java | 93 --
.../sis/storage/shapefile/dbf/package-info.java | 34 -
.../apache/sis/storage/shapefile/package-info.java | 40 -
.../shapefile/shp/ShapeGeometryEncoder.java | 999 ------------
.../sis/storage/shapefile/shp/ShapeHeader.java | 127 --
.../sis/storage/shapefile/shp/ShapeReader.java | 108 --
.../sis/storage/shapefile/shp/ShapeRecord.java | 104 --
.../sis/storage/shapefile/shp/ShapeType.java | 127 --
.../sis/storage/shapefile/shp/ShapeWriter.java | 142 --
.../sis/storage/shapefile/shp/package-info.java | 29 -
.../sis/storage/shapefile/shx/IndexReader.java | 90 --
.../sis/storage/shapefile/shx/IndexWriter.java | 98 --
.../sis/storage/shapefile/shx/package-info.java | 21 -
.../sis/storage/shapefile/ShapefileStoreTest.java | 359 -----
.../org/apache/sis/storage/shapefile/Snippets.java | 108 --
.../sis/storage/shapefile/dbf/DBFIOTest.java | 181 ---
.../apache/sis/storage/shapefile/dbf/Snippets.java | 96 --
.../apache/sis/storage/shapefile/multipoint.cpg | 1 -
.../apache/sis/storage/shapefile/multipoint.dbf | Bin 88 -> 0 bytes
.../apache/sis/storage/shapefile/multipoint.prj | 1 -
.../apache/sis/storage/shapefile/multipoint.shp | Bin 260 -> 0 bytes
.../apache/sis/storage/shapefile/multipoint.shx | Bin 116 -> 0 bytes
.../org/apache/sis/storage/shapefile/point.cpg | 1 -
.../org/apache/sis/storage/shapefile/point.dbf | Bin 434 -> 0 bytes
.../org/apache/sis/storage/shapefile/point.prj | 1 -
.../org/apache/sis/storage/shapefile/point.shp | Bin 156 -> 0 bytes
.../org/apache/sis/storage/shapefile/point.shx | Bin 116 -> 0 bytes
.../org/apache/sis/storage/shapefile/polygon.cpg | 1 -
.../org/apache/sis/storage/shapefile/polygon.dbf | Bin 88 -> 0 bytes
.../org/apache/sis/storage/shapefile/polygon.prj | 1 -
.../org/apache/sis/storage/shapefile/polygon.shp | Bin 456 -> 0 bytes
.../org/apache/sis/storage/shapefile/polygon.shx | Bin 116 -> 0 bytes
.../org/apache/sis/storage/shapefile/polyline.cpg | 1 -
.../org/apache/sis/storage/shapefile/polyline.dbf | Bin 88 -> 0 bytes
.../org/apache/sis/storage/shapefile/polyline.prj | 1 -
.../org/apache/sis/storage/shapefile/polyline.shp | Bin 328 -> 0 bytes
.../org/apache/sis/storage/shapefile/polyline.shx | Bin 116 -> 0 bytes
.../sis/storage/shapefile/shp/ShapeIOTest.java | 351 -----
.../apache/sis/storage/shapefile/shp/Snippets.java | 82 -
.../test/module-info.java | 28 -
.../org.apache.sis.webapp/main/module-info.java | 27 -
.../org/apache/sis/services/OSGiActivator.java | 83 -
.../main/org/apache/sis/services/Servlet.java | 26 -
.../org/apache/sis/services/ServletListener.java | 63 -
.../main/org/apache/sis/services/package-info.java | 21 -
.../webapp/META-INF/context.xml | 26 -
.../org.apache.sis.webapp/webapp/WEB-INF/web.xml | 24 -
netbeans-project/nbproject/build-impl.xml | 67 +-
netbeans-project/nbproject/genfiles.properties | 6 +-
netbeans-project/nbproject/project.properties | 4 -
netbeans-project/nbproject/project.xml | 2 -
.../sis/referencing/factory/sql/epsg/README.md | 109 --
settings.gradle.kts | 1 -
344 files changed, 13 insertions(+), 47525 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
deleted file mode 100644
index aaf336fea6..0000000000
--- a/.asf.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Configuration file for Apache SIS project.
-#
-# Documentation: https://s.apache.org/asfyaml
-# Active setting: https://gitbox.apache.org/schemes.cgi?sis-site
-#
-github:
- description: Java language library for developing geospatial applications following OGC/ISO standards.
- homepage: https://sis.apache.org/
- labels:
- - java
- - geospatial
- - standards
-notifications:
- commits: commits@sis.apache.org
- issues: dev@sis.apache.org
- issues_status: issues@sis.apache.org
- issues_comment: issues@sis.apache.org
- pullrequests: dev@sis.apache.org
- pullrequests_status: issues@sis.apache.org
- pullrequests_comment: issues@sis.apache.org
- jira_options: worklog
diff --git a/README.md b/README.md
index 999dedd0ff..de3e39b91a 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,6 @@ together with their dependencies:
* `endorsed/build/libs/` (core library)
* `optional/build/libs/` (requires JavaFX)
-* `incubator/build/libs/` (not yet released)
If JAR files seem missing, try `gradle jar`.
For publishing to the local `~/.m2` repository
diff --git a/endorsed/src/org.apache.sis.feature/main/module-info.java b/endorsed/src/org.apache.sis.feature/main/module-info.java
index 766840544d..2f9efc348c 100644
--- a/endorsed/src/org.apache.sis.feature/main/module-info.java
+++ b/endorsed/src/org.apache.sis.feature/main/module-info.java
@@ -47,18 +47,15 @@ module org.apache.sis.feature {
exports org.apache.sis.pending.geoapi.filter to
org.apache.sis.storage,
org.apache.sis.storage.sql,
- org.apache.sis.storage.shapefile, // In the "incubator" sub-project.
org.apache.sis.portrayal;
exports org.apache.sis.filter.base to
org.apache.sis.storage,
- org.apache.sis.storage.sql,
- org.apache.sis.storage.shapefile; // In the "incubator" sub-project.
+ org.apache.sis.storage.sql;
exports org.apache.sis.filter.visitor to
org.apache.sis.storage,
- org.apache.sis.storage.sql,
- org.apache.sis.storage.shapefile; // In the "incubator" sub-project.
+ org.apache.sis.storage.sql;
exports org.apache.sis.filter.math to
org.apache.sis.storage.sql;
@@ -68,7 +65,6 @@ module org.apache.sis.feature {
org.apache.sis.storage.xml,
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
- org.apache.sis.storage.shapefile, // In the "incubator" sub-project.
org.apache.sis.storage.gdal, // In the "optional" sub-project.
org.apache.sis.portrayal,
org.apache.sis.gui; // In the "optional" sub-project.
@@ -78,8 +74,7 @@ module org.apache.sis.feature {
org.apache.sis.storage.xml,
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
- org.apache.sis.storage.gdal, // In the "optional" sub-project.
- org.apache.sis.storage.shapefile; // In the "incubator" sub-project.
+ org.apache.sis.storage.gdal; // In the "optional" sub-project.
exports org.apache.sis.geometry.wrapper.j2d to
org.apache.sis.gui; // In the "optional" sub-project.
@@ -94,7 +89,6 @@ module org.apache.sis.feature {
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
org.apache.sis.storage.geotiff,
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
org.apache.sis.storage.gdal, // In the "optional" sub-project.
org.apache.sis.portrayal,
org.apache.sis.gui; // In the "optional" sub-project.
diff --git a/endorsed/src/org.apache.sis.metadata/main/module-info.java b/endorsed/src/org.apache.sis.metadata/main/module-info.java
index df02077480..e0455cc2af 100644
--- a/endorsed/src/org.apache.sis.metadata/main/module-info.java
+++ b/endorsed/src/org.apache.sis.metadata/main/module-info.java
@@ -89,9 +89,7 @@ module org.apache.sis.metadata {
org.apache.sis.storage,
org.apache.sis.storage.xml,
org.apache.sis.storage.netcdf,
- org.apache.sis.storage.geotiff,
- org.apache.sis.storage.shapefile, // In the "incubator" sub-project.
- org.apache.sis.cql; // In the "incubator" sub-project.
+ org.apache.sis.storage.geotiff;
exports org.apache.sis.metadata.internal.shared to
org.apache.sis.referencing,
@@ -167,7 +165,6 @@ module org.apache.sis.metadata {
exports org.apache.sis.metadata.sql.internal.shared to
org.apache.sis.referencing,
org.apache.sis.storage.sql,
- org.apache.sis.storage.geopackage, // In the "incubator" sub-project.
org.apache.sis.referencing.database; // In the "non-free" subproject.
exports org.apache.sis.metadata.simple to
diff --git a/endorsed/src/org.apache.sis.referencing/main/module-info.java b/endorsed/src/org.apache.sis.referencing/main/module-info.java
index 0de5a981a1..29b33cc2f0 100644
--- a/endorsed/src/org.apache.sis.referencing/main/module-info.java
+++ b/endorsed/src/org.apache.sis.referencing/main/module-info.java
@@ -179,7 +179,6 @@ module org.apache.sis.referencing {
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
org.apache.sis.storage.geotiff,
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
org.apache.sis.storage.earthobservation,
org.apache.sis.storage.gdal, // In the "optional" sub-project.
org.apache.sis.portrayal,
diff --git a/endorsed/src/org.apache.sis.storage/main/module-info.java b/endorsed/src/org.apache.sis.storage/main/module-info.java
index 8b7fe8b1c5..7ad07acb62 100644
--- a/endorsed/src/org.apache.sis.storage/main/module-info.java
+++ b/endorsed/src/org.apache.sis.storage/main/module-info.java
@@ -54,11 +54,6 @@ module org.apache.sis.storage {
org.apache.sis.storage.netcdf,
org.apache.sis.storage.geotiff,
org.apache.sis.storage.earthobservation,
- org.apache.sis.storage.coveragejson, // In the "incubator" sub-project.
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
- org.apache.sis.storage.shapefile, // In the "incubator" sub-project.
- org.apache.sis.storage.geopackage, // In the "incubator" sub-project.
- org.apache.sis.storage.gsf, // In the "incubator" sub-project.
org.apache.sis.storage.gdal, // In the "optional" sub-project.
org.apache.sis.util, // For the "About" command.
org.apache.sis.console,
@@ -70,10 +65,6 @@ module org.apache.sis.storage {
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
org.apache.sis.storage.geotiff,
- org.apache.sis.storage.coveragejson, // In the "incubator" sub-project.
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
- org.apache.sis.storage.shapefile, // In the "incubator" sub-project.
- org.apache.sis.storage.geopackage, // In the "incubator" sub-project.
org.apache.sis.storage.gdal, // In the "optional" sub-project.
org.apache.sis.cloud.aws,
org.apache.sis.console,
diff --git a/endorsed/src/org.apache.sis.util/main/module-info.java b/endorsed/src/org.apache.sis.util/main/module-info.java
index e2519b35cf..ee51f02ee0 100644
--- a/endorsed/src/org.apache.sis.util/main/module-info.java
+++ b/endorsed/src/org.apache.sis.util/main/module-info.java
@@ -109,7 +109,6 @@ module org.apache.sis.util {
org.apache.sis.storage.xml,
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
org.apache.sis.storage.geotiff,
org.apache.sis.storage.earthobservation,
org.apache.sis.storage.gdal, // In the "optional" sub-project.
@@ -130,7 +129,6 @@ module org.apache.sis.util {
org.apache.sis.storage.xml,
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
org.apache.sis.storage.geotiff,
org.apache.sis.storage.earthobservation,
org.apache.sis.portrayal,
@@ -156,10 +154,8 @@ module org.apache.sis.util {
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
org.apache.sis.storage.gdal, // In the "optional" sub-project.
- org.apache.sis.storage.gsf, // In the "incubator" sub-project.
org.apache.sis.portrayal,
org.apache.sis.console,
- org.apache.sis.webapp, // In the "incubator" sub-project.
org.apache.sis.gui, // In the "optional" sub-project.
org.apache.sis.referencing.database; // In the "non-free" sub-project.
@@ -172,7 +168,6 @@ module org.apache.sis.util {
org.apache.sis.storage.sql,
org.apache.sis.storage.netcdf,
org.apache.sis.storage.geotiff,
- org.apache.sis.storage.geoheif, // In the "incubator" sub-project.
org.apache.sis.console,
org.apache.sis.portrayal,
org.apache.sis.gui; // In the "optional" sub-project.
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index e6441136f3..0000000000
Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index a4413138c9..0000000000
--- a/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
deleted file mode 100755
index b740cf1339..0000000000
--- a/gradlew
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright © 2015-2021 the original authors.
-#
-# Licensed 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
-#
-# https://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.
-#
-
-##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-# * compound commands having a testable exit status, especially «case»;
-# * various built-in commands including «command», «set», and «ulimit».
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
-##############################################################################
-
-# Attempt to set APP_HOME
-
-# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
-done
-
-# This is normally unused
-# shellcheck disable=SC2034
-APP_BASE_NAME=${0##*/}
-# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
-
-warn () {
- echo "$*"
-} >&2
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-} >&2
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
- else
- JAVACMD=$JAVA_HOME/bin/java
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD=java
- if ! command -v java >/dev/null 2>&1
- then
- die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-fi
-
-# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
deleted file mode 100644
index 25da30dbde..0000000000
--- a/gradlew.bat
+++ /dev/null
@@ -1,92 +0,0 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%"=="" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%"=="" set DIRNAME=.
-@rem This is normally unused
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if %ERRORLEVEL% equ 0 goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if %ERRORLEVEL% equ 0 goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-set EXIT_CODE=%ERRORLEVEL%
-if %EXIT_CODE% equ 0 set EXIT_CODE=1
-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
-exit /b %EXIT_CODE%
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/incubator/README.md b/incubator/README.md
deleted file mode 100644
index 66b205a5be..0000000000
--- a/incubator/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Incubator modules of Apache SIS
-
-The `src` sub-directory contains experimental modules that are not yet included in
-Apache SIS releases. Those JAR files are not deployed on Maven Central repository.
-Using the JAR files requires compiling the `main` branch from the sources:
-
- gradle assemble
-
-The JAR files will be in the `build/libs/` directory. Their API may change without
-warning at any time, until the modules move to the [endorsed](../endorsed) directory.
diff --git a/incubator/build.gradle.kts b/incubator/build.gradle.kts
deleted file mode 100644
index b0c48e427e..0000000000
--- a/incubator/build.gradle.kts
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * 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.
- */
-group = "org.apache.sis"
-// The version is specified in `gradle.properties`.
-
-/*
- * This project uses a custom Gradle plugin for building a project with Module Source Hierarchy.
- * See the Gradle build script in the `endorsed` directory for more information.
- */
-plugins {
- antlr
- `java-library`
- `maven-publish` // For local deployment only. Not to be published on Maven Central.
- id("net.linguica.maven-settings") version "0.5"
- id("org.apache.sis.buildtools")
-}
-
-/*
- * All JAR files that may potentially be used by a module.
- * For each Apache SIS module, the dependencies actually
- * used are declared in the `module-info.java` file.
- */
-dependencies {
- // Mandatory dependencies
- api(libs.units)
- api(libs.geoapi)
- api(libs.jaxb.api) // Transitive dependency.
- api(libs.jts.core) // Should be an optional dependency.
- api(libs.esri.geometry) // Idem.
- api(libs.yasson)
- api(files("../endorsed/build/classes/java/main/org.apache.sis.util"))
- api(files("../endorsed/build/classes/java/main/org.apache.sis.metadata"))
- api(files("../endorsed/build/classes/java/main/org.apache.sis.referencing"))
- api(files("../endorsed/build/classes/java/main/org.apache.sis.feature"))
- api(files("../endorsed/build/classes/java/main/org.apache.sis.storage"))
- api(files("../endorsed/build/classes/java/main/org.apache.sis.storage.sql"))
-
- // Test dependencies
- testImplementation(tests.junit5)
- testRuntimeOnly (tests.jupiter)
- /*
- * Dependencies used only by incubated modules. The dependencies are not declared
- * in the global `settings.gradle.kts` because incubated modules are not released.
- */
- implementation(group = "org.antlr", name = "antlr4-maven-plugin", version = "4.13.2")
- implementation(group = "org.xerial", name = "sqlite-jdbc", version = "3.45.1.0")
- compileOnly (group = "jakarta.servlet", name = "jakarta.servlet-api", version = "6.1.0")
- compileOnly (group = "org.osgi", name = "osgi.core", version = "8.0.0")
- antlr (group = "org.antlr", name = "antlr4", version = "4.13.2")
-}
-
-/*
- * Generate ANTLR4 source files, then compile main and tests classes from Module Source Hierarchy.
- * The test classes require some additional dependencies declared in the `org.apache.sis.test.incubator` module.
- *
- * Note: as of Gradle 8.2, the ANTLR task does not work well with arbitrary source directories.
- * We have to keep default convention even if it does not fit well in Module Source Hierarchy.
- * Another problem is that we didn't found the right compiler options for combining a directory
- * of generated sources with the main sources in a Module Source Hierarchy, so we have to write
- * the output directly in main source directory. This is hopefully temporary, since we hope to
- * replace ANTLR generated code by hand-written code in a future version.
- */
-var srcDir = file("src") // Must be the same as the hard-coded value in `BuildHelper.java`.
-tasks.compileJava {
- dependsOn(":endorsed:compileJava")
- options.release.set(22) // The version of both Java source code and compiled byte code.
-}
-tasks.compileTestJava {
- options.compilerArgs.add("-source") // "source", not "release", because we accept any target version.
- options.compilerArgs.add("22")
- srcDir.list().forEach {
- addRead(options.compilerArgs, it, "org.apache.sis.test.incubator,org.junit.jupiter.api")
- }
- addExportForTests(options.compilerArgs)
-}
-
-/*
- * Adds a JVM argument for adding dependencies to a module.
- * This is for dependencies not declared in `module-info`
- * but needed for test compilation or test execution.
- */
-fun addRead(args : MutableList<String>, module : String, dependencies : String) {
- args.add("--add-reads")
- args.add(module + '=' + dependencies)
-}
-
-/*
- * Adds a JVM argument for making an internal package accessible to another module.
- * This is for making internal packages accessible to JUnit or to some test classes
- * defined in other modules.
- */
-fun addExport(args : MutableList<String>, module : String, pkg : String, consumers : String) {
- args.add("--add-exports")
- args.add(module + '/' + pkg + '=' + consumers)
-}
-
-/*
- * Add compiler and runtime options for patching the Apache SIS main modules with the test classes.
- * The same options are required for both compiling and executing the tests.
- */
-fun addExportForTests(args : MutableList<String>) {
- /*
- * Some test classes need access to more internal packages than requested by the main classes.
- * The following lines may need to be edited when export statements are added or removed in a
- * module-info.java file of main source code, or when a test class starts using or stop using
- * an internal API.
- */
- // ――――――――――――― Module name ――――――――――――――――――――――― Package to export ―――――――――――――――
- addExport(args, "org.apache.sis.feature", "org.apache.sis.geometry.wrapper",
- "org.apache.sis.storage.geopackage")
-}
-
-/*
- * Discover and execute JUnit-based tests.
- */
-tasks.test {
- val args = mutableListOf("-enableassertions")
- args.add("--enable-native-access")
- args.add("org.apache.sis.storage.gsf")
- addExportForTests(args)
- setAllJvmArgs(args)
- testLogging {
- events("FAILED", "STANDARD_OUT", "STANDARD_ERROR")
- setExceptionFormat("FULL")
- }
- systemProperty("java.awt.headless", "true")
- systemProperty("junit.jupiter.execution.parallel.enabled", "true")
- systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
- systemProperty("junit.jupiter.execution.parallel.mode.classes.default", "concurrent")
-}
-
-/*
- * Configuration of the modules to deploy as Maven artifacts.
- */
-publishing {
- publications {
- create<MavenPublication>("storage.shapefile") {
- var module = "org.apache.sis.storage.shapefile"
- groupId = "org.apache.sis.storage"
- artifactId = "sis-shapefile"
- artifact(layout.buildDirectory.file("libs/${module}.jar"))
- artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"}
- artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"}
- pom {
- name = "Apache SIS Shapefile storage"
- description = "Read and write files in the Shapefile format."
- }
- }
- create<MavenPublication>("storage.geoheif") {
- var module = "org.apache.sis.storage.geoheif"
- groupId = "org.apache.sis.storage"
- artifactId = "sis-geoheif"
- artifact(layout.buildDirectory.file("libs/${module}.jar"))
- artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"}
- artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"}
- pom {
- name = "Apache SIS GeoHEIF Coverage storage"
- description = "Read files in GeoHEIF format."
- }
- }
- create<MavenPublication>("storage.geopackage") {
- var module = "org.apache.sis.storage.geopackage"
- groupId = "org.apache.sis.storage"
- artifactId = "sis-geopackage"
- artifact(layout.buildDirectory.file("libs/${module}.jar"))
- artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"}
- artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"}
- pom {
- name = "Apache SIS GeoPackage storage"
- description = "Read and write files in the GeoPackage format."
- }
- }
- create<MavenPublication>("storage.gsf") {
- var module = "org.apache.sis.storage.gsf"
- groupId = "org.apache.sis.storage"
- artifactId = "sis-gsf"
- artifact(layout.buildDirectory.file("libs/${module}.jar"))
- artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"}
- artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"}
- pom {
- name = "Apache SIS LibGSF Panama binding"
- description = "Read files in GSF format."
- }
- }
- create<MavenPublication>("storage.coveragejson") {
- var module = "org.apache.sis.storage.coveragejson"
- groupId = "org.apache.sis.storage"
- artifactId = "sis-coveragejson"
- artifact(layout.buildDirectory.file("libs/${module}.jar"))
- artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"}
- artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"}
- pom {
- name = "Apache SIS JSON Coverage storage"
- description = "Read and write files in the JSON Coverage format."
- }
- }
- create<MavenPublication>("webapp") {
- var module = "org.apache.sis.webapp"
- groupId = "org.apache.sis.application"
- artifactId = "sis-webapp"
- artifact(layout.buildDirectory.file("libs/${module}.jar"))
- artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"}
- artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"}
- pom {
- name = "Apache SIS web services layer"
- description = "Placeholder for future developments."
- }
- }
- }
- /* Following block is currently repeated in all sub-projects. */
- repositories {
- maven {
- val stage = if (version.toString().endsWith("SNAPSHOT")) "snapshots" else "releases"
- name = providers.gradleProperty("${stage}Id").get()
- url = uri(providers.gradleProperty("${stage}URL").get())
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/META-INF/services/org.apache.sis.storage.DataStoreProvider b/incubator/src/org.apache.sis.storage.coveragejson/main/META-INF/services/org.apache.sis.storage.DataStoreProvider
deleted file mode 100644
index bb356f4500..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/META-INF/services/org.apache.sis.storage.DataStoreProvider
+++ /dev/null
@@ -1,4 +0,0 @@
-# Workaround for Maven bug https://issues.apache.org/jira/browse/MNG-7855
-# The content of this file is automatically derived from module-info.class file.
-# Should be used only if the JAR file was on class-path rather than module-path.
-org.apache.sis.storage.coveragejson.CoverageJsonStoreProvider
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/module-info.java b/incubator/src/org.apache.sis.storage.coveragejson/main/module-info.java
deleted file mode 100644
index 4005e4cdf9..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/module-info.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * Coverage-json store.
- *
- * @todo Consider renaming as {@code org.apache.sis.storage.json.coverage} in order to group all JSON formats
- * in a single root. Also rename package names accordingly. Having the exact format name "coveragejson"
- * in module/package name is redundant with {@code CoverageJsonStore} class name. Furthermore the
- * "Coverage-json" description appears right after module name in Javadoc. Having a single "json"
- * root allow Javadoc to detect more easily the related modules and organize them accordingly.
- *
- * @author Johann Sorel (Geomatys)
- */
-module org.apache.sis.storage.coveragejson {
- // Dependencies used in public API.
- requires transitive org.apache.sis.referencing;
- requires transitive org.apache.sis.storage;
-
- // Dependencies internal to the implementation.
- requires jakarta.json;
- requires jakarta.json.bind;
-
- // Temporary dependency used by BindingTest class. TODO: remove that dependency.
- requires org.eclipse.yasson;
-
- provides org.apache.sis.storage.DataStoreProvider
- with org.apache.sis.storage.coveragejson.CoverageJsonStoreProvider;
-
- exports org.apache.sis.storage.coveragejson;
-
- /*
- * TODO
- * Following should be a qualified export to `org.eclipse.yasson` only.
- * However it does not work with Yasson:
- *
- * https://github.com/eclipse-ee4j/yasson/issues/545
- */
- exports org.apache.sis.storage.coveragejson.binding;
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java
deleted file mode 100644
index b5b87069e6..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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.coveragejson;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import jakarta.json.bind.Jsonb;
-import jakarta.json.bind.JsonbBuilder;
-import jakarta.json.bind.JsonbConfig;
-import org.opengis.metadata.Metadata;
-import org.opengis.parameter.ParameterValueGroup;
-import org.apache.sis.coverage.grid.GridCoverage;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.storage.NoSuchDataException;
-import org.apache.sis.storage.Resource;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.WritableAggregate;
-import org.apache.sis.storage.coveragejson.binding.Coverage;
-import org.apache.sis.storage.coveragejson.binding.CoverageCollection;
-import org.apache.sis.storage.coveragejson.binding.CoverageJsonObject;
-import org.apache.sis.storage.base.MetadataBuilder;
-import org.apache.sis.storage.base.URIDataStore;
-import org.apache.sis.io.stream.IOUtilities;
-
-
-/**
- * A data store backed by Coverage-JSON files.
- *
- * @author Johann Sorel (Geomatys)
- */
-public class CoverageJsonStore extends DataStore implements WritableAggregate {
- /**
- * The {@link CoverageJsonStoreProvider#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 back to path is not
- * looseness (relative paths become absolutes).
- */
- private final Path path;
-
- private boolean parsed;
- private final List<Resource> components = new ArrayList<>();
-
- CoverageJsonStore(CoverageJsonStoreProvider provider, StorageConnector connector) throws DataStoreException {
- super(provider, connector);
- location = connector.getStorageAs(URI.class);
- path = connector.getStorageAs(Path.class);
- }
-
- @Override
- public Optional<ParameterValueGroup> getOpenParameters() {
- return Optional.ofNullable(URIDataStore.parameters(provider, location));
- }
-
- @Override
- public Metadata getMetadata() throws DataStoreException {
- final MetadataBuilder builder = new MetadataBuilder();
- builder.addIdentifier(null, IOUtilities.filename(path), MetadataBuilder.Scope.ALL);
- return builder.buildAndFreeze();
- }
-
- @Override
- public synchronized Collection<? extends Resource> components() throws DataStoreException {
- if (!parsed) {
- parsed = true;
- if (Files.exists(path)) {
- try (Jsonb b = JsonbBuilder.create();
- InputStream in = new BufferedInputStream(Files.newInputStream(path))) {
- final CoverageJsonObject obj = b.fromJson(in, CoverageJsonObject.class);
-
- if (obj instanceof Coverage) {
- final Coverage coverage = (Coverage) obj;
- components.add(new CoverageResource(this, coverage));
-
- } else if (obj instanceof CoverageCollection) {
- final CoverageCollection col = (CoverageCollection) obj;
- throw new UnsupportedOperationException("Coverage collection not supported yet.");
- }
-
- } catch (Exception ex) {
- throw new DataStoreException("Failed to parse coverage json object.", ex);
- }
- }
- }
- return Collections.unmodifiableList(components);
- }
-
- @Override
- public synchronized Resource add(Resource resource) throws DataStoreException {
- // Ensure file is parsed
- components();
-
- if (resource instanceof GridCoverageResource) {
- final GridCoverageResource gcr = (GridCoverageResource) resource;
- final GridCoverage coverage = gcr.read(null);
- final Coverage binding = CoverageResource.gridCoverageToBinding(coverage);
- final CoverageResource jcr = new CoverageResource(this, binding);
- components.add(jcr);
- save();
- return jcr;
- }
- throw new DataStoreException("Only GridCoverage resource are supported");
- }
-
- @Override
- public synchronized void remove(Resource resource) throws DataStoreException {
- // Ensure file is parsed
- components();
-
- for (int i = 0, n = components.size(); i < n ;i++) {
- if (components.get(i) == resource) {
- components.remove(i);
- save();
- return;
- }
- }
- throw new NoSuchDataException();
- }
-
- private synchronized void save() throws DataStoreException {
- // Ensure file is parsed
- components();
-
- final int size = components.size();
- final String json;
- if (size == 1) {
- //single coverage
- final CoverageResource res = (CoverageResource) components.get(0);
-
- try (Jsonb jsonb = JsonbBuilder.create(new JsonbConfig().withFormatting(true))) {
- json = jsonb.toJson(res.getBinding());
- } catch (Exception ex) {
- throw new DataStoreException("Failed to create coverage json binding", ex);
- }
- } else {
- final CoverageCollection col = new CoverageCollection();
- col.coverages = new ArrayList<>();
- for (int i = 0; i < size; i++) {
- final CoverageResource res = (CoverageResource) components.get(i);
- col.coverages.add(res.getBinding());
- }
-
- try (Jsonb jsonb = JsonbBuilder.create(new JsonbConfig().withFormatting(true))) {
- json = jsonb.toJson(col);
- } catch (Exception ex) {
- throw new DataStoreException("Failed to create coverage collection json binding", ex);
- }
- }
-
- try {
- Files.write(path, json.getBytes(StandardCharsets.UTF_8));
- } catch (IOException ex) {
- throw new DataStoreException("Failed to save coverage-json", ex);
- }
- }
-
- @Override
- public void close() throws DataStoreException {
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java
deleted file mode 100644
index cbfca0a647..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.coveragejson;
-
-import java.net.URI;
-import java.util.logging.Logger;
-import org.opengis.parameter.ParameterDescriptorGroup;
-import org.apache.sis.storage.Aggregate;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreProvider;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.storage.ProbeResult;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.WritableAggregate;
-import org.apache.sis.storage.base.Capability;
-import org.apache.sis.storage.base.StoreMetadata;
-import org.apache.sis.storage.base.URIDataStoreProvider;
-import org.apache.sis.util.Version;
-
-
-/**
- * The provider of {@link CoverageJsonStore} instances. Given a {@link StorageConnector} input,
- * this class tries to instantiate a {@code CoverageJsonStore}.
- *
- * Draft specification : https://github.com/opengeospatial/CoverageJSON
- *
- * @author Johann Sorel (Geomatys)
- *
- * @see CoverageJsonStore
- */
-@StoreMetadata(formatName = CoverageJsonStoreProvider.NAME,
- fileSuffixes = {"covjson"},
- capabilities = {Capability.READ, Capability.CREATE, Capability.WRITE},
- resourceTypes = {WritableAggregate.class, GridCoverageResource.class})
-public class CoverageJsonStoreProvider extends DataStoreProvider {
-
- public static final String NAME = "CoverageJSON";
-
- /**
- * The MIME type for Coverage-JSON files.
- */
- private static final String MIME_TYPE = "application/vnd.cov+json";
-
- /**
- * The logger used by Coverage-JSON stores.
- *
- * @see #getLogger()
- */
- private static final Logger LOGGER = Logger.getLogger("org.apache.sis.storage.coveragejson");
-
- /**
- * The parameter descriptor to be returned by {@link #getOpenParameters()}.
- */
- private static final ParameterDescriptorGroup OPEN_DESCRIPTOR = URIDataStoreProvider.descriptor(NAME);
-
- public CoverageJsonStoreProvider() {
- }
-
- @Override
- public String getShortName() {
- return NAME;
- }
-
- @Override
- public ParameterDescriptorGroup getOpenParameters() {
- return OPEN_DESCRIPTOR;
- }
-
- @Override
- public ProbeResult probeContent(StorageConnector connector) throws DataStoreException {
- final URI uri = connector.getStorageAs(URI.class);
- if (uri != null && uri.toString().toLowerCase().endsWith(".covjson")) {
- return new ProbeResult(true, MIME_TYPE, new Version("0.9"));
- }
- return ProbeResult.UNSUPPORTED_STORAGE;
- }
-
- @Override
- public DataStore open(StorageConnector connector) throws DataStoreException {
- return new CoverageJsonStore(this, connector);
- }
-
- /**
- * Returns the logger used by CoverageJSON stores.
- */
- @Override
- public Logger getLogger() {
- return LOGGER;
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageResource.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageResource.java
deleted file mode 100644
index a3f1a58a6c..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageResource.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*
- * 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.coveragejson;
-
-import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferDouble;
-import java.awt.image.RenderedImage;
-import java.time.Instant;
-import java.time.format.DateTimeFormatter;
-import java.time.format.DateTimeFormatterBuilder;
-import java.time.format.DateTimeParseException;
-import java.time.format.SignStyle;
-import java.time.temporal.ChronoField;
-import java.time.temporal.TemporalAccessor;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import javax.measure.Unit;
-import org.opengis.metadata.spatial.DimensionNameType;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.MathTransform1D;
-import org.opengis.referencing.operation.Matrix;
-import org.opengis.util.FactoryException;
-import org.apache.sis.coverage.SampleDimension;
-import org.apache.sis.coverage.grid.BufferedGridCoverage;
-import org.apache.sis.coverage.grid.DisjointExtentException;
-import org.apache.sis.coverage.grid.GridCoverage;
-import org.apache.sis.coverage.grid.GridExtent;
-import org.apache.sis.coverage.grid.GridGeometry;
-import org.apache.sis.coverage.grid.GridRoundingMode;
-import org.apache.sis.coverage.grid.PixelInCell;
-import org.apache.sis.image.PixelIterator;
-import org.apache.sis.storage.AbstractGridCoverageResource;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.NoSuchDataException;
-import org.apache.sis.storage.coveragejson.binding.Axe;
-import org.apache.sis.storage.coveragejson.binding.Axes;
-import org.apache.sis.storage.coveragejson.binding.Category;
-import org.apache.sis.storage.coveragejson.binding.CategoryEncoding;
-import org.apache.sis.storage.coveragejson.binding.Coverage;
-import org.apache.sis.storage.coveragejson.binding.CoverageJsonObject;
-import org.apache.sis.storage.coveragejson.binding.Domain;
-import org.apache.sis.storage.coveragejson.binding.GeographicCRS;
-import org.apache.sis.storage.coveragejson.binding.IdentifierRS;
-import org.apache.sis.storage.coveragejson.binding.NdArray;
-import org.apache.sis.storage.coveragejson.binding.ObservedProperty;
-import org.apache.sis.storage.coveragejson.binding.Parameter;
-import org.apache.sis.storage.coveragejson.binding.Parameters;
-import org.apache.sis.storage.coveragejson.binding.ProjectedCRS;
-import org.apache.sis.storage.coveragejson.binding.Ranges;
-import org.apache.sis.storage.coveragejson.binding.ReferenceSystemConnection;
-import org.apache.sis.storage.coveragejson.binding.TemporalRS;
-import org.apache.sis.storage.coveragejson.binding.VerticalCRS;
-import org.apache.sis.measure.NumberRange;
-import org.apache.sis.measure.Units;
-import org.apache.sis.referencing.CRS;
-import org.apache.sis.referencing.CommonCRS;
-import org.apache.sis.referencing.IdentifiedObjects;
-import org.apache.sis.referencing.operation.matrix.Matrices;
-import org.apache.sis.referencing.operation.matrix.MatrixSIS;
-import org.apache.sis.referencing.operation.transform.LinearTransform;
-import org.apache.sis.referencing.operation.transform.MathTransforms;
-
-// Specific to the main branch:
-import org.apache.sis.image.SequenceType;
-
-
-/**
- *
- * @author Johann Sorel (Geomatys)
- */
-final class CoverageResource extends AbstractGridCoverageResource {
-
- private static final DateTimeFormatter YEAR = new DateTimeFormatterBuilder()
- .appendValue(ChronoField.YEAR, 1, 19, SignStyle.EXCEEDS_PAD)
- .toFormatter();
-
-
- private static final DateTimeFormatter YEAR_MONTH = new DateTimeFormatterBuilder()
- .appendValue(ChronoField.YEAR, 1, 19, SignStyle.EXCEEDS_PAD)
- .appendLiteral('-')
- .appendValue(ChronoField.MONTH_OF_YEAR, 1)
- .toFormatter();
-
- private static final DateTimeFormatter YEAR_MONTH_DAY = new DateTimeFormatterBuilder()
- .appendValue(ChronoField.YEAR, 1, 19, SignStyle.EXCEEDS_PAD)
- .appendLiteral('-')
- .appendValue(ChronoField.MONTH_OF_YEAR, 1)
- .appendLiteral('-')
- .appendValue(ChronoField.DAY_OF_MONTH, 1)
- .toFormatter();
-
- private static final DateTimeFormatter DATE_TIME = DateTimeFormatter.ISO_DATE_TIME;
-
- private final CoverageJsonStore store;
- private final Coverage binding;
-
- private final GridGeometry gridGeometry;
- private final List<SampleDimension> sampleDimensions;
- private final Map<String,double[]> datas;
-
- public CoverageResource(CoverageJsonStore store, Coverage binding) throws DataStoreException {
- super(null);
- this.store = store;
- this.binding = binding;
-
- // Rebuild grid geometry
- try {
- gridGeometry = jsonToGridGeometry(binding.domain);
- } catch (FactoryException ex) {
- throw new DataStoreException("Failed to create GridGeometry from JSON Domain", ex);
- }
- // Rebuild sample dimensions
- sampleDimensions = new ArrayList<>();
- for (Entry<String,Parameter> entry : binding.parameters.any.entrySet()) {
- final SampleDimension sd = jsonToSampleDimension(entry.getKey(), entry.getValue());
- sampleDimensions.add(sd);
- }
- if (binding.parameterGroups != null) {
- throw new UnsupportedOperationException("Parameter groups not supported yet.");
- }
- // Read datas
- datas = new HashMap<>();
- for (Entry<String,NdArray> entry : binding.ranges.any.entrySet()) {
- datas.put(entry.getKey(), jsonToDataBuffer(entry.getValue()));
- }
- }
-
- /**
- * Returns the JSON coverage binding.
- */
- Coverage getBinding() {
- return binding;
- }
-
- @Override
- public GridGeometry getGridGeometry() throws DataStoreException {
- return gridGeometry;
- }
-
- @Override
- public List<SampleDimension> getSampleDimensions() throws DataStoreException {
- return Collections.unmodifiableList(sampleDimensions);
- }
-
- @Override
- public GridCoverage read(GridGeometry domain, int... ranges) throws DataStoreException {
- final GridGeometry intersection;
- if (domain != null) {
- try {
- intersection = gridGeometry.derive().rounding(GridRoundingMode.ENCLOSING).subgrid(domain).build();
- } catch (DisjointExtentException ex) {
- throw new NoSuchDataException(ex);
- }
- } else {
- intersection = gridGeometry;
- }
- final double[][] rawDatas;
- final List<SampleDimension> selected;
- if (ranges == null || ranges.length == 0) {
- selected = sampleDimensions;
- rawDatas = new double[sampleDimensions.size()][0];
- for (int i = 0; i < rawDatas.length; i++) {
- rawDatas[i] = datas.get(sampleDimensions.get(i).getName().toString());
- }
- } else {
- selected = new ArrayList<>();
- rawDatas = new double[ranges.length][0];
- for (int i = 0; i < rawDatas.length; i++) {
- final SampleDimension sd = sampleDimensions.get(ranges[i]);
- selected.add(sd);
- rawDatas[i] = datas.get(sd.getName().toString());
- }
- }
- final DataBuffer buffer = new DataBufferDouble(rawDatas, rawDatas[0].length);
- return new BufferedGridCoverage(intersection, selected, buffer);
- }
-
- /**
- * Transforms JSON domain to GridGeometry.
- */
- private static GridGeometry jsonToGridGeometry(Domain domain) throws DataStoreException, FactoryException {
- if (Domain.DOMAINTYPE_GRID.equalsIgnoreCase(domain.domainType)) {
-
- // Build coordinate system
- final List<ReferenceSystemConnection> referencing = domain.referencing;
- final List<String> axeNames = new ArrayList<>();
- final List<CoordinateReferenceSystem> crss = new ArrayList<>();
- if (referencing != null && !referencing.isEmpty()) {
- for (ReferenceSystemConnection rsc : referencing) {
- axeNames.addAll(rsc.coordinates);
- final CoordinateReferenceSystem crs = jsonToCoordinateReferenceSystem(rsc.system);
- if (crs.getCoordinateSystem().getDimension() != rsc.coordinates.size()) {
- throw new DataStoreException("Declared CRS " + rsc.system.toString() + " do not match coordinates length");
- }
- crss.add(crs);
- }
- } else {
- throw new DataStoreException("Coverage domain must be defined, Coverage as part of CoverageCollection not supported yet.");
- }
-
- // Build extent
- final int dimension = axeNames.size();
- final Axes axes = domain.axes;
- final GridGeometry[] axeGrids = new GridGeometry[dimension];
-
- // Check if axes declared on crs are ordered in the same way as the grid extent.
- final int[] reorder = new int[dimension];
- boolean inOrder = true;
-
- for (int i = 0; i < dimension; i++) {
- final String axeName = axeNames.get(i);
- final Axe axe;
- final int realIdx;
- switch (axeName) {
- case "x" :
- if (axes.x == null) throw new DataStoreException("X axe is undefined");
- axe = axes.x;
- realIdx = 0;
- reorder[i] = realIdx;
- inOrder &= (i == realIdx);
- break;
- case "y" :
- if (axes.y == null) throw new DataStoreException("Y axe is undefined");
- axe = axes.y;
- realIdx = 1;
- reorder[i] = realIdx;
- inOrder &= (i == realIdx);
- break;
- case "z" :
- if (axes.z == null) throw new DataStoreException("Z axe is undefined");
- axe = axes.z;
- realIdx = 2;
- reorder[i] = realIdx;
- inOrder &= (i == realIdx);
- break;
- case "t" :
- if (axes.t == null) throw new DataStoreException("T axe is undefined");
- axe = axes.t;
- realIdx = reorder.length == 3 ? 2 : 3;
- reorder[i] = realIdx;
- inOrder &= (i == realIdx);
- break;
- default: throw new DataStoreException("Unexpected axe name :" + axeName);
- }
- axeGrids[realIdx] = jsonAxeToGridGeometry(axeName, axe);
- }
-
- final DimensionNameType[] dnt = new DimensionNameType[dimension];
- final long[] lower = new long[dimension];
- final long[] upper = new long[dimension]; //inclusive
- MathTransform gridToCrs = null;
- for (int i = 0; i < dimension; i++) {
- dnt[i] = axeGrids[i].getExtent().getAxisType(0).get();
- upper[i] = axeGrids[i].getExtent().getHigh(0);
- if (gridToCrs == null) {
- gridToCrs = axeGrids[i].getGridToCRS(PixelInCell.CELL_CENTER);
- } else {
- gridToCrs = MathTransforms.compound(gridToCrs, axeGrids[i].getGridToCRS(PixelInCell.CELL_CENTER));
- }
- }
-
- if (!inOrder) {
- final MatrixSIS m = Matrices.createZero(dimension+1, dimension+1);
- for (int i = 0; i < dimension; i++) {
- m.setElement(i, reorder[i], 1.0);
- }
- m.setElement(dimension, dimension, 1.0);
- final MathTransform reorderTrs = MathTransforms.linear(m);
- gridToCrs = MathTransforms.concatenate(reorderTrs, gridToCrs);
- }
-
- final CoordinateReferenceSystem crs = CRS.compound(crss.toArray(CoordinateReferenceSystem[]::new));
- final GridExtent extent = new GridExtent(dnt, lower, upper, true);
- return new GridGeometry(extent, PixelInCell.CELL_CENTER, gridToCrs, crs);
-
- } else {
- throw new DataStoreException("Unsupported domain type " + domain.domainType);
- }
- }
-
- /**
- * Transform JSON axe to 1D GridGeometry without CRS.
- */
- private static GridGeometry jsonAxeToGridGeometry(String axeName, Axe axe) throws DataStoreException {
-
- if (axe.dataType == null || Axe.DATATYPE_PRIMITIVE.equals(axe.dataType)) {
-
- } else if (Axe.DATATYPE_TUPLE.equals(axe.dataType) ) {
- throw new UnsupportedOperationException("Tuple axe data type not supported yet.");
- } else if (Axe.DATATYPE_POLYGON.equals(axe.dataType) ) {
- throw new UnsupportedOperationException("Polygon axe data type not supported yet.");
- } else {
- throw new DataStoreException("Unexpected axe data type :" + axe.dataType);
- }
-
- // Rebuild axe transform
- final MathTransform1D axeTrs;
- final int size;
- if (axe.values != null) {
- final double[] values = new double[axe.values.size()];
- for (int i = 0; i < values.length; i++) {
- values[i] = asDouble(axe.values.get(i));
- }
- size = values.length;
- axeTrs = MathTransforms.interpolate(null, values);
- } else if (axe.start != null) {
- size = axe.num;
- if (axe.num == 1) {
- axeTrs = (MathTransform1D) MathTransforms.linear(1.0, axe.start);
- } else {
- final double step = (axe.stop - axe.start) / (axe.num -1);
- axeTrs = (MathTransform1D) MathTransforms.linear(step, axe.start);
- }
- } else {
- throw new DataStoreException("Axe must have values or star/stop values");
- }
-
- final GridExtent extent = new GridExtent(new DimensionNameType[]{DimensionNameType.valueOf(axeName)}, new long[]{0}, new long[]{size-1}, true);
- return new GridGeometry(extent, PixelInCell.CELL_CENTER, axeTrs, null);
- }
-
- /**
- * Transforms JSON system object to CoordinateReferenceSystem.
- */
- private static CoordinateReferenceSystem jsonToCoordinateReferenceSystem(CoverageJsonObject obj) throws FactoryException {
- if (obj instanceof GeographicCRS) {
- final GeographicCRS jcrs = (GeographicCRS) obj;
- if (jcrs.id != null) {
- if (jcrs.id.equals("http://www.opengis.net/def/crs/EPSG/0/4979")) {
- return CommonCRS.WGS84.geographic3D();
- }
- return CRS.forCode(jcrs.id);
- } else {
- /* Spec 9.5.1.1
- Note that sometimes (e.g. for numerical model data) the exact CRS
- may not be known or may be undefined. In this case the "id" may
- be omitted, but the "type" still indicates that this is a geographic CRS.
- Therefore clients can still use geodetic longitude, geodetic latitude
- (and maybe height) axes, even if they cannot accurately georeference the information.
- */
- return CommonCRS.WGS84.normalizedGeographic();
- }
- } else if (obj instanceof ProjectedCRS) {
- final ProjectedCRS jcrs = (ProjectedCRS) obj;
- throw new UnsupportedOperationException("ProjectedCRS not supported yet");
-
- } else if (obj instanceof VerticalCRS) {
- final VerticalCRS jcrs = (VerticalCRS) obj;
- throw new UnsupportedOperationException("VerticalCRS not supported yet");
-
- } else if (obj instanceof TemporalRS) {
- final TemporalRS jcrs = (TemporalRS) obj;
- if (jcrs.timeScale != null) {
- throw new UnsupportedOperationException("TemporalRS timeScale not supported yet");
- }
- if ("Gregorian".equalsIgnoreCase(jcrs.calendar)) {
- return CommonCRS.Temporal.JAVA.crs();
- } else {
- throw new UnsupportedOperationException(jcrs.calendar + "calendar not supported yet");
- }
-
- } else if (obj instanceof IdentifierRS) {
- final IdentifierRS jcrs = (IdentifierRS) obj;
- throw new UnsupportedOperationException("IdentifierRS not supported yet");
-
- } else {
- throw new UnsupportedOperationException("Unsupported system " + String.valueOf(obj));
- }
- }
-
- /**
- * Transform JSON parameter to SampleDimension.
- */
- private static SampleDimension jsonToSampleDimension(String name, Parameter parameter) {
- final SampleDimension.Builder builder = new SampleDimension.Builder();
-
- builder.setName(name);
-
-// if (parameter.id != null) {
-// builder.setName(parameter.id);
-// } else if (parameter.label != null) {
-// builder.setName(parameter.label);
-// } else if (parameter.description != null) {
-// builder.setName(parameter.description);
-// }
-
- Unit unit = jsonToUnit(parameter.unit);
-
- //TODO categories
- //parameter.categoryEncoding;
- //parameter.observedProperty;
-
- return builder.build();
- }
-
- /**
- * Transform JSON unit to SIS Unit.
- */
- private static Unit jsonToUnit(org.apache.sis.storage.coveragejson.binding.Unit unit) {
- if (unit == null) return Units.UNITY;
-
- if (unit.symbol instanceof String) {
- return Units.valueOf(unit.symbol.toString());
- }
- return Units.UNITY;
- }
-
- /**
- * Transforms JSON NdArray to number array.
- */
- private static double[] jsonToDataBuffer(NdArray array) throws DataStoreException {
- // TODO: more work on checking axes order
- double[] values = new double[array.values.size()];
- for (int i = 0; i < values.length; i++) {
- values[i] = asDouble(array.values.get(i));
- }
-
- return values;
- }
-
- private static double asDouble(Object cdt) throws DataStoreException {
- if (cdt == null) {
- return Double.NaN;
- } else if (cdt instanceof String) {
- final Instant instant = parseDataTime(String.valueOf(cdt));
- return instant.toEpochMilli();
- } else if (cdt instanceof Number) {
- return ((Number) cdt).doubleValue();
- } else {
- throw new DataStoreException("Unexpected value : " + cdt);
- }
- }
-
- /**
- * If the calendar is based on years, months, days, then the referenced
- * values SHOULD use one of the following ISO8601-based lexical representations:
- * YYYY
- * ±XYYYY (where X stands for extra year digits)
- * YYYY-MM
- * YYYY-MM-DD
- * YYYY-MM-DDTHH:MM:SS[.F]Z where Z is either “Z” or a time scale offset +|-HH:MM
- *
- * If calendar dates with reduced precision are used in a lexical
- * representation (e.g. "2016"), then a client SHOULD interpret those dates
- * in that reduced precision.
- */
- private static Instant parseDataTime(String str) throws DataStoreException {
- for (DateTimeFormatter dtf : Arrays.asList(YEAR,YEAR_MONTH, YEAR_MONTH_DAY, DATE_TIME)) {
- try {
- TemporalAccessor accesser = dtf.parse(str);
- return Instant.from(accesser);
- } catch (DateTimeParseException ex) {
- // Do nothing
- }
- }
- throw new DataStoreException("Unable to parse date : " + str);
- }
-
- static Coverage gridCoverageToBinding(GridCoverage coverage) throws DataStoreException {
- final Coverage binding = new Coverage();
- try {
- //build domain
- binding.domain = gridGeometryToJson(coverage.getGridGeometry());
- } catch (FactoryException ex) {
- throw new DataStoreException(ex.getMessage(), ex);
- }
-
- // Build parameters
- binding.parameters = new Parameters();
- for (SampleDimension sd : coverage.getSampleDimensions()) {
- final Entry<String, Parameter> entry = sampleDimensionToJson(sd);
- binding.parameters.setAnyProperty(entry.getKey(), entry.getValue());
- }
-
- // Build datas
- binding.ranges = new Ranges();
- binding.ranges.any.putAll(imageToJson(coverage, new ArrayList<>(binding.parameters.any.keySet())));
-
- return binding;
- }
-
- private static Domain gridGeometryToJson(GridGeometry gridGeometry) throws DataStoreException, FactoryException {
- final Domain binding = new Domain();
- binding.domainType = Domain.DOMAINTYPE_GRID;
- binding.referencing = new ArrayList<>();
- binding.axes = new Axes();
-
- final GridExtent extent = gridGeometry.getExtent();
- final MathTransform gridToCrs = gridGeometry.getGridToCRS(PixelInCell.CELL_CENTER);
- final int dimension = gridGeometry.getDimension();
-
- final long[] gridLow = new long[dimension];
- for (int i=0; i<dimension; i++) {
- gridLow[i] = extent.getLow(i);
- }
- final int[] gridSize = new int[dimension];
- final List<Integer> gridToCrsIndex = new ArrayList<>(dimension);
- final double[] scales = new double[dimension];
- final double[] offsets = new double[dimension];
- if (gridToCrs instanceof LinearTransform) {
- final Matrix matrix = ((LinearTransform)gridToCrs).getMatrix();
- search:
- for (int i = 0; i < dimension; i++) {
- //find scale column
- for (int c = 0; c < dimension; c++) {
- double d = matrix.getElement(i, c);
- if (d != 0.0) {
- gridToCrsIndex.add(c);
- gridSize[i] = Math.toIntExact(extent.getSize(i));
- scales[i] = d;
- offsets[i] = matrix.getElement(i, dimension);
- continue search;
- }
- }
- throw new DataStoreException("An axe in the Grid to CRS transform has no scale value");
- }
- } else {
- // TODO: handle cases of compound transforms, would allow us to handle no linear 1D axes.
- throw new DataStoreException("Coveragejson only support linear grid to CRS transform without rotation or shearing");
- }
-
- final CoordinateReferenceSystem crs = gridGeometry.getCoordinateReferenceSystem();
- int crsIdx = 0;
- for (CoordinateReferenceSystem scrs : CRS.getSingleComponents(crs)) {
- final int gridIdx = gridToCrsIndex.get(crsIdx);
- //coverage-json expect us to order x/y in longitude/latitude order
- if (scrs instanceof org.opengis.referencing.crs.GeographicCRS) {
- final org.opengis.referencing.crs.GeographicCRS gcrs = (org.opengis.referencing.crs.GeographicCRS) scrs;
- final int gridIdx2 = gridToCrsIndex.get(crsIdx+1);
- final GeographicCRS grs = new GeographicCRS();
- grs.id = toURI(gcrs);
- final ReferenceSystemConnection rsc = new ReferenceSystemConnection();
- rsc.coordinates = Arrays.asList("x", "y");
- rsc.system = grs;
- binding.referencing.add(rsc);
- binding.axes.x = buildAxe(gridLow[gridIdx], gridSize[gridIdx], scales[gridIdx], offsets[gridIdx], false);
- binding.axes.y = buildAxe(gridLow[gridIdx2], gridSize[gridIdx2], scales[gridIdx2], offsets[gridIdx2], false);
-
- crsIdx +=2;
- } else if (scrs instanceof org.opengis.referencing.crs.ProjectedCRS) {
- final org.opengis.referencing.crs.ProjectedCRS pcrs = (org.opengis.referencing.crs.ProjectedCRS) scrs;
- final int gridIdx2 = gridToCrsIndex.get(crsIdx+1);
- final ProjectedCRS grs = new ProjectedCRS();
- grs.id = toURI(pcrs);
- final ReferenceSystemConnection rsc = new ReferenceSystemConnection();
- rsc.coordinates = Arrays.asList("x", "y");
- rsc.system = grs;
- binding.referencing.add(rsc);
- binding.axes.x = buildAxe(gridLow[gridIdx], gridSize[gridIdx], scales[gridIdx], offsets[gridIdx], false);
- binding.axes.y = buildAxe(gridLow[gridIdx2], gridSize[gridIdx2], scales[gridIdx2], offsets[gridIdx2], false);
-
- crsIdx +=2;
- } else if (scrs instanceof org.opengis.referencing.crs.VerticalCRS) {
- final org.opengis.referencing.crs.VerticalCRS vcrs = (org.opengis.referencing.crs.VerticalCRS) scrs;
-
- if (CommonCRS.Vertical.ELLIPSOIDAL.crs().equals(vcrs)) {
- final VerticalCRS vrs = new VerticalCRS();
- final ReferenceSystemConnection rsc = new ReferenceSystemConnection();
- rsc.coordinates = Arrays.asList("z");
- rsc.system = vrs;
- binding.referencing.add(rsc);
- binding.axes.z = buildAxe(gridLow[gridIdx], gridSize[gridIdx], scales[gridIdx], offsets[gridIdx], false);
- } else {
- throw new DataStoreException("A temporal reference system could not be mapped to CoverageJSON\n" + scrs.toString());
- }
-
- crsIdx++;
- } else if (scrs instanceof org.opengis.referencing.crs.TemporalCRS) {
- final org.opengis.referencing.crs.TemporalCRS tcrs = (org.opengis.referencing.crs.TemporalCRS) scrs;
-
- if (CommonCRS.Temporal.JAVA.crs().equals(tcrs)) {
- final TemporalRS trs = new TemporalRS();
- trs.calendar = "Gregorian";
- final ReferenceSystemConnection rsc = new ReferenceSystemConnection();
- rsc.coordinates = Arrays.asList("t");
- rsc.system = trs;
- binding.referencing.add(rsc);
- binding.axes.t = buildAxe(gridLow[gridIdx], gridSize[gridIdx], scales[gridIdx], offsets[gridIdx], true);
- } else {
- throw new DataStoreException("A temporal reference system could not be mapped to CoverageJSON\n" + scrs.toString());
- }
-
- crsIdx++;
- } else {
- throw new DataStoreException("A coordinate reference system could not be mapped to CoverageJSON\n" + scrs.toString());
- }
- }
-
- return binding;
- }
-
- private static Entry<String,Parameter> sampleDimensionToJson(SampleDimension sd) {
- final Parameter binding = new Parameter();
- final String name = sd.getName().toString();
- binding.id = name;
-
- final List<org.apache.sis.coverage.Category> categories = sd.getCategories();
- if (categories != null && !categories.isEmpty()) {
-
- final ObservedProperty obs = new ObservedProperty();
- obs.id = name;
- obs.categories = new ArrayList<>();
- binding.observedProperty = obs;
-
- final CategoryEncoding catEnc = new CategoryEncoding();
- binding.categoryEncoding = catEnc;
- for (org.apache.sis.coverage.Category cat : sd.getCategories()) {
- final Category catb = new Category();
- catb.id = cat.getName().toString();
- obs.categories.add(catb);
-
- final NumberRange<?> range = cat.getSampleRange();
- final double min = range.getMinDouble();
- final double max = range.getMaxDouble(false);
- final List<Integer> values = new ArrayList<>();
- for (double i = min; i < max; i++) {
- values.add((int) i);
- }
- catEnc.any.put(catb.id, values);
- }
- }
-
- // TODO: convert categories, units,... we might need a database of observed properties
- return new AbstractMap.SimpleImmutableEntry<>(name, binding);
- }
-
- private static Map<String,NdArray> imageToJson(GridCoverage coverage, List<String> properties) throws DataStoreException {
- if (coverage.getGridGeometry().getDimension() != 2) {
- throw new DataStoreException("Only Grid coverage 2D supported as this time");
- }
-
- final RenderedImage image = coverage.render(null);
- final PixelIterator ite = new PixelIterator.Builder().setIteratorOrder(SequenceType.LINEAR).create(image);
- final int width = image.getWidth();
- final int height = image.getHeight();
-
- final int nbSample = properties.size();
- final double[] pixel = new double[nbSample];
- final NdArray[] arrays = new NdArray[nbSample];
- final Map<String,NdArray> map = new LinkedHashMap<>();
- for (int i = 0; i < nbSample; i++) {
- arrays[i] = new NdArray();
- arrays[i].dataType = NdArray.DATATYPE_FLOAT;
- arrays[i].shape = new int[]{width, height};
- arrays[i].axisNames = new String[]{"y","x"};
- arrays[i].values = new ArrayList<>();
- map.put(properties.get(i), arrays[i]);
- }
-
- while (ite.next()) {
- ite.getPixel(pixel);
- for (int i = 0; i < nbSample; i++) {
- double v = pixel[i];
- if (!Double.isFinite(v)) {
- //json do not want infinite or NaN
- arrays[i].values.add(null);
- } else {
- arrays[i].values.add(v);
- }
- }
- }
-
- return map;
- }
-
- private static Axe buildAxe(long gridLow, int gridSize, double scale, double offset, boolean asDate) {
- final Axe axe = new Axe();
- if (asDate) {
- axe.values = new ArrayList<>(gridSize);
- for (int i = 0; i < gridSize; i++) {
- Instant ofEpochMilli = Instant.ofEpochMilli((long) ((gridLow+i)*scale + offset));
- axe.values.add(DATE_TIME.format(ofEpochMilli));
- }
- } else {
- axe.num = gridSize;
- axe.start = gridLow*scale + offset;
- axe.stop = (gridLow+gridSize-1) * scale + offset;
- }
- return axe;
- }
-
- private static String toURI(CoordinateReferenceSystem crs) throws FactoryException, DataStoreException {
- String urn = IdentifiedObjects.lookupURN(crs, null);
- if (urn != null && !urn.isBlank()) return urn;
-
- final Integer code = IdentifiedObjects.lookupEPSG(crs);
- if (code == null) {
- if (crs instanceof org.opengis.referencing.crs.GeographicCRS) {
- /* Spec 9.5.1.1
- Note that sometimes (e.g. for numerical model data) the exact CRS
- may not be known or may be undefined. In this case the "id" may
- be omitted, but the "type" still indicates that this is a geographic CRS.
- Therefore clients can still use geodetic longitude, geodetic latitude
- (and maybe height) axes, even if they cannot accurately georeference the information.
- */
- return null;
- }
- throw new DataStoreException("Could not find EPSG code for CRS " + crs);
- }
- return "http://www.opengis.net/def/crs/EPSG/0/" + code;
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java
deleted file mode 100644
index 5df56371ef..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An axis object MUST have either a "values" member or, as a compact notation
- * for a regularly spaced numeric axis, have all the members "start", "stop",
- * and "num".
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"start","stop","num","dataType","coordinates","values","bounds"})
-public final class Axe extends Dictionary<Object> {
-
- public static final String DATATYPE_PRIMITIVE = "primitive";
- public static final String DATATYPE_TUPLE = "tuple";
- public static final String DATATYPE_POLYGON = "polygon";
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The values of "start" and "stop" MUST be numbers
- */
- public Double start;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The values of "start" and "stop" MUST be numbers
- */
- public Double stop;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * the value of "num" an integer greater than zero.
- *
- * If the value of "num" is 1, then "start" and "stop" MUST have identical
- * values. For num > 1, the array elements of "values" MAY be reconstructed
- * with the formula start + i * step where i is the ith element and in the
- * interval [0, num-1] and step = (stop - start) / (num - 1).
- *
- * If num = 1 then "values" is [start]. Note that "start" can be greater
- * than "stop" in which case the axis values are descending.
- */
- public Integer num;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The value of "dataType" determines the structure of an axis value and its
- * coordinates that are made available for referencing. The values of
- * "dataType" defined in this Community Standard are "primitive", "tuple",
- * and "polygon". Custom values MAY be used as detailed in the Extensions
- * section. For "primitive", there is a single coordinate identifier and
- * each axis value MUST be a number or string. For "tuple", each axis value
- * MUST be an array of fixed size of primitive values in a defined order,
- * where the tuple size corresponds to the number of coordinate identifiers.
- * For "polygon", each axis value MUST be a GeoJSON Polygon coordinate
- * array, where the order of coordinates is given by the "coordinates"
- * array.
- *
- * If missing, the member "dataType" defaults to "primitive" and MUST not be
- * included for that default case.
- *
- * If "dataType" is "primitive" and the associated reference system (see
- * 6.1.2) defines a natural ordering of values then the array values in
- * "values", if existing, MUST be ordered monotonically, that is, increasing
- * or decreasing.
- */
- public String dataType;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The value of "coordinates" is a non-empty array of coordinate identifiers
- * corresponding to the order of the coordinates defined by "dataType".
- *
- * If missing, the member "coordinates" defaults to a one-element array of
- * the axis identifier and MUST NOT be included for that default case.
- *
- * A coordinate identifier SHALL NOT be defined more than once in all axis
- * objects of a domain object.
- */
- public List<String> coordinates;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The value of "values" is a non-empty array of axis values.
- */
- public List<Object> values;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An axis object MAY have axis value bounds defined in the member "bounds"
- * where the value is an array of values of length len*2 with len being the
- * length of the "values" array. For each axis value at array index i in the
- * "values" array, a lower and upper bounding value at positions 2*i and
- * 2*i+1, respectively, are given in the bounds array.
- *
- * If a domain axis object has no "bounds" member then a bounds array MAY be
- * derived automatically.
- */
- public List<Object> bounds;
-
- public Axe() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Axe)) return false;
-
- final Axe cdt = ((Axe) other);
- return super.equals(other)
- && Objects.equals(start, cdt.start)
- && Objects.equals(stop, cdt.stop)
- && Objects.equals(num, cdt.num)
- && Objects.equals(dataType, cdt.dataType)
- && Objects.equals(coordinates, cdt.coordinates)
- && Objects.equals(values, cdt.values)
- && Objects.equals(bounds, cdt.bounds);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- start,
- stop,
- num,
- dataType,
- coordinates,
- values,
- bounds);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java
deleted file mode 100644
index 0ec47cb7db..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The "axes" member MUST NOT be empty.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"x","y","z","t"})
-public final class Axes extends Dictionary<Object> {
-
- public Axe x;
- public Axe y;
- public Axe z;
- public Axe t;
-
- public Axes() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Axes)) return false;
-
- final Axes cdt = ((Axes) other);
- return super.equals(other)
- && Objects.equals(x, cdt.x)
- && Objects.equals(y, cdt.y)
- && Objects.equals(y, cdt.y)
- && Objects.equals(t, cdt.t);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- x,
- y,
- z,
- t);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java
deleted file mode 100644
index c75c805bfc..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A category object MUST an "id" and a "label" member, and MAY have a
- * "description" member.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"id","label","description"})
-public final class Category extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The value of "id" MUST be a string and SHOULD be a common identifier.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The value of "label" MUST be an i18n object of the name of the
- * category and SHOULD be short.
- */
- public I18N label;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If given, the value of "description" MUST be an i18n object with a
- * textual description of the* category.
- */
- public I18N description;
-
- public Category() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Category)) return false;
-
- final Category cdt = ((Category) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(label, cdt.label)
- && Objects.equals(description, cdt.description);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- label,
- description);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java
deleted file mode 100644
index 09c7f49653..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.lang.reflect.Type;
-import java.util.Map;
-import jakarta.json.bind.annotation.JsonbTypeDeserializer;
-import jakarta.json.bind.annotation.JsonbTypeSerializer;
-import jakarta.json.bind.serializer.DeserializationContext;
-import jakarta.json.bind.serializer.JsonbDeserializer;
-import jakarta.json.bind.serializer.JsonbSerializer;
-import jakarta.json.bind.serializer.SerializationContext;
-import jakarta.json.stream.JsonGenerator;
-import jakarta.json.stream.JsonParser;
-import org.apache.sis.storage.coveragejson.binding.CategoryEncoding.Deserializer;
-import org.apache.sis.storage.coveragejson.binding.CategoryEncoding.Serializer;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * CategoryEncoding is an object where each key is equal to an "id" value of
- * the "categories" array within the "observedProperty" member of the
- * parameter object. There MUST be no duplicate keys. The value is either
- * an integer or an array of integers where each integer MUST be unique
- * within the object.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbTypeDeserializer(Deserializer.class)
-@JsonbTypeSerializer(Serializer.class)
-public final class CategoryEncoding extends Dictionary<Object> {
- public CategoryEncoding() {
- }
-
- public static class Deserializer implements JsonbDeserializer<CategoryEncoding> {
- public Deserializer() {
- }
-
- @Override
- public CategoryEncoding deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
- final CategoryEncoding candidate = new CategoryEncoding();
- while (parser.hasNext()) {
- final JsonParser.Event event = parser.next();
- if (event == JsonParser.Event.KEY_NAME) {
- // Deserialize inner object
- final String name = parser.getString();
- String value = ctx.deserialize(String.class, parser);
- candidate.setAnyProperty(name, value);
- }
- }
- return candidate;
- }
- }
-
- public static class Serializer implements JsonbSerializer<CategoryEncoding> {
- public Serializer() {
- }
-
- @Override
- public void serialize(CategoryEncoding ranges, JsonGenerator jg, SerializationContext sc) {
- jg.writeStartObject();
- for (Map.Entry<String,Object> entry : ranges.any.entrySet()) {
- sc.serialize(entry.getKey(), entry.getValue(), jg);
- }
- jg.writeEnd();
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java
deleted file mode 100644
index 435ee435cf..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.JsonbException;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-import jakarta.json.bind.serializer.DeserializationContext;
-import jakarta.json.bind.serializer.JsonbDeserializer;
-import jakarta.json.stream.JsonParser;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A CoverageJSON object with the type "Coverage" is a coverage object.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","domain","parameters","parameterGroups","ranges"})
-public final class Coverage extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If a coverage has a commonly used identifier, that identifier SHOULD be
- * included as a member of the coverage object with the name "id".
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage object MUST have a member with the name "domain" where the
- * value is either a domain object or a URL.
- *
- * If the value of "domain" is a URL and the referenced domain has a
- * "domainType" member, then the coverage object SHOULD have the member
- * "domainType" where the value MUST equal that of the referenced domain.
- *
- * If the coverage object is part of a coverage collection which has a
- * "domainType" member then that member SHOULD be omitted in the coverage
- * object.
- */
- //@JsonbTypeDeserializer(Coverage.DomainDeserializer.class)
- //TODO should be a Domain or an URL, DomainDeserializer not working as expected
- public Domain domain;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage object MAY have a member with the name "parameters" where the
- * value is an object where each member has as name a short identifier and
- * as value a parameter object. The identifier corresponds to the commonly
- * known concept of “variable name” and is merely used in clients for
- * conveniently accessing the corresponding range object.
- *
- * A coverage object MUST have a "parameters" member if the coverage object
- * is not part of a coverage collection or if the coverage collection does
- * not have a "parameters" member.
- */
- public Parameters parameters;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage object MAY have a member with the name "parameterGroups" where
- * the value is an array of ParameterGroup objects.
- */
- public List<ParameterGroup> parameterGroups;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage object MUST have a member with the name "ranges" where the
- * value is a range set object. Any member of a range set object has as
- * name any of the names in a "parameters" object in scope and as value
- * either an NdArray or TiledNdArray object or a URL resolving to a
- * CoverageJSON document of such object. A "parameters" member in scope is
- * either within the enclosing coverage object or, if part of a coverage
- * collection, in the parent coverage collection object. The shape and axis
- * names of each NdArray or TiledNdArray object MUST correspond to the
- * domain axes defined by "domain", while single-valued axes MAY be omitted.
- * If the referenced parameter object has a "categoryEncoding" member, then
- * each non-null array element of the "values" member of the NdArray object,
- * or the linked NdArray objects within a TiledNdArray object, MUST be equal
- * to one of the values defined in the "categoryEncoding" object and be
- * interpreted as the matching category.
- */
- public Ranges ranges;
-
- public Coverage() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Coverage)) return false;
-
- final Coverage cdt = ((Coverage) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(domain, cdt.domain)
- && Objects.equals(parameters, cdt.parameters)
- && Objects.equals(parameterGroups, cdt.parameterGroups)
- && Objects.equals(ranges, cdt.ranges);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- domain,
- parameters,
- parameterGroups,
- ranges);
- }
-
- public static class DomainDeserializer implements JsonbDeserializer<Object> {
- public DomainDeserializer() {
- }
-
- @Override
- public Object deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
- final JsonParser.Event event = parser.next();
- if (event == JsonParser.Event.START_OBJECT) {
- // Deserialize inner object
- return ctx.deserialize(Domain.class, parser);
- } else if (event == JsonParser.Event.VALUE_STRING) {
- return parser.getString();
- } else {
- throw new JsonbException("Unexpected json element");
- }
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java
deleted file mode 100644
index decbb37efc..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A CoverageJSON object with the type "CoverageCollection" is a coverage collection object.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","domainType","parameters","parameterGroups","referencing","coverages"})
-public final class CoverageCollection extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage collection object MAY have the member "domainType" with a
- * string value to indicate that the coverage collection only contains
- * coverages of the given domain type. See the section Common Domain Types
- * for details. Custom domain types may be used as recommended in the
- * section Extensions.
- *
- * If a coverage collection object has the member "domainType", then this
- * member is inherited to all included coverages.
- */
- public String domainType;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage collection object MAY have a member with the name "parameters"
- * where the value is an object where each member has as name a short
- * identifier and as value a parameter object.
- */
- public Parameter parameters;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage collection object MAY have a member with the name
- * "parameterGroups" where the value is an array of ParameterGroup objects.
- */
- public List<ParameterGroup> parameterGroups;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage collection object MAY have a member with the name "referencing"
- * where the value is an array of reference system connection objects.
- */
- public List<ReferenceSystemConnection> referencing;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A coverage collection object MUST have a member with the name "coverages".
- * The value corresponding to "coverages" is an array. Each element in the
- * array is a coverage object as defined above.
- */
- public List<Coverage> coverages;
-
- public CoverageCollection() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof CoverageCollection)) return false;
-
- final CoverageCollection cdt = ((CoverageCollection) other);
- return super.equals(other)
- && Objects.equals(domainType, cdt.domainType)
- && Objects.equals(parameters, cdt.parameters)
- && Objects.equals(coverages, cdt.coverages)
- && Objects.equals(parameterGroups, cdt.parameterGroups)
- && Objects.equals(referencing, cdt.referencing);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- domainType,
- coverages,
- parameters,
- parameterGroups,
- referencing);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java
deleted file mode 100644
index a2624aa3df..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import jakarta.json.bind.annotation.JsonbSubtype;
-import jakarta.json.bind.annotation.JsonbTypeInfo;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A CoverageJSON document can be extended with custom members and types in a
- * robust and interoperable way. For that, it makes use of absolute URIs and
- * compact URIs (prefix:suffix) in order to avoid conflicts with other extensions
- * and future versions of the format. A central registry of compact URI prefixes
- * is provided which anyone can extend and which is a simple mapping from compact
- * URI prefix to namespace URI in order to avoid collisions with other extensions
- * that are based on compact URIs as well. Extensions that do not follow this
- * approach MAY use simple names instead of absolute or compact URIs but have to
- * accept the consequence of the document being less interoperable and future-proof.
- * In certain use cases this is not an issue and may be a preferred solution for
- * simplicity reasons, for example, if such CoverageJSON documents are only used
- * internally and are not meant to be shared to a wider audience.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbTypeInfo ( key = "type",value = {
- @JsonbSubtype(alias = "Coverage", type = Coverage.class),
- @JsonbSubtype(alias = "CoverageCollection", type = CoverageCollection.class),
- @JsonbSubtype(alias = "Domain", type = Domain.class),
- @JsonbSubtype(alias = "NdArray", type = NdArray.class),
- @JsonbSubtype(alias = "Parameter", type = Parameter.class),
- @JsonbSubtype(alias = "ParameterGroup", type = ParameterGroup.class),
-
- //system subtypes
- @JsonbSubtype(alias = "GeographicCRS", type = GeographicCRS.class),
- @JsonbSubtype(alias = "ProjectedCRS", type = ProjectedCRS.class),
- @JsonbSubtype(alias = "IdentifierRS", type = IdentifierRS.class),
- @JsonbSubtype(alias = "VerticalCRS", type = VerticalCRS.class),
- @JsonbSubtype(alias = "TemporalRS", type = TemporalRS.class)
-})
-public class CoverageJsonObject extends Dictionary<Object> {
- public CoverageJsonObject() {
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java
deleted file mode 100644
index 2d410a80bc..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import jakarta.json.bind.Jsonb;
-import jakarta.json.bind.JsonbBuilder;
-import jakarta.json.bind.annotation.JsonbTransient;
-
-
-/**
- * @author Johann Sorel (Geomatys)
- */
-public class Dictionary<T> {
-
- /**
- * could be anything.
- * TODO find how to cath any other property as in Jackson @JsonAnyGetter and Johnzon @JohnzonAny
- */
- @JsonbTransient
- public final LinkedHashMap<String, T> any;
-
- public Dictionary() {
- any = new LinkedHashMap<>();
- }
-
- public final Map<String, T> getAny() {
- return this.any;
- }
-
- public final void setAnyProperty(String name, T value) {
- this.any.put(name, value);
- }
-
- @Override
- public String toString() {
- try (Jsonb jsonb = JsonbBuilder.create()) {
- return jsonb.toJson(this);
- } catch (Exception ex) {
- ex.printStackTrace();
- return getClass().getName() + " : to_string_exception" + ex.getMessage();
- }
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Dictionary<?>)) return false;
-
- final var cdt = ((Dictionary<?>) other);
- return any.equals(cdt.any);
- }
-
- @Override
- public int hashCode() {
- return any.hashCode();
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java
deleted file mode 100644
index 31ed0a64e9..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A domain object is a CoverageJSON object which defines a set of positions and
- * their extent in one or more referencing systems.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","domainType","axes","referencing"})
-public final class Domain extends CoverageJsonObject {
-
- public static final String DOMAINTYPE_GRID = "Grid";
- public static final String DOMAINTYPE_VERTICALPROFILE = "VerticalProfile";
- public static final String DOMAINTYPE_POINTSERIES = "PointSeries";
- public static final String DOMAINTYPE_POINT = "Point";
- public static final String DOMAINTYPE_MULTIPOINTSERIES = "MultiPointSeries";
- public static final String DOMAINTYPE_MULTIPOINT = "MultiPoint";
- public static final String DOMAINTYPE_POLYGONSERIES = "PolygonSeries";
- public static final String DOMAINTYPE_POLYGON = "Polygon";
- public static final String DOMAINTYPE_MULTIPOLYGONSERIES = "MultiPolygonSeries";
- public static final String DOMAINTYPE_MULTIPOLYGON = "MultiPolygon";
- public static final String DOMAINTYPE_TRAJECTORY = "Trajectory";
- public static final String DOMAINTYPE_SECTION = "Section";
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * For interoperability reasons it is RECOMMENDED that a domain object has
- * the member "domainType" with a string value to indicate that the domain
- * follows a certain structure (e.g. a time series, a vertical profile, a
- * spatio-temporal 4D grid). See the section Common Domain Types for details.
- * Custom domain types may be used as recommended in the section Extensions.
- */
- public String domainType;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A domain object MUST have the member "axes" which has as value an object
- * where each key is an axis identifier and each value an axis object as defined below.
- */
- public Axes axes;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A domain object MAY have the member "referencing" where the value is an
- * array of reference system connection objects as defined below.
- *
- * A domain object MUST have a "referencing" member if the domain object is
- * not part of a coverage collection or if the coverage collection does not
- * have a "referencing" member.
- */
- public List<ReferenceSystemConnection> referencing;
-
- public Domain() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Domain)) return false;
-
- final Domain cdt = ((Domain) other);
- return super.equals(other)
- && Objects.equals(domainType, cdt.domainType)
- && Objects.equals(axes, cdt.axes)
- && Objects.equals(referencing, cdt.referencing);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- domainType,
- axes,
- referencing);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java
deleted file mode 100644
index f88f625fd6..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * Geographic CRSs anchor coordinate values to an ellipsoidal approximation of
- * the Earth. They have coordinate axes of geodetic longitude and geodetic
- * latitude, and perhaps height above the ellipsoid (i.e. they can be two- or three-dimensional).
- * The origin of the CRS is on the surface of the ellipsoid.
- *
- * Note that sometimes (e.g. for numerical model data) the exact CRS may not be
- * known or may be undefined. In this case the "id" may be omitted, but the "type"
- * still indicates that this is a geographic CRS. Therefore clients can still use
- * geodetic longitude, geodetic latitude (and maybe height) axes, even if they
- * cannot accurately georeference the information.
- * If a Coverage conforms to one of the defined domain types then the coordinate
- * identifier "x" is used to denote geodetic longitude, "y" is used for geodetic
- * latitude and "z" for ellipsoidal height.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","description"})
-public final class GeographicCRS extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The object MAY have an "id" member, whose value MUST be a string and
- * SHOULD be a common identifier for the reference system.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The object MAY have a "description" member, where the value MUST be an
- * i18n object, but no standardized content is interpreted from this description.
- */
- public I18N description;
-
- public GeographicCRS() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof GeographicCRS)) return false;
-
- final GeographicCRS cdt = ((GeographicCRS) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(description, cdt.description);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- description);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java
deleted file mode 100644
index 04905ae3c6..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.lang.reflect.Type;
-import java.util.Locale;
-import java.util.Map;
-import jakarta.json.bind.annotation.JsonbTypeDeserializer;
-import jakarta.json.bind.annotation.JsonbTypeSerializer;
-import jakarta.json.bind.serializer.DeserializationContext;
-import jakarta.json.bind.serializer.JsonbDeserializer;
-import jakarta.json.bind.serializer.JsonbSerializer;
-import jakarta.json.bind.serializer.SerializationContext;
-import jakarta.json.stream.JsonGenerator;
-import jakarta.json.stream.JsonParser;
-import org.opengis.util.InternationalString;
-import org.apache.sis.storage.coveragejson.binding.I18N.Serializer;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The special language tag "und" can be used to identify a value whose language
- * is unknown or undetermined.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbTypeDeserializer(I18N.Deserializer.class)
-@JsonbTypeSerializer(Serializer.class)
-public final class I18N extends Dictionary<String> implements InternationalString {
-
- public static final String UNDETERMINED = "und";
-
- public I18N() {
- }
-
- public I18N(String lang, String text) {
- setAnyProperty(lang, text);
- }
-
- private String getDefault() {
- String str = any.get(UNDETERMINED);
- if (str == null && !any.isEmpty()) str = any.get(any.keySet().iterator().next());
- if (str == null) str = "";
- return str;
- }
-
- public String toString() {
- return getDefault();
- }
-
- @Override
- public String toString(Locale locale) {
- String str = any.get(locale.getLanguage());
- if (str == null) str = any.get(locale.getISO3Language());
- return getDefault();
- }
-
- @Override
- public int length() {
- return getDefault().length();
- }
-
- @Override
- public char charAt(int index) {
- return getDefault().charAt(index);
- }
-
- @Override
- public CharSequence subSequence(int start, int end) {
- return getDefault().subSequence(start, end);
- }
-
- @Override
- public int compareTo(InternationalString o) {
- return getDefault().compareTo(o.toString());
- }
-
- public static class Deserializer implements JsonbDeserializer<I18N> {
- public Deserializer() {
- }
-
- @Override
- public I18N deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
- final I18N candidate = new I18N();
- while (parser.hasNext()) {
- final JsonParser.Event event = parser.next();
- if (event == JsonParser.Event.KEY_NAME) {
- // Deserialize inner object
- final String name = parser.getString();
- String value = ctx.deserialize(String.class, parser);
- candidate.setAnyProperty(name, value);
- }
- }
- return candidate;
- }
- }
-
- public static class Serializer implements JsonbSerializer<I18N> {
- public Serializer() {
- }
-
- @Override
- public void serialize(I18N ranges, JsonGenerator jg, SerializationContext sc) {
- jg.writeStartObject();
- for (Map.Entry<String,String> entry : ranges.any.entrySet()) {
- jg.write(entry.getKey(), entry.getValue());
- }
- jg.writeEnd();
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java
deleted file mode 100644
index a418b23f27..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * Identifier-based reference systems (identifier RS) .
- *
- * Coordinate values associated with an identifier RS MUST be strings.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","label","description","targetConcept","identifiers"})
-public final class IdentifierRS extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An identifier RS object MAY have a member "id" where the value MUST be a
- * string and SHOULD be a common identifier for the reference system.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An identifier RS object MAY have a member "label" where the value MUST be
- * an i18n object that is the name of the reference system.
- */
- public I18N label;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An identifier RS object MAY have a member "description" where the value
- * MUST be an i18n object that is the (perhaps lengthy) description of the
- * reference system.
- */
- public I18N description;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An identifier RS object MUST have a member "targetConcept"
- */
- public TargetConcept targetConcept;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An identifier RS object MAY have a member "identifiers".
- */
- public Identifiers identifiers;
-
- public IdentifierRS() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof IdentifierRS)) return false;
-
- final IdentifierRS cdt = ((IdentifierRS) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(label, cdt.label)
- && Objects.equals(description, cdt.description)
- && Objects.equals(targetConcept, cdt.targetConcept)
- && Objects.equals(identifiers, cdt.identifiers);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- label,
- description,
- targetConcept,
- identifiers);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java
deleted file mode 100644
index daec78fc6b..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An identifier RS object MAY have a member "identifiers" where the value is
- * an object where each key is an identifier referenced by the identifier RS
- * and each value an object describing the referenced concept, equal to "targetConcept".
- *
- * @author Johann Sorel (Geomatys)
- */
-public final class Identifiers extends Dictionary<TargetConcept> {
- public Identifiers() {
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java
deleted file mode 100644
index 197030b6ac..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A CoverageJSON object with the type "NdArray" is an NdArray object.
- * It represents a multidimensional (>= 0D) array with named axes, encoded as a
- * flat, one-dimensional JSON array in row-major order.
- *
- * Note that common JSON implementations use IEEE 754-2008 64-bit
- * (double precision) floating point numbers as the data type for "values". Users
- * SHOULD be aware of the limitations in precision when encoding numbers in this way.
- * For example, when encoding integers, users SHOULD be aware that only values
- * within the range [-253+1, 253-1] can be represented in a way that will ensure
- * exact interoperability among such implementations [IETF RFC 7159].
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","dataType","axisNames","shape","values"})
-public final class NdArray extends CoverageJsonObject {
-
- public static final String DATATYPE_FLOAT = "float";
- public static final String DATATYPE_INTEGER = "integer";
- public static final String DATATYPE_STRING = "string";
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An NdArray object MUST have a member with the name "dataType" where the
- * value is either "float", "integer", or "string" and MUST correspond to
- * the data type of the non-null values in the "values" array.
- */
- public String dataType;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An NdArray object MAY have a member with the name "axisNames" where the
- * value is an array of strings of the same length as "shape", such that
- * each string assigns a name to the corresponding dimension. For 0D arrays,
- * "axisNames" MAY be omitted (defaulting to []). For >= 1D arrays it MUST
- * be included.
- */
- public String[] axisNames;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An NdArray object MAY have a member with the name "shape" where the value
- * is an array of integers. For 0D arrays, "shape" MAY be omitted
- * (defaulting to []). For >= 1D arrays it MUST be included.
- *
- * Where "shape" is present and non-empty, the product of its values MUST
- * equal the number of elements in the "values" array.
- */
- public int[] shape;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * An NdArray object MUST have a member with the name "values" where the
- * value is a non-empty array of numbers and nulls, or strings and nulls,
- * where nulls represent missing data.
- *
- * Zero-dimensional NdArrays MUST have exactly one item in the "values" array.
- *
- * Within the "values" array, the elements MUST be ordered such that the
- * last dimension in "axisNames" varies fastest, i.e. row-major order.
- * (This mimics the approach taken in NetCDF; see the example below.)
- */
- public List<Object> values; //because of null and string values
-
- public NdArray() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof NdArray)) return false;
-
- final NdArray cdt = ((NdArray) other);
- return super.equals(other)
- && Objects.equals(dataType, cdt.dataType)
- && Arrays.equals(axisNames, cdt.axisNames)
- && Arrays.equals(shape, cdt.shape)
- && Objects.equals(values, cdt.values);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- dataType,
- Arrays.hashCode(axisNames),
- Arrays.hashCode(shape),
- values);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java
deleted file mode 100644
index 3eee91a537..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * Observed property is an object which MUST have the member "label" and which
- * MAY have the members "id", "description", and "categories".
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"id","label","description","categories"})
-public final class ObservedProperty extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If given, the value of "id" MUST be a string and SHOULD be a common
- * identifier.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The value of "label" MUST be an i18n object that is the name of the
- * observed property and which SHOULD be short.
- */
- public I18N label;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If given, the value of "description" MUST be an i18n object with a
- * textual description of the observed property.
- */
- public I18N description;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If given, the value of "categories" MUST be a non-empty array of category
- * objects.
- */
- public List<Category> categories;
-
- public ObservedProperty() {
- }
-
- public ObservedProperty(String id, I18N label, I18N description, List<Category> categories) {
- this.id = id;
- this.label = label;
- this.description = description;
- this.categories = categories;
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof ObservedProperty)) return false;
-
- final ObservedProperty cdt = ((ObservedProperty) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(label, cdt.label)
- && Objects.equals(description, cdt.description)
- && Objects.equals(categories, cdt.categories);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- label,
- description,
- categories);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java
deleted file mode 100644
index bf83f26a30..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MAY have any number of members (name/value pairs).
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","label","description","unit","observedProperty","categoryEncoding"})
-public final class Parameter extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MAY have a member with the name "id" where the value
- * MUST be a string and SHOULD be a common identifier.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MAY have a member with the name "label" where the value
- * MUST be an i18n object that is the name of the parameter and which SHOULD be short.
- * Note that this SHOULD be left out if it would be identical to the "label"
- * of the "observedProperty" member.
- */
- public I18N label;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MAY have a member with the name "description" where
- * the value MUST be an i18n object which is a, perhaps lengthy, textual
- * description of the parameter.
- */
- public I18N description;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MAY have a member with the name "unit".
- * A parameter object MUST NOT have a "unit" member if the "observedProperty"
- * member has a "categories" member.
- */
- public Unit unit;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MUST have a member with the name "observedProperty".
- */
- public ObservedProperty observedProperty;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter object MAY have a member with the name "categoryEncoding".
- */
- public CategoryEncoding categoryEncoding;
-
- public Parameter() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Parameter)) return false;
-
- final Parameter cdt = ((Parameter) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(label, cdt.label)
- && Objects.equals(description, cdt.description)
- && Objects.equals(unit, cdt.unit)
- && Objects.equals(observedProperty, cdt.observedProperty)
- && Objects.equals(categoryEncoding, cdt.categoryEncoding);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- label,
- description,
- unit,
- observedProperty,
- categoryEncoding);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java
deleted file mode 100644
index 6ec5f23d04..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Arrays;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter group object MUST have either or both the members "label" or/and "observedProperty".
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","label","description","observedProperty","members"})
-public final class ParameterGroup extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter group object MAY have a member with the name "id" where the
- * value MUST be a string and SHOULD be a common identifier.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter group object MAY have a member with the name "label" where
- * the value MUST be an i18n object that is the name of the parameter group
- * and which SHOULD be short. Note that this SHOULD be left out if it would
- * be identical to the "label" of the "observedProperty" member.
- */
- public I18N label;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter group object MAY have a member with the name "description"
- * where the value MUST be an i18n object which is a, perhaps lengthy,
- * textual description of the parameter group.
- */
- public String description;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A parameter group object MAY have a member with the name "observedProperty"
- * where the value is an object as specified for parameter objects.
- */
- public ObservedProperty observedProperty;
-
- /**
- * A parameter group object MUST have a member with the name "members"
- * where the value is a non-empty array of parameter identifiers
- * (see 6.3 Coverage objects).
- */
- public String[] members;
-
- public ParameterGroup() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof ParameterGroup)) return false;
-
- final ParameterGroup cdt = ((ParameterGroup) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(label, cdt.label)
- && Objects.equals(description, cdt.description)
- && Objects.equals(observedProperty, cdt.observedProperty)
- && Arrays.equals(members, cdt.members);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- label,
- description,
- observedProperty,
- Arrays.hashCode(members));
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java
deleted file mode 100644
index 999b2791db..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.lang.reflect.Type;
-import java.util.Map;
-import jakarta.json.bind.annotation.JsonbTypeDeserializer;
-import jakarta.json.bind.annotation.JsonbTypeSerializer;
-import jakarta.json.bind.serializer.DeserializationContext;
-import jakarta.json.bind.serializer.JsonbDeserializer;
-import jakarta.json.bind.serializer.JsonbSerializer;
-import jakarta.json.bind.serializer.SerializationContext;
-import jakarta.json.stream.JsonGenerator;
-import jakarta.json.stream.JsonParser;
-import jakarta.json.stream.JsonParser.Event;
-import org.apache.sis.storage.coveragejson.binding.Parameters.Deserializer;
-import org.apache.sis.storage.coveragejson.binding.Parameters.Serializer;
-
-
-/**
- * Contains a map of parameter objects.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbTypeDeserializer(Deserializer.class)
-@JsonbTypeSerializer(Serializer.class)
-public final class Parameters extends Dictionary<Parameter> {
- public Parameters() {
- }
-
- public static class Deserializer implements JsonbDeserializer<Parameters> {
- public Deserializer() {
- }
-
- @Override
- public Parameters deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
- final Parameters parameters = new Parameters();
- while (parser.hasNext()) {
- final Event event = parser.next();
- if (event == JsonParser.Event.KEY_NAME) {
- // Deserialize inner object
- final String name = parser.getString();
- final Parameter value = ctx.deserialize(Parameter.class, parser);
- parameters.setAnyProperty(name, value);
- }
- }
- return parameters;
- }
- }
-
- public static class Serializer implements JsonbSerializer<Parameters> {
- public Serializer() {
- }
-
- @Override
- public void serialize(Parameters parameters, JsonGenerator jg, SerializationContext sc) {
- jg.writeStartObject();
- for (Map.Entry<String,Parameter> entry : parameters.any.entrySet()) {
- sc.serialize(entry.getKey(), entry.getValue(), jg);
- }
- jg.writeEnd();
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java
deleted file mode 100644
index 0b156891f0..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * Projected CRSs use two coordinates to denote positions on a Cartesian plane,
- * which is derived from projecting the ellipsoid according to some defined transformation.
- *
- * If a Coverage conforms to one of the defined domain types then the coordinate
- * identifier "x" is used to denote easting and "y" is used for northing.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","description"})
-public final class ProjectedCRS extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The object MAY have an "id" member, whose value MUST be a string and
- * SHOULD be a common identifier for the reference system.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The object MAY have a "description" member, where the value MUST be an
- * i18n object, but no standardized content is interpreted from this description.
- */
- public I18N description;
-
- public ProjectedCRS() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof ProjectedCRS)) return false;
-
- final ProjectedCRS cdt = ((ProjectedCRS) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(description, cdt.description);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- description);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java
deleted file mode 100644
index 6e16a9e1bf..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.lang.reflect.Type;
-import java.util.Map.Entry;
-import jakarta.json.bind.annotation.JsonbTypeDeserializer;
-import jakarta.json.bind.annotation.JsonbTypeSerializer;
-import jakarta.json.bind.serializer.DeserializationContext;
-import jakarta.json.bind.serializer.JsonbDeserializer;
-import jakarta.json.bind.serializer.JsonbSerializer;
-import jakarta.json.bind.serializer.SerializationContext;
-import jakarta.json.stream.JsonGenerator;
-import jakarta.json.stream.JsonParser;
-
-
-/**
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbTypeDeserializer(Ranges.Deserializer.class)
-@JsonbTypeSerializer(Ranges.Serializer.class)
-public final class Ranges extends Dictionary<NdArray> {
- public Ranges() {
- }
-
- public static class Deserializer implements JsonbDeserializer<Ranges> {
- public Deserializer() {
- }
-
- @Override
- public Ranges deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
- final Ranges candidate = new Ranges();
- while (parser.hasNext()) {
- final JsonParser.Event event = parser.next();
- if (event == JsonParser.Event.KEY_NAME) {
- // Deserialize inner object
- final String name = parser.getString();
- final NdArray value = ctx.deserialize(NdArray.class, parser);
- candidate.setAnyProperty(name, value);
- }
- }
- return candidate;
- }
- }
-
- public static class Serializer implements JsonbSerializer<Ranges> {
- public Serializer() {
- }
-
- @Override
- public void serialize(Ranges ranges, JsonGenerator jg, SerializationContext sc) {
- jg.writeStartObject();
- for (Entry<String,NdArray> entry : ranges.any.entrySet()) {
- sc.serialize(entry.getKey(), entry.getValue(), jg);
- }
- jg.writeEnd();
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java
deleted file mode 100644
index 35e17c7fc6..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.List;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A reference system connection object creates a link between values within
- * domain axes and a reference system to be able to interpret those values, e.g.
- * as coordinates in a certain coordinate reference system.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"coordinates","system"})
-public final class ReferenceSystemConnection extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A reference system connection object MUST have a member "coordinates"
- * which has as value an array of coordinate identifiers that are referenced
- * in this object. Depending on the type of referencing, the ordering of the
- * identifiers MAY be relevant, e.g. for 2D/3D coordinate reference systems.
- * In this case, the order of the identifiers MUST match the order of axes
- * in the coordinate reference system.
- */
- public List<String> coordinates;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A reference system connection object MUST have a member "system" whose
- * value MUST be a Reference System Object.
- */
- public CoverageJsonObject system;
-
- public ReferenceSystemConnection() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof ReferenceSystemConnection)) return false;
-
- final ReferenceSystemConnection cdt = ((ReferenceSystemConnection) other);
- return super.equals(other)
- && Objects.equals(system, cdt.system)
- && Objects.equals(coordinates, cdt.coordinates);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- system,
- coordinates);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java
deleted file mode 100644
index c7f1c4d7e6..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"value","type"})
-public final class Symbol extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * "value" is the symbolic unit notation
- */
- public String value;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * "type" references the unit serialization scheme that is used. "type" MUST
- * HAVE the value "http://www.opengis.net/def/uom/UCUM/" if UCUM is used, or
- * a custom value as recommended in section Extensions.
- */
- public String type;
-
- public Symbol() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Symbol)) return false;
-
- final Symbol cdt = ((Symbol) other);
- return super.equals(other)
- && Objects.equals(value, cdt.value)
- && Objects.equals(type, cdt.type);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- value,
- type);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java
deleted file mode 100644
index ac777633ce..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * TargetConcept is an object that MUST have a member "label" and MAY have a member
- * "description" where the value of each MUST be an i18n object that is the
- * name or description, respectively, of the concept which is referenced in the system.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"label","description"})
-public final class TargetConcept extends Dictionary<Object> {
-
- public I18N label;
- public I18N description;
-
- public TargetConcept() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof TargetConcept)) return false;
-
- final TargetConcept cdt = ((TargetConcept) other);
- return super.equals(other)
- && Objects.equals(label, cdt.label)
- && Objects.equals(description, cdt.description);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- label,
- description);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java
deleted file mode 100644
index 3952e78ced..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * Time is referenced by a temporal reference system (temporal RS). In the current
- * version of this Community Standard, only a string-based notation for time
- * values is defined. Future versions of this Community Standard may allow for
- * alternative notations, such as recording time values as numeric offsets from
- * a given temporal datum (e.g. “days since 1970-01-01”).
- *
- * If the calendar is based on years, months, days, then the referenced values
- * SHOULD use one of the following ISO8601-based lexical representations:
- * YYYY
- * ±XYYYY (where X stands for extra year digits)
- * YYYY-MM
- * YYYY-MM-DD
- * YYYY-MM-DDTHH:MM:SS[.F]Z where Z is either “Z” or a time scale offset +|-HH:MM
- *
- * If calendar dates with reduced precision are used in a lexical representation
- * (e.g. "2016"), then a client SHOULD interpret those dates in that reduced precision.
- *
- * If "type" is "TemporalRS" and "calendar" is "Gregorian", then the above lexical
- * representation MUST be used.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","calendar","timeScale"})
-public final class TemporalRS extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A temporal RS object MUST have a member "calendar" with value "Gregorian" or a URI.
- * If the Gregorian calendar is used, then "calendar" MUST have the value "Gregorian" and cannot be a URI.
- */
- public String calendar;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A temporal RS object MAY have a member "timeScale" with a URI as value.
- * If omitted, the time scale defaults to "UTC". If the time scale is UTC,
- * the "timeScale" member MUST be omitted.
- */
- public String timeScale;
-
- public TemporalRS() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof TemporalRS)) return false;
-
- final TemporalRS cdt = ((TemporalRS) other);
- return super.equals(other)
- && Objects.equals(calendar, cdt.calendar)
- && Objects.equals(timeScale, cdt.timeScale);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- calendar,
- timeScale);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java
deleted file mode 100644
index ba93b12cf3..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Arrays;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"tileShape","urlTemplate"})
-public final class TileSet extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A TileSet object MUST have a member with the name "tileShape" where
- * the value is an array of the same length as "shape" and where each
- * array element is either null or an integer lower or equal than the
- * corresponding element in "shape". A null value denotes that the axis
- * is not tiled.
- */
- public Integer[] tileShape;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A TileSet object MUST have a member with the name "urlTemplate" where
- * the value is a Level 1 URI template as defined in RFC 6570 .
- * The URI template MUST contain a variable for each axis name whose
- * corresponding element in "tileShape" is not null. A variable for an
- * axis of total size totalSize (from "shape") and tile size tileSize
- * (from "tileShape") has as value one of the integers 0, 1, …, q + r - 1
- * where q and r are the quotient and remainder obtained by dividing
- * totalSize by tileSize. Each URI that can be generated from the URI
- * template MUST resolve to an NdArray CoverageJSON document where the
- * members "dataType" and "axisNames`" are identical to the ones of the
- * TiledNdArray object, and where each value of `"shape" is an integer
- * equal, or lower if an edge tile, to the corresponding element in
- * "tileShape" while replacing null with the corresponding element of
- * "shape" of the TiledNdArray.
- */
- public String urlTemplate;
-
- public TileSet() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof TileSet)) return false;
-
- final TileSet cdt = ((TileSet) other);
- return super.equals(other)
- && Objects.equals(urlTemplate, cdt.urlTemplate)
- && Arrays.equals(tileShape, cdt.tileShape);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- urlTemplate,
- Arrays.hashCode(tileShape));
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java
deleted file mode 100644
index 76b55c7fff..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Arrays;
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A CoverageJSON object with the type "TiledNdArray" is a TiledNdArray object.
- * It represents a multidimensional (>= 1D) array with named axes that is split
- * up into sets of linked NdArray documents. Each tileset typically covers a
- * specific data access scenario, for example, loading a single time slice of a
- * grid vs. loading a time series of a spatial subset of a grid.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"dataType","shape","axisNames","tileSets"})
-public final class TiledNdArray extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A TiledNdArray object MUST have a member with the name "dataType" where
- * the value is either "float", "integer", or "string".
- */
- public String dataType;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A TiledNdArray object MUST have a member with the name "shape" where the
- * value is a non-empty array of integers.
- */
- public int[] shape;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A TiledNdArray object MUST have a member with the name "axisNames" where
- * the value is a string array of the same length as "shape".
- */
- public String[] axisNames;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A TiledNdArray object MUST have a member with the name "tileSets" where
- * the value is a non-empty array of TileSet objects.
- */
- public TileSet[] tileSets;
-
- public TiledNdArray() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof TiledNdArray)) return false;
-
- final TiledNdArray cdt = ((TiledNdArray) other);
- return super.equals(other)
- && Objects.equals(dataType, cdt.dataType)
- && Arrays.equals(shape, cdt.shape)
- && Arrays.equals(axisNames, cdt.axisNames)
- && Arrays.equals(tileSets, cdt.tileSets);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- dataType,
- Arrays.hashCode(shape),
- Arrays.hashCode(axisNames),
- Arrays.hashCode(tileSets));
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java
deleted file mode 100644
index 87b9490339..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * A "unit" where the value is an object which MUST have either or both the members
- * "label" or/and "symbol".
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"id","label","symbol"})
-public final class Unit extends Dictionary<Object> {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * MAY have the member "id".
- * If given, the value of "id" MUST be a string and
- * SHOULD be a common identifier. It is RECOMMENDED to reference a unit
- * serialization scheme to allow automatic unit conversion.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If given, the value of "label" MUST be an i18n object of the name of
- * the unit and SHOULD be short.
- */
- public I18N label;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * If given, the value of "symbol" MUST either be a string of the symbolic notation of the unit,
- * or an object with the members "value" and "type".
- */
- public Object symbol;
-
- public Unit() {
- }
-
- public Unit(String id, I18N label, Object symbol) {
- this.id = id;
- this.label = label;
- this.symbol = symbol;
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof Unit)) return false;
-
- final Unit cdt = ((Unit) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(label, cdt.label)
- && Objects.equals(symbol, cdt.symbol);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- label,
- symbol);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java
deleted file mode 100644
index 43b90e7f42..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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 anz "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.coveragejson.binding;
-
-import java.util.Objects;
-import jakarta.json.bind.annotation.JsonbNillable;
-import jakarta.json.bind.annotation.JsonbPropertyOrder;
-
-
-/**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * Vertical CRSs use a single coordinate to denote some measure of height or depth,
- * usually approximately oriented with gravity.
- *
- * @author Johann Sorel (Geomatys)
- */
-@JsonbNillable(false)
-@JsonbPropertyOrder({"type","id","description"})
-public final class VerticalCRS extends CoverageJsonObject {
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The object MAY have an "id" member, whose value MUST be a string and
- * SHOULD be a common identifier for the reference system.
- */
- public String id;
-
- /**
- * COPIED FROM OGC SPECIFICATION (TODO: ADAPT):
- * The object MAY have a "description" member, where the value MUST be an
- * i18n object, but no standardised content is interpreted from this description.
- */
- public I18N description;
-
- public VerticalCRS() {
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) return true;
- if (!(other instanceof VerticalCRS)) return false;
-
- final VerticalCRS cdt = ((VerticalCRS) other);
- return super.equals(other)
- && Objects.equals(id, cdt.id)
- && Objects.equals(description, cdt.description);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + Objects.hash(
- id,
- description);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/package-info.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/package-info.java
deleted file mode 100644
index eee2eb8dfb..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * JSON bindings.
- *
- * @author Johann Sorel (Geomatys)
- */
-package org.apache.sis.storage.coveragejson.binding;
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/package-info.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/package-info.java
deleted file mode 100644
index 6447b3548d..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * CoverageJSON store.
- *
- * @author Johann Sorel (Geomatys)
- */
-package org.apache.sis.storage.coveragejson;
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java
deleted file mode 100644
index 8a358d4462..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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.coveragejson;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import org.opengis.util.FactoryException;
-import org.opengis.metadata.spatial.DimensionNameType;
-import org.apache.sis.coverage.grid.GridCoverage;
-import org.apache.sis.coverage.grid.GridCoverageBuilder;
-import org.apache.sis.coverage.grid.GridExtent;
-import org.apache.sis.coverage.grid.GridGeometry;
-import org.apache.sis.coverage.grid.GridOrientation;
-import org.apache.sis.storage.Aggregate;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.storage.MemoryGridCoverageResource;
-import org.apache.sis.storage.Resource;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.WritableAggregate;
-import org.apache.sis.referencing.CRS;
-import org.apache.sis.referencing.CommonCRS;
-
-// Test dependencies
-import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.*;
-
-
-/**
- *
- * @author Johann Sorel (Geomatys)
- */
-public class CoverageJsonStoreTest {
- public CoverageJsonStoreTest() {
- }
-
- /**
- * Test coverage example from https://covjson.org/playground/.
- */
- @Test
- public void testReadCoverageXYZT() throws DataStoreException, FactoryException {
- try (final DataStore store = new CoverageJsonStoreProvider().open(new StorageConnector(CoverageJsonStoreTest.class.getResource("coverage_xyzt.json")))) {
-
- //test grid coverage resource exist
- assertTrue(store instanceof Aggregate);
- final Aggregate aggregate = (Aggregate) store;
- assertEquals(1, aggregate.components().size());
- final Resource candidate = aggregate.components().iterator().next();
- assertTrue(candidate instanceof GridCoverageResource);
- final GridCoverageResource gcr = (GridCoverageResource) candidate;
-
- { //test grid geometry
- final GridGeometry result = gcr.getGridGeometry();
-
- assertEquals(4, result.getDimension());
-
- final GridExtent expectedExtent = new GridExtent(new DimensionNameType[]{
- DimensionNameType.valueOf("x"),
- DimensionNameType.valueOf("y"),
- DimensionNameType.valueOf("z"),
- DimensionNameType.valueOf("t")},
- new long[]{0,0,0,0}, new long[]{2,1,0,0}, true);
- assertEquals(expectedExtent, result.getExtent());
- assertEquals(CRS.compound(CommonCRS.WGS84.geographic3D(), CommonCRS.Temporal.JAVA.crs()), result.getCoordinateReferenceSystem());
- //TODO test transform
- }
-
- { //test data
- GridCoverage coverage = gcr.read(null);
- Raster data = coverage.render(null).getData();
- assertEquals(0.5, data.getSampleDouble(0, 0, 0));
- assertEquals(0.6, data.getSampleDouble(1, 0, 0));
- assertEquals(0.4, data.getSampleDouble(2, 0, 0));
- assertEquals(0.6, data.getSampleDouble(0, 1, 0));
- assertEquals(0.2, data.getSampleDouble(1, 1, 0));
- assertEquals(Double.NaN, data.getSampleDouble(2, 1, 0));
- }
- }
- }
-
- /**
- * Test writing most simple 2D Grid coverage.
- */
- @Test
- public void testWriteCoverageXY() throws IOException, DataStoreException {
-
- final Path tempPath = Files.createTempFile("test", ".covjson");
- Files.delete(tempPath);
-
- try (final DataStore store = new CoverageJsonStoreProvider().open(new StorageConnector(tempPath))) {
-
- //test grid coverage resource exist
- assertTrue(store instanceof WritableAggregate);
- final WritableAggregate aggregate = (WritableAggregate) store;
- assertEquals(0, aggregate.components().size());
-
- //write a grid coverage
- final GridGeometry grid = new GridGeometry(new GridExtent(4,2), CRS.getDomainOfValidity(CommonCRS.WGS84.normalizedGeographic()), GridOrientation.REFLECTION_Y);
- final BufferedImage image = new BufferedImage(4, 2, BufferedImage.TYPE_BYTE_GRAY);
- final WritableRaster raster = image.getRaster();
- raster.setSample(0, 0, 0, 1);
- raster.setSample(1, 0, 0, 2);
- raster.setSample(2, 0, 0, 3);
- raster.setSample(3, 0, 0, 4);
- raster.setSample(0, 1, 0, 5);
- raster.setSample(1, 1, 0, 6);
- raster.setSample(2, 1, 0, 7);
- raster.setSample(3, 1, 0, 8);
-
- final GridCoverageBuilder gcb = new GridCoverageBuilder();
- gcb.setDomain(grid);
- gcb.setValues(image);
- final GridCoverage coverage = gcb.build();
-
- final GridCoverageResource gcr = new MemoryGridCoverageResource(null, null, coverage, null);
-
- aggregate.add(gcr);
-
- String json = Files.readString(tempPath, StandardCharsets.UTF_8);
- } finally {
- Files.deleteIfExists(tempPath);
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java
deleted file mode 100644
index 4449517327..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * 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 anz "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.coveragejson.binding;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import jakarta.json.JsonObject;
-import jakarta.json.bind.Jsonb;
-import jakarta.json.bind.JsonbBuilder;
-import org.eclipse.yasson.YassonConfig;
-
-// Test dependencies
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInstance;
-import static org.junit.jupiter.api.Assertions.*;
-
-
-/**
- * Test coverage-json bindings.
- *
- * @author Johann Sorel (Geomatys)
- */
-@TestInstance(TestInstance.Lifecycle.PER_CLASS)
-public class BindingTest {
-
- private final Jsonb jsonb;
-
- public BindingTest() {
- jsonb = JsonbBuilder.create(new YassonConfig().withFormatting(true));
- }
-
- public static String readResource(String path) throws IOException {
- final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-
- int nRead;
- byte[] data = new byte[16384];
- try (InputStream in = BindingTest.class.getResourceAsStream(path)) {
- while ((nRead = in.read(data, 0, data.length)) != -1) {
- buffer.write(data, 0, nRead);
- }
- }
- buffer.flush();
- return new String(buffer.toByteArray(), StandardCharsets.UTF_8);
- }
-
- private void compare(String jsonpath, Object expected) throws IOException {
- String json = readResource(jsonpath);
- //reformat it the same way.
- JsonObject map = jsonb.fromJson(json, JsonObject.class);
- String formattedJson = jsonb.toJson(map);
-
- final Object candidate = jsonb.fromJson(json, expected.getClass());
- expected.equals(candidate);
- assertEquals(expected, candidate);
- assertEquals(formattedJson, jsonb.toJson(candidate));
- }
-
- @AfterAll
- public void afterClass() throws Exception {
- jsonb.close();
- }
-
- @Test
- public void testAxeBounds() throws Exception {
- final Axe expected = new Axe();
- expected.values = asList(20,21);
- expected.bounds = asList(19.5,20.5,20.5,21.5);
- compare("axe_bounds.json", expected);
- }
-
- @Test
- public void testAxePolygon() throws Exception {
- final Axe expected = new Axe();
- expected.dataType = "polygon";
- expected.coordinates = Arrays.asList("x","y");
- expected.values = Arrays.asList(
- Arrays.asList(
- Arrays.asList(
- asList(100.0, 0.0),
- asList(101.0, 0.0),
- asList(101.0, 1.0),
- asList(100.0, 1.0),
- asList(100.0, 0.0)
- )
- )
- );
- compare("axe_polygon.json", expected);
- }
-
- @Test
- public void testAxeRegular() throws Exception {
- final Axe expected = new Axe();
- expected.start = 0.0;
- expected.stop = 5.0;
- expected.num = 6;
- compare("axe_regular.json", expected);
- }
-
- @Test
- public void testAxeTuples() throws Exception {
- final Axe expected = new Axe();
- expected.dataType = "tuple";
- expected.coordinates = Arrays.asList("t","x","y");
- expected.values = Arrays.asList(
- asList("2008-01-01T04:00:00Z",1,20),
- asList("2008-01-01T04:30:00Z",2,21)
- );
- compare("axe_tuples.json", expected);
- }
-
- @Test
- public void testCoverageVerticalProfile() throws Exception {
- final GeographicCRS geoCrs = new GeographicCRS();
- geoCrs.id = "http://www.opengis.net/def/crs/OGC/1.3/CRS84";
-
- final VerticalCRS zCrs = new VerticalCRS();
- //"cs":{"csAxes":[{"name":{"en":"Pressure"},"direction":"down","unit":{"symbol":"Pa"}}]}
- final Map<String,Object> axe = new LinkedHashMap<>();
- axe.put("name", Map.of("en", "Pressure"));
- axe.put("direction", "down");
- axe.put("unit", Map.of("symbol", "Pa"));
- final Map<String,Object> cs = new HashMap<>();
- cs.put("csAxes", Arrays.asList(axe));
- //zCrs.setAnyProperty("cs", cs); //TODO undefined attributes ignored
-
- final TemporalRS tCrs = new TemporalRS();
- tCrs.calendar = "Gregorian";
-
- final ReferenceSystemConnection georsc = new ReferenceSystemConnection();
- georsc.coordinates = Arrays.asList("x", "y");
- georsc.system = geoCrs;
-
- final ReferenceSystemConnection zrsc = new ReferenceSystemConnection();
- zrsc.coordinates = Arrays.asList("z");
- zrsc.system = zCrs;
-
- final ReferenceSystemConnection trsc = new ReferenceSystemConnection();
- trsc.coordinates = Arrays.asList("t");
- trsc.system = tCrs;
-
- final Domain domain = new Domain();
- domain.domainType = "VerticalProfile";
- domain.axes = new Axes();
- domain.axes.x = new Axe();
- domain.axes.y = new Axe();
- domain.axes.z = new Axe();
- domain.axes.t = new Axe();
- domain.axes.x.values = asList(-10.1);
- domain.axes.y.values = asList(-40.2);
- domain.axes.z.values = asList(5.4562, 8.9282);
- domain.axes.t.values = asList("2013-01-13T11:12:20Z");
- domain.referencing = Arrays.asList(georsc, zrsc, trsc);
-
- final Parameter PSAL = new Parameter();
- PSAL.description = new I18N("en", "The measured salinity, in practical salinity units (psu) of the sea water ");
- PSAL.unit = new Unit(null,null,"psu");
- PSAL.observedProperty = new ObservedProperty("http://vocab.nerc.ac.uk/standard_name/sea_water_salinity/", new I18N("en", "Sea Water Salinity"), null, null);
-
- final Parameter POTM = new Parameter();
- POTM.description = new I18N("en", "The potential temperature, in degrees celcius, of the sea water");
- POTM.unit = new Unit(null,null,"°C");
- POTM.observedProperty = new ObservedProperty("http://vocab.nerc.ac.uk/standard_name/sea_water_potential_temperature/", new I18N("en", "Sea Water Potential Temperature"), null, null);
-
- final Parameters parameters = new Parameters();
- parameters.setAnyProperty("PSAL", PSAL);
- parameters.setAnyProperty("POTM", POTM);
-
- final NdArray PSALr = new NdArray();
- PSALr.dataType ="float";
- PSALr.shape = new int[]{2};
- PSALr.axisNames = new String[]{"z"};
- PSALr.values = asList(43.9599, 43.9599);
-
- final NdArray POTMr = new NdArray();
- POTMr.dataType ="float";
- POTMr.shape = new int[]{2};
- POTMr.axisNames = new String[]{"z"};
- POTMr.values = asList(23.8, 23.7);
-
- final Ranges ranges = new Ranges();
- ranges.setAnyProperty("PSAL", PSALr);
- ranges.setAnyProperty("POTM", POTMr);
-
- final Coverage expected = new Coverage();
- expected.domain = domain;
- expected.parameters = parameters;
- expected.ranges = ranges;
-
- compare("coverage_vertical_profile_nocs.json", expected);
- }
-
- /**
- * Convert numeric values to BigDecimal for equality tests.
- */
- private static List<Object> asList(Object... array) {
- final List<Object> lst = new ArrayList<>(array.length);
- for (int i=0;i<array.length;i++) {
- if (array[i] instanceof Integer v) {
- lst.add(BigDecimal.valueOf(v));
- } else if (array[i] instanceof Double v) {
- lst.add(BigDecimal.valueOf(v));
- } else {
- lst.add(array[i]);
- }
- }
- return lst;
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/LICENSE.md b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/LICENSE.md
deleted file mode 100644
index e09d470a88..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/LICENSE.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# License of test files
-
-This directory contains JSON binding test files extracted from the OGC specification.
-All those JSON files are copyright Open Geospatial Consortium (OGC) and licensed under
-the Apache 2 license. Source: https://github.com/opengeospatial/CoverageJSON
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_bounds.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_bounds.json
deleted file mode 100644
index a4d3c7c93b..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_bounds.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "values":[
- 20,
- 21
- ],
- "bounds":[
- 19.5,
- 20.5,
- 20.5,
- 21.5
- ]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_polygon.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_polygon.json
deleted file mode 100644
index 8fbaf14501..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_polygon.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "dataType":"polygon",
- "coordinates":[
- "x",
- "y"
- ],
- "values":[
- [
- [
- [
- 100.0,
- 0.0
- ],
- [
- 101.0,
- 0.0
- ],
- [
- 101.0,
- 1.0
- ],
- [
- 100.0,
- 1.0
- ],
- [
- 100.0,
- 0.0
- ]
- ]
- ]
- ]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_regular.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_regular.json
deleted file mode 100644
index 010b46d9a9..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_regular.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "start": 0.0,
- "stop": 5.0,
- "num": 6
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_tuples.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_tuples.json
deleted file mode 100644
index 79918750f3..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/axe_tuples.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "dataType":"tuple",
- "coordinates":[
- "t",
- "x",
- "y"
- ],
- "values":[
- [
- "2008-01-01T04:00:00Z",
- 1,
- 20
- ],
- [
- "2008-01-01T04:30:00Z",
- 2,
- 21
- ]
- ]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coverage_vertical_profile.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coverage_vertical_profile.json
deleted file mode 100644
index a975d21e4c..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coverage_vertical_profile.json
+++ /dev/null
@@ -1,91 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type" : "Domain",
- "domainType" : "VerticalProfile",
- "axes": {
- "x" : { "values": [-10.1] },
- "y" : { "values": [ -40.2] },
- "z" : { "values": [
- 5.4562, 8.9282 ] },
- "t" : { "values": ["2013-01-13T11:12:20Z"] }
- },
- "referencing": [{
- "coordinates": ["x","y"],
- "system": {
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
- }
- }, {
- "coordinates": ["z"],
- "system": {
- "type": "VerticalCRS",
- "cs": {
- "csAxes": [{
- "name": {
- "en": "Pressure"
- },
- "direction": "down",
- "unit": {
- "symbol": "Pa"
- }
- }]
- }
- }
- }, {
- "coordinates": ["t"],
- "system": {
- "type": "TemporalRS",
- "calendar": "Gregorian"
- }
- }]
- },
- "parameters" : {
- "PSAL": {
- "type" : "Parameter",
- "description" : {
- "en": "The measured salinity, in practical salinity units (psu) of the sea water "
- },
- "unit" : {
- "symbol" : "psu"
- },
- "observedProperty" : {
- "id" : "http://vocab.nerc.ac.uk/standard_name/sea_water_salinity/",
- "label" : {
- "en": "Sea Water Salinity"
- }
- }
- },
- "POTM": {
- "type" : "Parameter",
- "description" : {
- "en": "The potential temperature, in degrees celcius, of the sea water"
- },
- "unit" : {
- "symbol" : "°C"
- },
- "observedProperty" : {
- "id" : "http://vocab.nerc.ac.uk/standard_name/sea_water_potential_temperature/",
- "label" : {
- "en": "Sea Water Potential Temperature"
- }
- }
- }
- },
- "ranges" : {
- "PSAL" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["z"],
- "shape": [2],
- "values" : [ 43.9599, 43.9599 ]
- },
- "POTM" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["z"],
- "shape": [2],
- "values" : [ 23.8, 23.7 ]
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coverage_vertical_profile_nocs.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coverage_vertical_profile_nocs.json
deleted file mode 100644
index fd77ff48d6..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coverage_vertical_profile_nocs.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type" : "Domain",
- "domainType" : "VerticalProfile",
- "axes": {
- "x" : { "values": [-10.1] },
- "y" : { "values": [ -40.2] },
- "z" : { "values": [
- 5.4562, 8.9282 ] },
- "t" : { "values": ["2013-01-13T11:12:20Z"] }
- },
- "referencing": [{
- "coordinates": ["x","y"],
- "system": {
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
- }
- }, {
- "coordinates": ["z"],
- "system": {
- "type": "VerticalCRS"
- }
- }, {
- "coordinates": ["t"],
- "system": {
- "type": "TemporalRS",
- "calendar": "Gregorian"
- }
- }]
- },
- "parameters" : {
- "PSAL": {
- "type" : "Parameter",
- "description" : {
- "en": "The measured salinity, in practical salinity units (psu) of the sea water "
- },
- "unit" : {
- "symbol" : "psu"
- },
- "observedProperty" : {
- "id" : "http://vocab.nerc.ac.uk/standard_name/sea_water_salinity/",
- "label" : {
- "en": "Sea Water Salinity"
- }
- }
- },
- "POTM": {
- "type" : "Parameter",
- "description" : {
- "en": "The potential temperature, in degrees celcius, of the sea water"
- },
- "unit" : {
- "symbol" : "°C"
- },
- "observedProperty" : {
- "id" : "http://vocab.nerc.ac.uk/standard_name/sea_water_potential_temperature/",
- "label" : {
- "en": "Sea Water Potential Temperature"
- }
- }
- }
- },
- "ranges" : {
- "PSAL" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["z"],
- "shape": [2],
- "values" : [ 43.9599, 43.9599 ]
- },
- "POTM" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["z"],
- "shape": [2],
- "values" : [ 23.8, 23.7 ]
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coveragecollection.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coveragecollection.json
deleted file mode 100644
index e1af6e39d2..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/coveragecollection.json
+++ /dev/null
@@ -1,92 +0,0 @@
-{
- "type" : "CoverageCollection",
- "domainType" : "VerticalProfile",
- "parameters" : {
- "PSAL": {
- "type" : "Parameter",
- "description" : {
- "en": "The measured salinity, in practical salinity units (psu) of the sea water"
- },
- "unit" : {
- "symbol" : "psu"
- },
- "observedProperty" : {
- "id": "http://vocab.nerc.ac.uk/standard_name/sea_water_salinity/",
- "label" : {
- "en": "Sea Water Salinity"
- }
- }
- }
- },
- "referencing": [{
- "coordinates": ["x","y"],
- "system": {
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
- }
- }, {
- "coordinates": ["z"],
- "system": {
- "type": "VerticalCRS",
- "cs": {
- "csAxes": [{
- "name": {
- "en": "Pressure"
- },
- "direction": "down",
- "unit": {
- "symbol": "Pa"
- }
- }]
- }
- }
- }, {
- "coordinates": ["t"],
- "system": {
- "type": "TemporalRS",
- "calendar": "Gregorian"
- }
- }],
- "coverages": [
- {
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "axes": {
- "x": { "values": [-10.1] },
- "y": { "values": [-40.2] },
- "z": { "values": [ 5, 8, 14 ] },
- "t": { "values": ["2013-01-13T11:12:20Z"] }
- }
- },
- "ranges" : {
- "PSAL" : {
- "type" : "NdArray",
- "dataType": "float",
- "shape": [3],
- "axisNames": ["z"],
- "values" : [ 43.7, 43.8, 43.9 ]
- }
- }
- }, {
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "axes": {
- "x": { "values": [-11.1] },
- "y": { "values": [-45.2] },
- "z": { "values": [ 4, 7, 9 ] },
- "t": { "values": ["2013-01-13T12:12:20Z"] }
- }
- },
- "ranges" : {
- "PSAL" : {
- "type" : "NdArray",
- "dataType": "float",
- "shape": [3],
- "axisNames": ["z"],
- "values" : [ 42.7, 41.8, 40.9 ]
- }
- }
- }]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domain_grid.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domain_grid.json
deleted file mode 100644
index 042aed9e21..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domain_grid.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type" : "Domain",
- "domainType" : "Grid",
- "axes": {
- "x": { "values": [1,2,3] },
- "y": { "values": [20,21] },
- "z": { "values": [1] },
- "t": { "values": ["2008-01-01T04:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["t", "z", "y", "x"],
- "shape": [1, 1, 2, 3],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domain_trajectory.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domain_trajectory.json
deleted file mode 100644
index 43b421ded3..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domain_trajectory.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "type": "Domain",
- "domainType": "Trajectory",
- "axes": {
- "composite": {
- "dataType": "tuple",
- "coordinates": ["t","x","y"],
- "values": [
- ["2008-01-01T04:00:00Z", 1, 20],
- ["2008-01-01T04:30:00Z", 2, 21]
- ]
- }
- },
- "referencing": [{
- "coordinates": ["t"],
- "system": {
- "type": "TemporalRS",
- "calendar": "Gregorian"
- }
- }, {
- "coordinates": ["x","y"],
- "system": {
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
- }
- }]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_grid.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_grid.json
deleted file mode 100644
index ee521192e1..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_grid.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "start": 0,
- "stop": 5,
- "num": 6
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipoint.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipoint.json
deleted file mode 100644
index e11c311afc..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipoint.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "MultiPoint",
- "axes": {
- "t": { "values": ["2008-01-01T04:00:00Z"] },
- "composite": {
- "dataType": "tuple",
- "coordinates": ["x","y","z"],
- "values": [
- [1, 20, 1],
- [2, 21, 3]
- ]
- }
- }
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["composite"],
- "shape": [2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipointseries.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipointseries.json
deleted file mode 100644
index 14c2afa1da..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipointseries.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "MultiPointSeries",
- "axes": {
- "t": { "values": ["2008-01-01T04:00:00Z", "2008-01-01T05:00:00Z"] },
- "composite": {
- "dataType": "tuple",
- "coordinates": ["x","y","z"],
- "values": [
- [1, 20, 1],
- [2, 21, 3],
- [2, 20, 4]
- ]
- }
- }
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["t", "composite"],
- "shape": [2, 3],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipolygon.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipolygon.json
deleted file mode 100644
index a4c190ed1e..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipolygon.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "MultiPolygon",
- "axes": {
- "composite": {
- "dataType": "polygon",
- "coordinates": ["x","y"],
- "values": [
- [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ],
- [ [ [200.0, 10.0], [201.0, 10.0], [201.0, 11.0], [200.0, 11.0], [200.0, 10.0] ] ]
- ]
- },
- "z": { "values": [2] },
- "t": { "values": ["2008-01-01T04:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["composite"],
- "shape": [2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipolygonseries.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipolygonseries.json
deleted file mode 100644
index 58ba59ada9..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_multipolygonseries.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "MultiPolygonSeries",
- "axes": {
- "composite": {
- "dataType": "polygon",
- "coordinates": ["x","y"],
- "values": [
- [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ],
- [ [ [200.0, 10.0], [201.0, 10.0], [201.0, 11.0], [200.0, 11.0], [200.0, 10.0] ] ]
- ]
- },
- "z": { "values": [2] },
- "t": { "values": ["2008-01-01T04:00:00Z", "2010-01-01T00:00:00Z", "2012-01-01T00:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["t", "composite"],
- "shape": [3, 2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_point.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_point.json
deleted file mode 100644
index 5387aaf5bc..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_point.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "Point",
- "axes": {
- "x": { "values": [1] },
- "y": { "values": [20] },
- "z": { "values": [1] },
- "t": { "values": ["2008-01-01T04:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_pointseries.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_pointseries.json
deleted file mode 100644
index 8dc31dbb07..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_pointseries.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "PointSeries",
- "axes": {
- "x": { "values": [1] },
- "y": { "values": [20] },
- "z": { "values": [1] },
- "t": { "values": ["2008-01-01T04:00:00Z","2008-01-01T05:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["t"],
- "shape": [2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_polygon.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_polygon.json
deleted file mode 100644
index 8c58765073..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_polygon.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "Polygon",
- "axes": {
- "composite": {
- "dataType": "polygon",
- "coordinates": ["x","y"],
- "values": [
- [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ]
- ]
- },
- "z": { "values": [2] },
- "t": { "values": ["2008-01-01T04:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_polygonseries.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_polygonseries.json
deleted file mode 100644
index 9d73984dc4..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_polygonseries.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "PolygonSeries",
- "axes": {
- "composite": {
- "dataType": "polygon",
- "coordinates": ["x","y"],
- "values": [
- [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ]
- ]
- },
- "z": { "values": [2] },
- "t": { "values": ["2008-01-01T04:00:00Z","2008-01-01T05:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["t"],
- "shape": [2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_section.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_section.json
deleted file mode 100644
index 309302c641..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_section.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "Section",
- "axes": {
- "z": { "values": [10,20,30] },
- "composite": {
- "dataType": "tuple",
- "coordinates": ["t","x","y"],
- "values": [
- ["2008-01-01T04:00:00Z", 1, 20],
- ["2008-01-01T04:30:00Z", 2, 21]
- ]
- }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["z", "composite"],
- "shape": [3, 2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_trajectory.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_trajectory.json
deleted file mode 100644
index a30239c17f..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_trajectory.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "Trajectory",
- "axes": {
- "composite": {
- "dataType": "tuple",
- "coordinates": ["t","x","y","z"],
- "values": [
- ["2008-01-01T04:00:00Z", 1, 20, 1],
- ["2008-01-01T04:30:00Z", 2, 21, 3]
- ]
- }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["composite"],
- "shape": [2],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_vertical_profile.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_vertical_profile.json
deleted file mode 100644
index 6c82fcd02c..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/domaintype_vertical_profile.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type": "Domain",
- "domainType": "VerticalProfile",
- "axes": {
- "x": { "values": [1] },
- "y": { "values": [21] },
- "z": { "values": [1,5,20] },
- "t": { "values": ["2008-01-01T04:00:00Z"] }
- },
- "referencing": []
- },
- "parameters" : {
- "temperature": {}
- },
- "ranges" : {
- "temperature" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["z"],
- "shape": [3],
- "values" : []
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/geographiccrs_longlat.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/geographiccrs_longlat.json
deleted file mode 100644
index 90814122a1..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/geographiccrs_longlat.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/geographiccrs_longlatheight.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/geographiccrs_longlatheight.json
deleted file mode 100644
index 0c736fd05e..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/geographiccrs_longlatheight.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/EPSG/0/4979"
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/ndarray.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/ndarray.json
deleted file mode 100644
index da6f336406..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/ndarray.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "type": "NdArray",
- "dataType": "float",
- "shape": [4, 2],
- "axisNames": ["y", "x"],
- "values": [
- 12.3, 12.5, 11.5, 23.1,
- null, null, 10.1, 9.1
- ]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parameter_categoricaldata.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parameter_categoricaldata.json
deleted file mode 100644
index 3afb80e7dc..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parameter_categoricaldata.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "type" : "Parameter",
- "description" : {
- "en": "The land cover category."
- },
- "observedProperty" : {
- "id" : "http://example.com/land_cover",
- "label" : {
- "en": "Land Cover"
- },
- "description" : {
- "en": "longer description..."
- },
- "categories": [{
- "id": "http://example.com/land_cover/categories/grass",
- "label": {
- "en": "Grass"
- },
- "description": {
- "en": "Very green grass."
- }
- }, {
- "id": "http://example.com/land_cover/categories/forest",
- "label": {
- "en": "Forest"
- }
- }]
- },
- "categoryEncoding": {
- "http://example.com/land_cover/categories/grass": 1,
- "http://example.com/land_cover/categories/forest": [2,3]
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parameter_continuousdata.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parameter_continuousdata.json
deleted file mode 100644
index 2ff6c92184..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parameter_continuousdata.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "type" : "Parameter",
- "description" : {
- "en": "The sea surface temperature in degrees Celsius."
- },
- "observedProperty" : {
- "id" : "http://vocab.nerc.ac.uk/standard_name/sea_surface_temperature/",
- "label" : {
- "en": "Sea Surface Temperature"
- },
- "description" : {
- "en": "The temperature of sea water near the surface (including the part under sea-ice, if any), and not the skin temperature."
- }
- },
- "unit" : {
- "label" : {
- "en": "Degree Celsius"
- },
- "symbol": {
- "value": "Cel",
- "type": "http://www.opengis.net/def/uom/UCUM/"
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parametergroup_uncertainty.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parametergroup_uncertainty.json
deleted file mode 100644
index 7b871885e3..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parametergroup_uncertainty.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "type": "ParameterGroup",
- "label": {
- "en": "Daily sea surface temperature with uncertainty information"
- },
- "observedProperty": {
- "id": "http://vocab.nerc.ac.uk/standard_name/sea_surface_temperature/",
- "label": {
- "en": "Sea surface temperature"
- }
- },
- "members": ["SST_mean", "SST_stddev"]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parametergroup_vectorquantity.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parametergroup_vectorquantity.json
deleted file mode 100644
index 696eaaa3d9..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/parametergroup_vectorquantity.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "type": "ParameterGroup",
- "observedProperty": {
- "label": {
- "en": "Wind velocity"
- }
- },
- "members": ["WIND_SPEED", "WIND_DIR"]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/projectedcrs_britishnationalgrid.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/projectedcrs_britishnationalgrid.json
deleted file mode 100644
index 199edd7e4e..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/projectedcrs_britishnationalgrid.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "type": "ProjectedCRS",
- "id": "http://www.opengis.net/def/crs/EPSG/0/27700"
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/reference_system_connection.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/reference_system_connection.json
deleted file mode 100644
index a94c3f36d5..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/reference_system_connection.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "coordinates": ["y","x","z"],
- "system": {
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/EPSG/0/4979"
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/temporalrs.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/temporalrs.json
deleted file mode 100644
index ed5fb370a5..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/temporalrs.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "type": "TemporalRS",
- "calendar": "Gregorian"
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/tiledndarray.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/tiledndarray.json
deleted file mode 100644
index 34dd2674da..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/tiledndarray.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "type" : "TiledNdArray",
- "dataType": "integer",
- "axisNames": ["t", "y", "x"],
- "shape": [2, 5, 10],
- "tileSets": [{
- "tileShape": [null, null, null],
- "urlTemplate": "http://example.com/a/all.covjson"
- }, {
- "tileShape": [1, null, null],
- "urlTemplate": "http://example.com/b/{t}.covjson"
- }, {
- "tileShape": [null, 2, 3],
- "urlTemplate": "http://example.com/c/{y}-{x}.covjson"
- }]
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/verticalcrs_navd88.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/verticalcrs_navd88.json
deleted file mode 100644
index 4bd091956f..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/verticalcrs_navd88.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "type": "VerticalCRS",
- "id": "http://www.opengis.net/def/crs/EPSG/0/5703"
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/coverage_xyzt.json b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/coverage_xyzt.json
deleted file mode 100644
index 332921893e..0000000000
--- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/coverage_xyzt.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "type" : "Coverage",
- "domain" : {
- "type" : "Domain",
- "domainType" : "Grid",
- "axes": {
- "x" : { "values": [-10,-5,0] },
- "y" : { "values": [40,50] },
- "z" : { "values": [ 5] },
- "t" : { "values": ["2010-01-01T00:12:20Z"] }
- },
- "referencing": [{
- "coordinates": ["y","x","z"],
- "system": {
- "type": "GeographicCRS",
- "id": "http://www.opengis.net/def/crs/EPSG/0/4979"
- }
- }, {
- "coordinates": ["t"],
- "system": {
- "type": "TemporalRS",
- "calendar": "Gregorian"
- }
- }]
- },
- "parameters" : {
- "ICEC": {
- "type" : "Parameter",
- "description": {
- "en": "Sea Ice concentration (ice=1;no ice=0)"
- },
- "unit" : {
- "label": {
- "en": "Ratio"
- },
- "symbol": {
- "value": "1",
- "type": "http://www.opengis.net/def/uom/UCUM/"
- }
- },
- "observedProperty" : {
- "id" : "http://vocab.nerc.ac.uk/standard_name/sea_ice_area_fraction/",
- "label" : {
- "en": "Sea Ice Concentration"
- }
- }
- }
- },
- "ranges" : {
- "ICEC" : {
- "type" : "NdArray",
- "dataType": "float",
- "axisNames": ["t","z","y","x"],
- "shape": [1, 1, 2, 3],
- "values" : [ 0.5, 0.6, 0.4, 0.6, 0.2, null ]
- }
- }
-}
\ No newline at end of file
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/META-INF/services/org.apache.sis.storage.DataStoreProvider b/incubator/src/org.apache.sis.storage.geoheif/main/META-INF/services/org.apache.sis.storage.DataStoreProvider
deleted file mode 100644
index 4dde58e379..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/META-INF/services/org.apache.sis.storage.DataStoreProvider
+++ /dev/null
@@ -1,4 +0,0 @@
-# Workaround for Maven bug https://issues.apache.org/jira/browse/MNG-7855
-# The content of this file is automatically derived from module-info.class file.
-# Should be used only if the JAR file was on class-path rather than module-path.
-org.apache.sis.storage.geoheif.GeoHeifStoreProvider
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/module-info.java b/incubator/src/org.apache.sis.storage.geoheif/main/module-info.java
deleted file mode 100644
index 5f14528b28..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/module-info.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * GeoHEIF / GIMI store.
- * The <abbr>HEIF</abbr> abbreviation stands for <q>High Efficiency Image Format</q>
- * and <abbr>GIMI</abbr> stands for <dfn><abbr title="Geospatial Intelligence">GEOINT</abbr> Imagery Media for
- * <abbr title="Intelligence, Surveillance, and Reconnaissance">ISR</abbr></dfn>.
- * This format is described by the following set of standards:
- *
- * <ul>
- * <li>ISO/IEC 14496-12 — ISO Base Media File Format (<abbr>ISOBMFF</abbr>)</li>
- * <li>ISO/IEC 23008-12 — High Efficiency Image File Format (<abbr>HEIF</abbr>)</li>
- * </ul>
- *
- * This module supports only a subset of the data structures ("boxes") defined in above standards.
- * It focuses on the data structures needed for georeferenced images.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-module org.apache.sis.storage.geoheif {
- // Dependencies used in public API.
- requires transitive org.apache.sis.referencing;
- requires transitive org.apache.sis.storage;
-
- exports org.apache.sis.storage.geoheif;
-
- uses org.apache.sis.storage.isobmff.BoxRegistry;
-
- provides org.apache.sis.storage.DataStoreProvider
- with org.apache.sis.storage.geoheif.GeoHeifStoreProvider;
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/CoverageBuilder.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/CoverageBuilder.java
deleted file mode 100644
index a489dba00a..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/CoverageBuilder.java
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.net.URI;
-import java.util.UUID;
-import java.util.Set;
-import java.util.Map;
-import java.util.List;
-import java.util.LinkedHashMap;
-import java.util.Collection;
-import java.util.StringJoiner;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.io.IOException;
-import java.nio.ByteOrder;
-import java.awt.Dimension;
-import java.awt.image.ColorModel;
-import java.awt.image.SampleModel;
-import java.awt.image.RasterFormatException;
-import javax.imageio.ImageTypeSpecifier;
-import org.opengis.util.GenericName;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
-import org.apache.sis.image.DataType;
-import org.apache.sis.image.internal.shared.ColorModelBuilder;
-import org.apache.sis.image.internal.shared.ColorModelFactory;
-import org.apache.sis.image.internal.shared.SampleModelBuilder;
-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.storage.DataStoreException;
-import org.apache.sis.storage.base.MetadataBuilder;
-import org.apache.sis.storage.modifier.CoverageModifier;
-import org.apache.sis.storage.isobmff.Box;
-import org.apache.sis.storage.isobmff.base.ItemInfoEntry;
-import org.apache.sis.storage.isobmff.base.ItemProperties;
-import org.apache.sis.storage.isobmff.gimi.ModelTransformation;
-import org.apache.sis.storage.isobmff.gimi.ModelCRS;
-import org.apache.sis.storage.isobmff.mpeg.Component;
-import org.apache.sis.storage.isobmff.mpeg.ComponentType;
-import org.apache.sis.storage.isobmff.mpeg.ComponentPalette;
-import org.apache.sis.storage.isobmff.mpeg.ComponentDefinition;
-import org.apache.sis.storage.isobmff.mpeg.UncompressedFrameConfig;
-import org.apache.sis.storage.isobmff.mpeg.InterleavingMode;
-import org.apache.sis.storage.isobmff.image.ImageSpatialExtents;
-import org.apache.sis.storage.isobmff.image.PixelInformation;
-import org.apache.sis.util.ArraysExt;
-import org.apache.sis.util.Emptiable;
-import org.apache.sis.util.collection.Containers;
-import org.apache.sis.util.internal.shared.Numerics;
-import org.apache.sis.util.resources.Errors;
-import org.apache.sis.pending.jdk.JDK18;
-
-
-/**
- * Helper class for building the grid geometry and sample dimensions of a grid coverage.
- * Also opportunistically builds the coverage metadata associated to the resource.
- *
- * <p>The call to {@link #buildAndFreeze()} shall be last because metadata are completed
- * as side-effect of other method calls (for building name, grid geometry, <i>etc</i>).</p>
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-final class CoverageBuilder implements Emptiable {
- /**
- * The data store which is creating a grid coverage.
- */
- final GeoHeifStore store;
-
- /**
- * An index of the image to build, for information purpose only.
- * This is given to {@link CoverageModifier.Source} constructor.
- */
- private final int imageIndex;
-
- /**
- * Name or identifier of the resource. This is taken from {@link ItemInfoEntry#itemName}
- * if available, or {@link ItemInfoEntry#itemID} otherwise. The item name is documented
- * as "symbolic name of the item (source file for file delivery transmissions)" and this
- * class assumes that the name is unique.
- *
- * @todo Verify if {@link ItemInfoEntry#itemName} is really unique.
- *
- * @see #name()
- */
- private String name;
-
- /**
- * The size of the reconstructed image in pixels.
- */
- private int width, height;
-
- /**
- * Coefficients of the matrix that defines the "grid to <abbr>CRS</abbr>" coordinate conversion.
- * May be {@code null} if no such information was found.
- */
- private ModelTransformation affine;
-
- /**
- * The Well Known Text representation of the coordinate reference system.
- * May be {@code null} if no such information was found.
- */
- private ModelCRS crsDefinition;
-
- /**
- * How pixel data should be displayed.
- * Values are instance of {@link ComponentType}, {@link URI} or {@link Integer}, in preference order.
- * In the latter case, the integer value is the user-defined component type.
- * May be {@code null} if no such information was found.
- */
- private Object[] componentTypes;
-
- /**
- * Number of bits per channel for the pixels of the reconstructed image.
- * The array length is the number of channels. Values are unsigned.
- * May be {@code null} if no such information was found.
- */
- private byte[] bitsPerChannel;
-
- /**
- * Information about the sample model (data type, <i>etc.</i>).
- * May be {@code null} if no such information was found.
- * This is actually a mandatory information according ISO/IEC 23001-17:2024,
- * but this class is nevertheless tolerant to its absence.
- */
- private UncompressedFrameConfig model;
-
- /**
- * The color palette of an indexed color model.
- * May be {@code null} if no such information was found.
- */
- private ComponentPalette palette;
-
- /**
- * Boxes that are unknown to this class.
- * Keys are either {@link Integer} for a four-characters code, or {@link UUID}.
- * The map values specify whether the associated box was considered essential.
- * The null key means that some missing boxes are unidentified.
- */
- private final Map<Object, Boolean> unknownBoxes;
-
- /**
- * The type of sample values stored in the raster.
- * Determined as a side effect of {@link #sampleDimensions()}.
- *
- * @see #dataType()
- */
- private DataType dataType;
-
- /**
- * The color model, created as a side effect of {@link #sampleDimensions()}.
- * May stay null if this builder does not have enough information.
- *
- * @see #colorModel()
- */
- private ColorModel colorModel;
-
- /**
- * The sample model, created as a side effect of {@link #sampleDimensions()}.
- * May stay null if this builder does not have enough information.
- *
- * @see #sampleModel()
- */
- private SampleModel sampleModel;
-
- /**
- * The sample dimensions, created when first requested.
- *
- * @see #sampleDimensions()
- */
- private SampleDimension[] sampleDimensions;
-
- /**
- * The builder of metadata, created when first needed.
- *
- * @see #metadata()
- */
- private MetadataBuilder metadata;
-
- /**
- * The builder used for building tiles, or {@code null} if none.
- */
- private CoverageBuilder tileBuilder;
-
- /**
- * Creates a new builder with the given properties.
- *
- * @param store the data store which is creating a grid coverage.
- * @param imageIndex an index of the image, for information purpose only.
- * @param properties source of coverage properties for this coverage item.
- * @param duplicatedBoxes names of boxes that were duplicated. Used for logging a warning only once per type of box.
- */
- CoverageBuilder(final GeoHeifStore store, final int imageIndex, final ItemProperties.ForID properties, final Set<String> duplicatedBoxes) {
- this.store = store;
- this.imageIndex = imageIndex;
- unknownBoxes = new LinkedHashMap<>();
- if (properties == null) {
- return;
- }
- if (properties.missingItem) {
- // Some boxes could not be handled, but we don't have their identifiers.
- unknownBoxes.put(null, properties.missingEssential);
- }
- final int count = properties.size();
- for (int i=0; i<count; i++) {
- boolean duplicated;
- final Box property = properties.get(i);
- switch (property.type()) {
- /*
- * We should have only one instance of `ImageSpatialExtents`. If nevertheless there is many,
- * the use of the maximum values increases the chances that we detect inconsistency because
- * it may result in a length larger than the size of the box which contains the pixels.
- */
- case ImageSpatialExtents.BOXTYPE: {
- var c = (ImageSpatialExtents) property;
- duplicated = (width | height) != 0;
- width = Math.max(width, c.imageWidth);
- height = Math.max(height, c.imageHeight);
- break;
- }
- /*
- * We should have one instance of `ComponentDefinition` and `PixelInformation`. If nevertheless
- * there is many, maybe a broken writer puts one element per box. If this assumption is wrong,
- * the total length should be greater than the pixels box size, thus allowing error detection.
- */
- case ComponentDefinition.BOXTYPE: {
- var c = (ComponentDefinition) property;
- duplicated = (componentTypes != null);
- componentTypes = ArraysExt.concatenate(componentTypes, c.componentTypes);
- break;
- }
- case PixelInformation.BOXTYPE: {
- var c = (PixelInformation) property;
- duplicated = (bitsPerChannel != null);
- bitsPerChannel = ArraysExt.concatenate(bitsPerChannel, c.bitsPerChannel);
- break;
- }
- /*
- * For the next types of box, we keep only the first occurrence.
- */
- case ModelTransformation.BOXTYPE: {
- var c = (ModelTransformation) property;
- duplicated = (affine != null);
- if (!duplicated) affine = c;
- break;
- }
- case ModelCRS.BOXTYPE: {
- var c = (ModelCRS) property;
- duplicated = (crsDefinition != null);
- if (!duplicated) crsDefinition = c;
- break;
- }
- case UncompressedFrameConfig.BOXTYPE: {
- var c = (UncompressedFrameConfig) property;
- duplicated = (model != null);
- if (!duplicated) model = c;
- break;
- }
- case ComponentPalette.BOXTYPE: {
- var c = (ComponentPalette) property;
- duplicated = (palette != null);
- if (!duplicated) palette = c;
- break;
- }
- default: {
- unknownBoxes.merge(property.typeKey(), properties.essential(i), Boolean::logicalOr);
- continue;
- }
- }
- if (duplicated) {
- final String type = Box.formatFourCC(property.type());
- if (duplicatedBoxes.add(type)) {
- store.warning(Errors.Keys.DuplicatedElement_1, type);
- }
- }
- }
- }
-
- /**
- * If any boxes were unrecognized, reports these boxes in a warning.
- * If at least one ignored box was flagged as essential, then this method returns {@code true}
- * and the caller should not create the resource. Otherwise, this method returns {@code false}
- * and the caller can proceed.
- *
- * @param name name of the resource to create.
- * @return whether at least one ignored box was flagged as essential.
- */
- boolean reportUnknownBoxes(final String name) {
- boolean essential = false;
- if (!unknownBoxes.isEmpty()) {
- final Level level;
- final var message = new StringBuilder();
- final Collection<Boolean> essentials = unknownBoxes.values();
- if (essentials.contains(Boolean.TRUE)) {
- essentials.removeIf((e) -> !e); // Remove all non-essential boxes.
- message.append("Cannot create a resource for \"").append(name)
- .append("\" because the following essential boxes are not handled: ");
- level = Level.WARNING;
- essential = true;
- } else {
- message.append("The \"").append(name)
- .append("\" resource has been read but the following boxes have been ignored: ");
- level = Level.FINE;
- }
- final var sj = new StringJoiner(", ");
- for (Object id : unknownBoxes.keySet()) {
- if (id == null) {
- id = "unidentified boxes";
- } else if (id instanceof Integer fourCC) {
- id = Box.formatFourCC(fourCC);
- }
- sj.add(id.toString());
- }
- final var record = new LogRecord(level, message.append(sj).append('.').toString());
- store.warning(record);
- }
- return essential;
- }
-
- /**
- * Sets the builder which is used for the tiles. This method is invoked when this builder is used for a grid view,
- * and that grid is made of many images interpreted as tiles. In such cases, there is no box specifying the color
- * and sample model of the view. This builder will need to get these models from the tile builder.
- *
- * <p>The two builders will share the same {@link MetadataBuilder} instance. This is because we need to redirect
- * the metadata information collected by the tile builder to this builder, otherwise they will be lost.
- * This method needs to be invoked before {@link #gridGeometry()} and {@link #sampleDimensions()}.</p>
- *
- * @param tile the builder used for the tiles.
- */
- final void setTileBuilder(final CoverageBuilder tile) {
- if (tile != null && tileBuilder == null) {
- tileBuilder = tile;
- metadata = tile.metadata();
- }
- }
-
- /**
- * Builds the grid coverage resource for an untiled image.
- * This builder should not be used anymore after this method call.
- *
- * @param name name of the resource.
- * @param image the single tile of the image.
- * @return the resource.
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if the "grid to <abbr>CRS</abbr>" transform cannot be created.
- */
- final ImageResource build(final String name, final Image.Supplier image) throws DataStoreException {
- this.name = name;
- return new ImageResource(this, null, image);
- }
-
- /**
- * Builds the grid coverage resource for a tiled image.
- * This builder should not be used anymore after this method call.
- *
- * @param name name of the resource.
- * @param tiles all tiles of the image.
- * @return the resource.
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if the "grid to <abbr>CRS</abbr>" transform cannot be created.
- */
- final ImageResource build(final String name, final List<Image> tiles) throws DataStoreException {
- this.name = name;
- return new ImageResource(this, tiles.toArray(Image[]::new), null);
- }
-
- /**
- * Returns a name for the resource to create and opportunistically adds it to the metadata.
- * This method should be invoked exactly once.
- */
- public final GenericName name() {
- GenericName gn = store.createComponentName(name);
- metadata().addIdentifier(gn, MetadataBuilder.Scope.RESOURCE);
- return gn;
- }
-
- /**
- * Returns the builder of metadata.
- */
- public final MetadataBuilder metadata() {
- if (metadata == null) {
- if (tileBuilder == null || (metadata = tileBuilder.metadata) == null) {
- metadata = new MetadataBuilder();
- }
- }
- return metadata;
- }
-
- /**
- * Returns whether the image has no width or no height.
- */
- @Override
- public final boolean isEmpty() {
- return (width <= 0 || height <= 0);
- }
-
- /**
- * Returns the number of tiles in the given dimension.
- *
- * @param dimension the dimension: 0 or 1.
- * @return number of tiles in the requested dimension.
- */
- public final int numTiles(final int dimension) {
- if (model != null) {
- switch (dimension) {
- case 0: return model.numTileCols;
- case 1: return model.numTileRows;
- }
- } else if ((width | height) != 0 && sampleModel != null) {
- switch (dimension) {
- case 0: return JDK18.ceilDiv(width, sampleModel.getWidth());
- case 1: return JDK18.ceilDiv(height, sampleModel.getHeight());
- }
- }
- return 1;
- }
-
- /**
- * Returns the byte order to use for reading the sample values of the image.
- */
- public final ByteOrder byteOrder() {
- return (model != null && model.componentsLittleEndian) ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN;
- }
-
- /**
- * Fetches the color model and sample model from a sample tile (usually the first).
- * This case happens when each tile is a JPEG image. In such case, the sample model
- * is not declared in {@code UncompressedFrameConfig} and we have to get it from a tile.
- *
- * <p>If this sample model has already been initialized, then this method does nothing.
- * This is desirable because this method is invoked in a loop for every tiles, while
- * fetching the sample model of the first tile is sufficient.</p>
- *
- * @param image a tile from which to get the sample and color models.
- * @throws DataStoreException if a problem occurred with the content of the <abbr>HEIF</abbr> file.
- * @throws IOException if an I/O error occurred.
- */
- final void setImageLayout(final Image image) throws DataStoreException, IOException {
- if (sampleModel == null) {
- ImageTypeSpecifier type = image.getImageType(store);
- colorModel = type.getColorModel();
- sampleModel = type.getSampleModel();
- dataType = DataType.forDataBufferType(sampleModel.getDataType());
- }
- }
-
- /**
- * Returns the type of sample values stored in the raster.
- * One of {@link #sampleModel()} or {@link #sampleDimensions()}
- * methods must have been invoked before this method.
- */
- public final DataType dataType() {
- return dataType;
- }
-
- /**
- * Returns the color model, or {@code null} if unknown.
- * The {@link #sampleDimensions()} method must have been invoked before this method.
- */
- public final ColorModel colorModel() {
- return colorModel;
- }
-
- /**
- * Returns the sample model with a size equals to the tile size.
- *
- * @return the sample model (never {@code null}).
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if an error occurred in {@link CoverageModifier}.
- */
- public final SampleModel sampleModel() throws DataStoreException {
- if (sampleModel == null) {
- sampleDimensions(false);
- if (sampleModel == null) {
- throw new RasterFormatException("Unspecified sample model.");
- }
- }
- return sampleModel;
- }
-
- /**
- * Implementation of {@link #sampleDimensions()} and {@link #sampleModel()}.
- *
- * @todo Need to add information from the {@code CellPropertyTypeProperty} box.
- * These information include sample dimension name and unit of measurement.
- *
- * @param full {@code true} for creating all objects, or {@code false} for creating only the sample model.
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if an error occurred in {@link CoverageModifier}.
- */
- private void sampleDimensions(final boolean full) throws DataStoreException {
- final int nc = (model == null) ? 0 : model.components.length;
- final int nt = (componentTypes == null) ? 0 : componentTypes.length;
- final int ns = (bitsPerChannel == null) ? 0 : bitsPerChannel.length;
- final int numBands = Math.max(Math.max(nc, nt), ns);
- if (numBands == 0) {
- if (tileBuilder != null) {
- if (tileBuilder.sampleDimensions == null) {
- tileBuilder.sampleDimensions(full);
- }
- sampleDimensions = tileBuilder.sampleDimensions;
- sampleModel = tileBuilder.sampleModel;
- colorModel = tileBuilder.colorModel;
- dataType = tileBuilder.dataType;
- }
- return;
- }
- final int[] bitsPerSample = new int[numBands];
- final var sd = full ? new SampleDimension[numBands] : null;
- final var sb = full ? new SampleDimension.Builder() : null;
- int numBits=0, redMask=0, greenMask=0, blueMask=0, alphaMask=0;
- int grayBand = -1, indexBand = -1, alphaBand = -1; // Negative value means none.
- for (int band=0; band<numBands; band++) {
- /*
- * `colorType` can be an enumeration value such as `RED`, `GREEN`, `BLUE`,
- * or an URI, or an Integer value. The same value can appear in two boxes.
- * `bitDepth` can also appear in two boxes. The ISO 23001-17:2024 standard
- * said that when the component type information appears in the two boxes,
- * `ComponentDefinitionBox` shall precede `UncompressedFrameConfigBox`.
- */
- var colorType = (band < nt) ? componentTypes[band] : null; // From `ComponentDefinition`.
- int bitDepth = (band < ns) ? Byte.toUnsignedInt(bitsPerChannel[band]) : 0;
- if (band < nc) {
- final Component c = model.components[band];
- if (colorType == null) colorType = c.type; // From `UncompressedFrameConfig`
- if (dataType == null) {
- dataType = c.getDataType();
- } else if (dataType != c.getDataType()) {
- throw new RasterFormatException("All bands shall be of the same data type.");
- }
- bitDepth = Short.toUnsignedInt(c.bitDepth);
- /*
- * Example: 10-bit unaligned RGB components followed by a 1-byte aligned 7-bit alpha component.
- * Stored as 30 consecutive bits containing R, G and B, followed by 2 pre-alignment padding bits
- * for byte alignment, followed by one alignment padding bit then followed by the 7-bit alpha value.
- */
- final int alignSize = Byte.toUnsignedInt(c.alignSize) * Byte.SIZE;
- if (alignSize != 0) {
- numBits = Numerics.snapToCeil(numBits, alignSize)
- + Numerics.snapToCeil(bitDepth, alignSize) - bitDepth;
- }
- }
- /*
- * Create the sample dimension and derive metadata from it.
- * TODO: parse CellPropertyTypeProperty and CellPropertyCategoriesProperty boxes.
- */
- if (full) {
- if (colorType != null) {
- sb.setName(colorType.toString());
- } else {
- sb.setName(band);
- }
- var source = new CoverageModifier.BandSource(store, imageIndex, band, numBands, dataType);
- metadata().addNewBand(sd[band] = store.customizer.customize(source, sb));
- sb.clear();
- }
- if (bitDepth == 0) {
- bitDepth = Component.DEFAULT_BIT_DEPTH;
- } else if (full) {
- metadata().setBitPerSample(bitDepth);
- }
- /*
- * Identify the bands that we can map to RGBA.
- * Will be used for building the color model.
- */
- bitsPerSample[band] = bitDepth;
- numBits += bitDepth;
- if (full && colorType instanceof ComponentType ct) {
- int mask = 0;
- if (numBits < Integer.SIZE) {
- mask = ((1 << bitDepth) - 1) << (Integer.SIZE - numBits);
- }
- switch (ct) {
- case RED: redMask |= mask; break;
- case GREEN: greenMask |= mask; break;
- case BLUE: blueMask |= mask; break;
- case ALPHA: alphaMask |= mask; alphaBand = band; break;
- case MONOCHROME: grayBand = band; break;
- case PALETTE: indexBand = band; break;
- }
- }
- }
- final boolean isRGB = (redMask | greenMask | blueMask) != 0;
- if (isRGB && numBits < Integer.SIZE) {
- final int n = Integer.SIZE - numBits; // Number of unused bits.
- redMask >>>= n;
- greenMask >>>= n;
- blueMask >>>= n;
- alphaMask >>>= n;
- }
- /*
- * Build a sample model. The `InterleavingMode.COMPONENT` default value is arbitrary,
- * as the `UncompressedFrameConfig` box is mandatory according ISO/IEC 23001-17:2024.
- */
- if (sampleModel == null && dataType != null) {
- InterleavingMode interleaveType = InterleavingMode.COMPONENT;
- final var tileSize = new Dimension(width, height);
- if (model != null) {
- tileSize.width /= model.numTileCols;
- tileSize.height /= model.numTileRows;
- interleaveType = model.interleaveType;
- }
- final boolean isBanded;
- switch (interleaveType) {
- case COMPONENT: isBanded = true; break; // Java2D: BandedSampleModel
- case PIXEL: isBanded = false; break; // Java2D: PixelInterleavedSampleModel
- default: throw new RasterFormatException("Unsupported interleave type: " + interleaveType);
- }
- sampleModel = new SampleModelBuilder(dataType, tileSize, bitsPerSample, isBanded).build();
- }
- /*
- * Build a RGB(A) or indexed color model compatible with the sample model.
- * The gray scale is used as a fallback for all unrecognized color models.
- */
- if (full) {
- if (indexBand >= 0 && palette != null) {
- colorModel = palette.toARGB(dataType, bitsPerSample[indexBand], numBands, indexBand); // May be null.
- }
- if (colorModel == null && sampleModel != null) {
- if (grayBand < 0 && (grayBand = indexBand) < 0) {
- grayBand = ColorModelFactory.DEFAULT_VISIBLE_BAND;
- }
- final var cb = new ColorModelBuilder(isRGB)
- .dataType(dataType)
- .bitsPerSample(bitsPerSample)
- .alphaBand(alphaBand)
- .visibleBand(grayBand, sd[grayBand].getSampleRange().orElse(null));
- if (isRGB) {
- cb.componentMasks(redMask, greenMask, blueMask, alphaMask);
- // TODO: use another color space if not RGB.
- }
- colorModel = cb.createRGB(sampleModel);
- }
- }
- sampleDimensions = sd;
- }
-
- /**
- * Returns the sample dimensions for the bands and prepares metadata related to them.
- *
- * @return the sample dimensions for all bands.
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if an error occurred in {@link CoverageModifier}.
- */
- public final List<SampleDimension> sampleDimensions() throws DataStoreException {
- if (sampleDimensions == null) {
- sampleDimensions(true);
- }
- return Containers.viewAsUnmodifiableList(sampleDimensions);
- }
-
- /**
- * Creates the grid geometry and opportunistically prepares metadata related to it.
- * This method should be invoked exactly once, preferably after {@link #sampleDimensions()}.
- * It may be invoked not at all when this object is used for building a tile instead of an image.
- *
- * @todo Need to add information from the {@code ExtraDimensionProperty} box.
- * These information include name, minimum, maximum and resolution.
- *
- * @return the grid geometry.
- * @throws DataStoreException if the "grid to <abbr>CRS</abbr>" transform cannot be created.
- */
- public final GridGeometry gridGeometry() throws DataStoreException {
- final var extent = new GridExtent(width, height);
- MathTransform gridToCRS = null;
- if (affine != null) {
- gridToCRS = affine.toMathTransform();
- }
- CoordinateReferenceSystem crs = null;
- if (crsDefinition != null) {
- crs = crsDefinition.toCRS(store.listeners()); // May stil be null.
- }
- var gridGeometry = new GridGeometry(extent, PixelInCell.CELL_CORNER, gridToCRS, crs);
- metadata().addSpatialRepresentation(null, gridGeometry, false);
- if (gridGeometry.isDefined(GridGeometry.ENVELOPE)) {
- metadata.addExtent(gridGeometry.getEnvelope(), store.listeners());
- }
- var source = new CoverageModifier.Source(store, imageIndex, dataType);
- return store.customizer.customize(source, gridGeometry);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java
deleted file mode 100644
index 2db0d56ebb..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.io.IOException;
-import java.awt.image.SampleModel;
-import java.awt.image.BufferedImage;
-import java.awt.image.RasterFormatException;
-import javax.imageio.ImageReader;
-import javax.imageio.ImageTypeSpecifier;
-import javax.imageio.spi.IIORegistry;
-import javax.imageio.spi.ImageReaderSpi;
-import org.apache.sis.io.stream.ChannelDataInput;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.IllegalOpenParameterException;
-import org.apache.sis.storage.UnsupportedEncodingException;
-import org.apache.sis.storage.isobmff.ByteRanges;
-import org.apache.sis.util.ArraysExt;
-
-
-/**
- * An image read with Image I/O. This is mainly for <abbr>JPEG</abbr> compression,
- * but this class can be used with any format supported by Image I/O.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-final class FromImageIO extends Image {
- /**
- * Index of the image to read.
- */
- private static final int IMAGE_INDEX = 0;
-
- /**
- * Provider of image readers.
- */
- private final ImageReaderSpi provider;
-
- /**
- * Creates a new tile.
- *
- * @param builder helper class for building the grid geometry and sample dimensions.
- * @param locator the provider of bytes to read from the <abbr>ISOBMFF</abbr> box.
- * @param provider provider of image readers for decoding the payload.
- * @param name a name that identifies this image, for debugging purpose.
- * @throws RasterFormatException if the sample model cannot be created.
- */
- FromImageIO(final CoverageBuilder builder, final ByteRanges.Reader locator, final ImageReaderSpi provider, final String name) {
- super(builder, locator, name);
- this.provider = provider;
- }
-
- /**
- * First an image reader provider by format name.
- *
- * @param format name of the desired format.
- * @return image provider for the given format.
- * @throws UnsupportedEncodingException if no provider was found for the specified format.
- */
- static ImageReaderSpi byFormatName(final String format) throws UnsupportedEncodingException {
- var rg = IIORegistry.getDefaultInstance();
- var it = rg.getServiceProviders(
- ImageReaderSpi.class,
- (spi) -> ArraysExt.containsIgnoreCase(((ImageReaderSpi) spi).getFormatNames(), format),
- true);
- if (it.hasNext()) {
- return it.next();
- } else {
- throw new UnsupportedEncodingException("Could not find a JPEG reader.");
- }
- }
-
- /**
- * Sets the input of the given reader to an input stream positioned at the beginning of the image.
- *
- * @param reader the image reader for which to set the input.
- * @param input the input from which to read bytes.
- * @param ranges the ranges of bytes to read.
- * @throws DataStoreException if the input cannot be set because of its type.
- * @throws IOException if an I/O error occurred while setting the input.
- */
- private void setReaderInput(final ImageReader reader, final ChannelDataInput input, final ByteRanges ranges)
- throws DataStoreException, IOException
- {
- input.seek(ranges.offset());
- input.buffer.order(byteOrder);
- try {
- reader.setInput(input, true, true);
- } catch (IllegalArgumentException e) {
- throw new IllegalOpenParameterException("Not an image input stream.", e);
- }
- }
-
- /**
- * Returns the sample model and color model of this image.
- * The size of the sample model is the tile size.
- *
- * @param store the store that opened the <abbr>HEIF</abbr> file.
- * @throws DataStoreContentException if this image does not include information about the sample/color models.
- * @throws DataStoreException if the input cannot be set because of its type.
- * @throws IOException if an I/O error occurred while setting the input.
- */
- @Override
- protected ImageTypeSpecifier getImageType(final GeoHeifStore store) throws DataStoreException, IOException {
- final ImageReader reader = provider.createReaderInstance();
- final var ranges = new ByteRanges();
- locator.resolve(0, -1, ranges);
- setReaderInput(reader, ranges.viewAsConsecutiveBytes(store.ensureOpen()), ranges);
- final var it = reader.getImageTypes(IMAGE_INDEX);
- ImageTypeSpecifier specifier;
- if (it.hasNext()) {
- specifier = it.next();
- } else {
- return super.getImageType(store);
- }
- final int width = reader.getTileWidth (IMAGE_INDEX);
- final int height = reader.getTileHeight(IMAGE_INDEX);
- SampleModel sampleModel = specifier.getSampleModel();
- if (sampleModel.getWidth() != width || sampleModel.getHeight() != height) {
- sampleModel = specifier.getSampleModel(width, height);
- specifier = new ImageTypeSpecifier(specifier.getColorModel(), sampleModel);
- }
- reader.dispose();
- return specifier;
- }
-
- /**
- * Computes the range of bytes that will be needed for reading a single tile of this image.
- *
- * @param context where to store the ranges of bytes.
- * @throws DataStoreException if an error occurred while computing the range of bytes.
- */
- @Override
- protected Reader computeByteRanges(final ImageResource.Coverage.ReadContext context) throws DataStoreException {
- locator.resolve(0, -1, context);
- return (final ChannelDataInput input) -> {
- final ImageReader reader = context.getReader(provider);
- setReaderInput(reader, input, context);
- final BufferedImage image;
- try {
- image = reader.readTile(IMAGE_INDEX,
- Math.toIntExact(context.subTileX),
- Math.toIntExact(context.subTileY));
- } finally {
- reader.setInput(null);
- }
- return image.getRaster();
- };
- }
-}
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
deleted file mode 100644
index 5e71810bb5..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStore.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.net.URI;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.nio.file.StandardOpenOption;
-import java.util.Collection;
-import java.util.Optional;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import org.opengis.util.LocalName;
-import org.opengis.util.NameSpace;
-import org.opengis.util.NameFactory;
-import org.opengis.util.GenericName;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.maintenance.ScopeCode;
-import org.opengis.parameter.ParameterValueGroup;
-import org.apache.sis.io.stream.ChannelDataInput;
-import org.apache.sis.io.stream.ChannelImageInputStream;
-import org.apache.sis.io.stream.IOUtilities;
-import org.apache.sis.storage.Aggregate;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreProvider;
-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.MetadataBuilder;
-import org.apache.sis.storage.base.URIDataStore;
-import org.apache.sis.storage.modifier.CoverageModifier;
-import org.apache.sis.storage.event.StoreListeners;
-import org.apache.sis.storage.isobmff.Root;
-import org.apache.sis.storage.isobmff.Reader;
-import org.apache.sis.util.collection.Containers;
-import org.apache.sis.util.collection.TreeTable;
-import org.apache.sis.util.iso.DefaultNameFactory;
-import org.apache.sis.util.resources.Errors;
-
-
-/**
- * A data store backed by GeoHEIF files.
- *
- * @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;
-
- /**
- * The data store identifier created from the filename, or {@code null} if none.
- * Defined as a namespace for use as the scope of children resources (the images).
- * May be {@code null}.
- *
- * @see #createComponentName(String)
- */
- private final NameSpace namespace;
-
- /**
- * The factory to use for creating resource names in the namespace of this store.
- *
- * @see #createComponentName(String)
- */
- private final NameFactory nameFactory;
-
- /**
- * The stream from which to read the data, or {@code null} if this store has been closed.
- * {@code GeoHeifStore} needs only a {@link ChannelDataInput} for its own operations.
- * But the {@code ChannelImageInputStream} sub-type is used because we need Image I/O
- * when reading tiles encoded as a <abbr>JPEG</abbr> images.
- *
- * @see #ensureOpen()
- * @see #close()
- */
- private volatile ChannelImageInputStream input;
-
- /**
- * The <abbr>ISO</abbr> <abbr>BMFF</abbr> boxes parsed from the file header.
- * {@code Root} is not an existing type of box, but only a container.
- */
- private Root root;
-
- /**
- * The metadata, or {@code null} if not yet created.
- *
- * @see #getMetadata()
- */
- private Metadata metadata;
-
- /**
- * Description of images in this GeoHEIF files.
- * This array is created only when first needed.
- *
- * @see #components()
- */
- private Resource[] content;
-
- /**
- * The user-specified method for customizing the grid geometry and band definitions. Never {@code null}.
- */
- final CoverageModifier customizer;
-
- /**
- * Creates a new GeoHEIF store from the given file, URL or stream object.
- * This constructor invokes {@link StorageConnector#closeAllExcept(Object)},
- * keeping open only the needed resource.
- *
- * @param provider the factory that created this {@code DataStore} instance, or {@code null} if unspecified.
- * @param connector information about the storage (URL, stream, <i>etc</i>).
- * @throws DataStoreException if an error occurred while opening the GeoHEIF file.
- */
- 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();
- if (location != null) {
- String filename = IOUtilities.filenameWithoutExtension(input.filename);
- namespace = nameFactory.createNameSpace(nameFactory.createLocalName(null, filename), null);
- } else {
- namespace = null;
- }
- }
-
- /**
- * Returns the parameters used to open this GeoHEIF data store.
- * The parameters are described by {@link GeoHeifStoreProvider#getOpenParameters()} and contains at least
- * a parameter named {@value org.apache.sis.storage.DataStoreProvider#LOCATION} with a {@link URI} value.
- * The return value may be empty if the storage input cannot be described by a URI
- * (for example a GeoHEIF file reading directly from a {@link java.nio.channels.ReadableByteChannel}).
- *
- * @return parameters used for opening this data store.
- */
- @Override
- public Optional<ParameterValueGroup> getOpenParameters() {
- return Optional.ofNullable(URIDataStore.parameters(provider, location));
- }
-
- /**
- * Returns the paths to the files used by this GeoHEIF store.
- *
- * @return files used by this GeoHEIF store.
- * @throws DataStoreException if an error occurred while preparing the set of files.
- */
- @Override
- public Optional<FileSet> getFileSet() throws DataStoreException {
- if (path != null) {
- return Optional.of(new FileSet(path));
- }
- return Optional.empty();
- }
-
- /**
- * Returns an identifier constructed from the name of the <abbr>HEIF</abbr> file.
- * An identifier is available only if the storage input specified at construction time was something convertible to
- * {@link java.net.URI}, for example an {@link java.net.URL}, {@link java.io.File} or {@link java.nio.file.Path}.
- *
- * @return the identifier derived from the filename.
- * @throws DataStoreException if an error occurred while fetching the identifier.
- */
- @Override
- public Optional<GenericName> getIdentifier() throws DataStoreException {
- return (namespace != null) ? Optional.of(namespace.name()) : Optional.empty();
- }
-
- /**
- * Creates a name for a component of this data store.
- *
- * @param tip component name as the tip of the qualified name.
- * @return a name in the namespace of this store.
- */
- final LocalName createComponentName(final String tip) {
- return nameFactory.createLocalName(namespace, tip);
- }
-
- /**
- * Ensures that the data store is still open.
- *
- * @return the non-null input channel.
- * @throws DataStoreClosedException if the data store is closed.
- */
- final ChannelDataInput ensureOpen() throws DataStoreClosedException {
- assert Thread.holdsLock(this);
- ChannelDataInput in = input;
- if (in != null) {
- return in;
- }
- throw new DataStoreClosedException(getLocale(), GeoHeifStoreProvider.NAME, StandardOpenOption.READ);
- }
-
- /**
- * Returns the root node which contains all boxes of the file.
- *
- * @return all boxes of the file.
- * @throws DataStoreException if an error occurred while parsing the root.
- */
- private Root root() throws DataStoreException {
- final ChannelDataInput in = ensureOpen(); // Unconditional for making sure that the file is open.
- if (root == null) {
- try {
- root = new Root(new Reader(in, listeners));
- } catch (IOException e) {
- throw new DataStoreException(Errors.format(Errors.Keys.CanNotOpen_1, in.filename), e);
- }
- }
- return root;
- }
-
- /**
- * Returns information about the dataset as a whole. The returned metadata object can contain information
- * such as the spatiotemporal extent of the dataset, contact information about the creator or distributor,
- * data quality, usage constraints and more.
- *
- * @return information about the dataset.
- * @throws DataStoreException if an error occurred while reading the data.
- */
- @Override
- public synchronized Metadata getMetadata() throws DataStoreException {
- if (metadata == null) {
- final var builder = new MetadataBuilder();
- root().metadata(builder);
- builder.setISOStandards(true);
- builder.setPredefinedFormat(GeoHeifStoreProvider.NAME, listeners, true);
- builder.addFormatReaderSIS(GeoHeifStoreProvider.NAME);
- builder.addResourceScope(ScopeCode.valueOf("COVERAGE"), null);
- getIdentifier().ifPresent((id) -> builder.addIdentifier(id, MetadataBuilder.Scope.ALL));
- metadata = customizer.customize(new CoverageModifier.Source(this), builder.build());
- }
- return metadata;
- }
-
- /**
- * Returns <abbr>HEIF</abbr> boxes and their fields as a tree for debugging purpose.
- * The boxes appear in the order they are declared in the file.
- * Only the boxes and fields recognized by this <abbr>HEIF</abbr> store implementation are shown.
- * The table contains the following columns:
- *
- * <ul>
- * <li>{@linkplain TableColumn#NAME}</li>
- * <li>{@linkplain TableColumn#VALUE}</li>
- * <li>{@linkplain TableColumn#VALUE_AS_TEXT}</li>
- * </ul>
- *
- * <h4>Usage and performance note</h4>
- * This method should not be invoked during normal operations. The {@linkplain #getMetadata() standard metadata}
- * are preferred because they allow abstraction of data format details. Native metadata should be used only when
- * an information does not appear in standard metadata, or for debugging purposes.
- *
- * <p>Since this method should not be invoked in normal operations, it has not been tuned for performance.
- * Invoking this method may cause a lot of {@linkplain java.nio.channels.SeekableByteChannel#position(long)
- * seek operations}.</p>
- *
- * @return resources information structured in an implementation-specific way.
- * @throws DataStoreException if an error occurred while reading the metadata.
- *
- * @todo It is sometime possible, through the tree cell values, to modify the content of internal arrays.
- * This is unsafe, we should makes this implementation safer before this module is released.
- */
- @Override
- public synchronized Optional<TreeTable> getNativeMetadata() throws DataStoreException {
- return Optional.of(root().toTree(getDisplayName(), true));
- }
-
- /**
- * Returns the children resources of this aggregate.
- *
- * @return all children resources that are components of this aggregate.
- * @throws DataStoreException if an error occurred while fetching the components.
- */
- @Override
- public synchronized Collection<? extends Resource> components() throws DataStoreException {
- if (content == null) try {
- final var builder = new ResourceBuilder(this, root());
- content = builder.build();
- } catch (IOException e) {
- throw new DataStoreException(e);
- }
- return Containers.viewAsUnmodifiableList(content);
- }
-
- /**
- * Logs a warning with a message built from localized resources. This method pretends that the
- * warning has been emitted by {@link #components()}. It should be the case, but often indirectly.
- *
- * @param errorKey one of {@link Errors.Keys} values.
- * @param args the parameter for the log message, which may be an array.
- */
- final void warning(final short errorKey, final Object args) {
- warning(Errors.forLocale(getLocale()).createLogRecord(Level.WARNING, errorKey, args));
- }
-
- /**
- * Logs a warning emitted (usually indirectly) by {@link #components()}.
- */
- final void warning(final LogRecord record) {
- record.setSourceClassName(GeoHeifStore.class.getCanonicalName());
- record.setSourceMethodName("components");
- listeners.warning(record);
- }
-
- /**
- * The listeners where to send warnings.
- */
- final StoreListeners listeners() {
- return listeners;
- }
-
- /**
- * Closes this GeoHEIF store and releases any underlying resources.
- * This method can be invoked asynchronously for interrupting a long reading process.
- *
- * @throws DataStoreException if an error occurred while closing the GeoHEIF file.
- */
- @Override
- @SuppressWarnings("ConvertToTryWithResources")
- public void close() throws DataStoreException {
- try {
- listeners.close(); // Should never fail.
- ChannelDataInput in = input;
- if (in != null) {
- input = null;
- in.channel.close();
- }
- } catch (IOException e) {
- throw new DataStoreException(e);
- } finally {
- synchronized (this) {
- root = null;
- content = null;
- metadata = null;
- }
- }
- }
-}
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
deleted file mode 100644
index 1a42e93c39..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/GeoHeifStoreProvider.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.nio.ByteBuffer;
-import org.opengis.parameter.ParameterDescriptorGroup;
-import org.apache.sis.parameter.ParameterBuilder;
-import org.apache.sis.storage.Aggregate;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreProvider;
-import org.apache.sis.storage.ProbeResult;
-import org.apache.sis.storage.StorageConnector;
-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.URIDataStoreProvider;
-import org.apache.sis.storage.tiling.TiledResource;
-import org.apache.sis.storage.isobmff.base.FileType;
-
-
-/**
- * The provider of {@code GeoHeifStore} instances.
- * Given a {@link StorageConnector} input, this class tries to instantiate a {@link GeoHeifStore}.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-@StoreMetadata(formatName = GeoHeifStoreProvider.NAME,
- fileSuffixes = {"heif", "heij", "heic", "avif"},
- capabilities = {Capability.READ},
- resourceTypes = {Aggregate.class, GridCoverageResource.class, TiledResource.class})
-public class GeoHeifStoreProvider extends DataStoreProvider {
- /**
- * Format name.
- */
- static final String NAME = "GeoHEIF";
-
- /**
- * The MIME type for GeoHEIF files.
- */
- private static final String MIME_TYPE = "image/heif";
-
- /**
- * The parameter descriptor to be returned by {@link #getOpenParameters()}.
- */
- private static final ParameterDescriptorGroup OPEN_DESCRIPTOR;
- static {
- final var builder = new ParameterBuilder();
- OPEN_DESCRIPTOR = builder.addName(NAME).createGroup(URIDataStoreProvider.LOCATION_PARAM);
- }
-
- /**
- * Creates a new provider.
- */
- public GeoHeifStoreProvider() {
- }
-
- /**
- * Returns a generic name for this data store, used mostly in warnings or error messages.
- *
- * @return a short name or abbreviation for the data format.
- */
- @Override
- public String getShortName() {
- 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;
- }
-
- /**
- * Returns the MIME type if the given storage appears to be supported by {@code GeoHeifStore}.
- * A {@linkplain ProbeResult#isSupported() supported} status does not guarantee that reading
- * or writing will succeed, only that there appears to be a reasonable chance of success
- * based on a brief inspection of the file header.
- *
- * @param connector information about the storage (URL, stream, <i>etc</i>).
- * @return a {@linkplain ProbeResult#isSupported() supported} status with the MIME type
- * if the given storage seems to be readable by {@link GeoHeifStore} instances.
- * @throws DataStoreException if an I/O error occurred.
- */
- @Override
- public ProbeResult probeContent(final StorageConnector connector) throws DataStoreException {
- return probeContent(connector, ByteBuffer.class, (buffer) -> {
- if (buffer.remaining() < 2 * Integer.BYTES) {
- return ProbeResult.INSUFFICIENT_BYTES;
- }
- // Default buffer order is big endian.
- final int size = buffer.getInt();
- if (size == 0 || size == 1 || size >= 4*Integer.BYTES) {
- switch (buffer.getInt()) { // Box identifier.
- case FileType.BOXTYPE: {
- return new ProbeResult(true, MIME_TYPE, null);
- }
- }
- }
- return ProbeResult.UNSUPPORTED_STORAGE;
- });
- }
-
- /**
- * Creates a {@code GeoHeifStore} instance associated with this provider.
- *
- * @param connector information about the storage (URL, stream, <i>etc</i>).
- * @return a data store instance associated with this provider for the given storage.
- * @throws DataStoreException if an error occurred while creating the data store instance.
- */
- @Override
- public DataStore open(final StorageConnector connector) throws DataStoreException {
- return new GeoHeifStore(this, connector);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Group.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Group.java
deleted file mode 100644
index e2b8caa455..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Group.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.util.Collection;
-import java.util.Optional;
-import org.opengis.util.GenericName;
-import org.apache.sis.storage.Aggregate;
-import org.apache.sis.storage.AbstractResource;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.util.collection.Containers;
-
-
-/**
- * An aggregation of other resources.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-final class Group extends AbstractResource implements Aggregate {
- /**
- * Name of this group.
- */
- private final GenericName name;
-
- /**
- * The components of this group.
- */
- private final GridCoverageResource[] components;
-
- /**
- * Creates a new group of grid coverage resources.
- *
- * @param store the parent of this aggregate.
- * @param name the name of this aggregate.
- * @param components the child resources.
- */
- Group(final GeoHeifStore store, final GenericName name, final GridCoverageResource[] components) {
- super(store);
- this.name = name;
- this.components = components;
- }
-
- /**
- * Returns the name of this aggregate.
- */
- @Override
- public Optional<GenericName> getIdentifier() {
- return Optional.of(name);
- }
-
- /**
- * Returns all components of this aggregate.
- */
- @Override
- public Collection<GridCoverageResource> components() {
- return Containers.viewAsUnmodifiableList(components);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java
deleted file mode 100644
index b04b221e54..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.nio.ByteOrder;
-import java.io.IOException;
-import java.awt.image.Raster;
-import java.awt.image.RasterFormatException;
-import javax.imageio.ImageTypeSpecifier;
-import org.apache.sis.io.stream.ChannelDataInput;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.isobmff.ByteRanges;
-
-
-/**
- * A single image ({@code 'unci'} item type) from the HEIF file.
- * An image may be used as a tile in a larger image ({@code 'grid'} item type).
- * In the uncompressed case, the image may be implicitly tiled if {@link #numXTiles} is greater than 1.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-abstract class Image {
- /**
- * A name that identifies this image, for debugging purposes.
- */
- private final String name;
-
- /**
- * Number of columns and rows in the tile matrix.
- * This is usually not supported for compressed tiles.
- */
- protected final int numXTiles, numYTiles;
-
- /**
- * The provider of bytes to read from the <abbr>ISOBMFF</abbr> box.
- * The bytes are read from the {@link ChannelDataInput} at a position specified by the box.
- */
- protected final ByteRanges.Reader locator;
-
- /**
- * The byte order to use for reading the sample values of the image.
- */
- protected final ByteOrder byteOrder;
-
- /**
- * Creates a new tile.
- *
- * @param builder helper class for building the grid geometry and sample dimensions.
- * @param locator the provider of bytes to read from the <abbr>ISOBMFF</abbr> box.
- * @param name a name that identifies this image, for debugging purpose.
- * @throws RasterFormatException if the sample model cannot be created.
- */
- protected Image(final CoverageBuilder builder, final ByteRanges.Reader locator, final String name) {
- this.locator = locator;
- this.name = name;
- byteOrder = builder.byteOrder();
- numXTiles = builder.numTiles(0);
- numYTiles = builder.numTiles(1);
- // Do NOT invoke `builder.sampleModel()`, because that information is not available for all types.
- }
-
- /**
- * A supplier of image, used for deferred computation.
- */
- @FunctionalInterface
- interface Supplier {
- Image get() throws DataStoreException;
- }
-
- /**
- * Returns the sample model and color model of this image.
- * For uncompressed image, this information is not available and this method always throws an exception.
- * For some other profiles such as JPEG, the sample and color models are encoded in this image payload.
- * The size of the sample model shall be the tile size.
- *
- * @param store the store that opened the <abbr>HEIF</abbr> file.
- * @throws DataStoreContentException if this image does not include information about the sample/color models.
- * @throws DataStoreException if another problem occurred with the content of the <abbr>HEIF</abbr> file.
- * @throws IOException if an I/O error occurred.
- */
- protected ImageTypeSpecifier getImageType(final GeoHeifStore store) throws DataStoreException, IOException {
- throw new DataStoreContentException("Cannot determine the sample model.");
- }
-
- /**
- * Computes the range of bytes that will be needed for reading a single tile of this image.
- * There will be usually a single range of bytes per tile, but this method allows the bytes
- * to be spread over more than one extent.
- *
- * <p>This method does not read the bytes immediately.
- * Instead, it returns a function which will be executed later for finishing the read operation.</p>
- *
- * @param context where to store the ranges of bytes.
- * @return the function to invoke later for reading the tile.
- * @throws DataStoreException if an error occurred while computing the range of bytes.
- */
- protected abstract Reader computeByteRanges(ImageResource.Coverage.ReadContext context) throws DataStoreException;
-
- /**
- * Reads a single tile from a sequence of bytes.
- * Instances are prepared and returned by {@link #computeByteRanges computeByteRanges(…)}.
- */
- @FunctionalInterface
- protected interface Reader {
- /**
- * Reads a single tile from a sequence of bytes in the given input.
- * The implementation is responsible for setting the stream position before to start reading bytes.
- * The given {@code input} will view all bytes after the initial position as if they were stored in
- * one single large extent.
- * Implementations should ignore the fact that the sequence of bytes may be spread in many extents.
- *
- * @param input a view of the byte sequences as if they were stored in one single large extent.
- * @return tile filled with the pixel values read by this method.
- */
- Raster readTile(ChannelDataInput input) throws Exception;
- }
-
- /**
- * Returns the name of this image, for debugging purposes.
- *
- * @return the name of this image.
- */
- @Override
- public String toString() {
- return name;
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java
deleted file mode 100644
index 32439c4d07..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Optional;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import static java.lang.Math.addExact;
-import static java.lang.Math.multiplyExact;
-import java.awt.image.ColorModel;
-import java.awt.image.Raster;
-import java.awt.image.RasterFormatException;
-import java.awt.image.SampleModel;
-import java.awt.image.WritableRaster;
-import javax.imageio.ImageReader;
-import javax.imageio.spi.ImageReaderSpi;
-import org.opengis.metadata.Metadata;
-import org.opengis.util.GenericName;
-import org.apache.sis.coverage.SampleDimension;
-import org.apache.sis.coverage.grid.GridCoverage;
-import org.apache.sis.coverage.grid.GridGeometry;
-import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.base.StoreResource;
-import org.apache.sis.storage.base.TiledGridCoverage;
-import org.apache.sis.storage.base.TiledGridResource;
-import org.apache.sis.storage.isobmff.ByteRanges;
-import org.apache.sis.io.stream.ChannelDataInput;
-
-
-/**
- * A single image as a grid coverage resource.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-final class ImageResource extends TiledGridResource implements StoreResource {
- /**
- * The data store that produced this resource.
- *
- * @see #getOriginator()
- */
- private final GeoHeifStore store;
-
- /**
- * Identifier of this resource.
- *
- * @see #getIdentifier()
- */
- private final GenericName identifier;
-
- /**
- * The metadata, initially in a mutable state.
- * Modifications may still happen before the metadata is returned to the user.
- * These modifications may happen indirectly, for example through the {@link CoverageBuilder}
- * that created this metadata if that builder is still used for creating more resources.
- *
- * @see #createMetadata()
- */
- private final DefaultMetadata metadata;
-
- /**
- * The grid geometry of this grid coverage resource.
- *
- * @see #getGridGeometry()
- */
- private final GridGeometry gridGeometry;
-
- /**
- * Description of the bands.
- *
- * @see #getSampleDimensions()
- */
- private final List<SampleDimension> sampleDimensions;
-
- /**
- * Number of columns in the tile matrix. This is the offset to add to the index of a tile
- * in the {@link #tiles} array for moving to the tile in the same column of the next row.
- */
- private final int tileMatrixRowStride;
-
- /**
- * The sample model of each tile. The model size is the tile size.
- *
- * @see #getSampleModel(int[])
- */
- private final SampleModel sampleModel;
-
- /**
- * The color model of the image.
- *
- * @see #getColorModel(int[])
- */
- private final ColorModel colorModel;
-
- /**
- * Information about the images that constitute the tiles of this grid. Shall contain at least 1 element.
- * The {@link Image} elements contain only metadata such as position in the file, not actual pixel values.
- * All tiles shall have the same size.
- */
- private final Image[] tiles;
-
- /**
- * Creates a new grid coverage resource for an image.
- * Exactly one of {@code tiles} and {@code image} arguments shall be non-null.
- *
- * @param builder helper class for building the grid geometry and sample dimensions.
- * @param tiles the images that constitute the tiles, or {@code null} if {@code reader} is provided.
- * @param image the single tile for the whole image, or {@code null} if {@code tiles} is provided.
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if the "grid to <abbr>CRS</abbr>" transform cannot be created.
- */
- ImageResource(final CoverageBuilder builder, Image[] tiles, final Image.Supplier image) throws DataStoreException {
- super(builder.store);
- this.store = builder.store;
- identifier = builder.name();
- sampleDimensions = builder.sampleDimensions();
- gridGeometry = builder.gridGeometry(); // Should be after `sampleDimensions()`.
- if (tiles == null) {
- // Shall be after the call to `sampleDimensions()`.
- tiles = new Image[] {
- image.get() // Actual I/O operations are deferred (not in this call).
- };
- }
- this.tiles = tiles;
- sampleModel = builder.sampleModel();
- colorModel = builder.colorModel();
- metadata = builder.metadata().build(); // Not `buildAndFreeze()` as the metadata may still be modified.
- tileMatrixRowStride = builder.numTiles(0);
- }
-
- /**
- * Returns the data store that produced this resource.
- */
- @Override
- public final DataStore getOriginator() {
- return store;
- }
-
- /**
- * Returns the resource persistent identifier if available.
- */
- @Override
- public final Optional<GenericName> getIdentifier() {
- return Optional.of(identifier);
- }
-
- /**
- * Invoked the first time that the user requested a description of this resource.
- *
- * <h4>Implementation note</h4>
- * The {@link #getMetadata()} method, which is invoking this method, will freeze this metadata.
- * Therefore, if the metadata was still modifiable, it will usually not be modifiable anymore
- * after this method call.
- */
- @Override
- protected Metadata createMetadata() {
- return metadata;
- }
-
- /**
- * Returns the valid extent of grid coordinates together with the conversion from those grid
- * coordinates to real world coordinates.
- */
- @Override
- public final GridGeometry getGridGeometry() {
- return gridGeometry;
- }
-
- /**
- * Returns the ranges of sample values together with the conversion from samples to real values.
- */
- @Override
- @SuppressWarnings("ReturnOfCollectionOrArrayField")
- public final List<SampleDimension> getSampleDimensions() {
- return sampleDimensions;
- }
-
- /**
- * Returns the size of tiles in this resource.
- * The length of the returned array is the number of dimensions.
- */
- @Override
- protected final int[] getTileSize() {
- return new int[] {
- sampleModel.getWidth(),
- sampleModel.getHeight()
- };
- }
-
- /**
- * Returns the Java2D sample model describing pixel type and layout for the specified bands.
- * The raster size shall be the two first dimensions of the {@linkplain #getTileSize() tile size}.
- *
- * <p>If the {@code bands} argument is non-null, then this method returns {@code null} for telling
- * the caller to derive the sample model from {@code getSampleModel(null)}.</p>
- *
- * @param bands indices of desired bands, or {@code null} for all bands.
- * @return the sample model for tiles at full resolution, or {@code null}.
- */
- @Override
- protected final SampleModel getSampleModel(final int[] bands) {
- return (bands == null) ? sampleModel : null;
- }
-
- /**
- * Returns the Java2D color model for rendering images, or {@code null} if none.
- * The color model shall be compatible with the sample model returned by {@link #getSampleModel(int[])}.
- *
- * @param bands indices (not necessarily in increasing order) of desired bands, or {@code null} for all bands.
- * @return a color model compatible with {@link #getSampleModel(int[])}, or {@code null} if none.
- * @throws DataStoreException if an error occurred during color model construction.
- */
- @Override
- protected final ColorModel getColorModel(final int[] bands) throws DataStoreException {
- return (bands == null) ? colorModel : super.getColorModel(bands);
- }
-
- /**
- * Returns the object on which to perform synchronization.
- */
- @Override
- protected Object getSynchronizationLock() {
- return store;
- }
-
- /**
- * Loads a subset of the grid coverage represented by this resource.
- * While this method name suggests an immediate reading, the actual reading may be deferred.
- *
- * @param domain desired grid extent and resolution, or {@code null} for reading the whole domain.
- * @param ranges 0-based indices of sample dimensions to read, or {@code null} or an empty sequence for reading them all.
- * @return the grid coverage for the specified domain and ranges.
- * @throws DataStoreException if an error occurred while reading the grid coverage data.
- */
- @Override
- public final GridCoverage read(final GridGeometry domain, final int ... range) throws DataStoreException {
- try {
- synchronized (getSynchronizationLock()) {
- return preload(new Coverage(new Subset(domain, range)));
- }
- } catch (RuntimeException e) {
- throw new DataStoreException(e);
- }
- }
-
- /**
- * Grid coverage read from the enclosing resource.
- * Tiles are read from the storage only when first needed.
- *
- * <h2>Cell coordinates</h2>
- * When there is no subsampling, this coverage uses the same cell coordinates as the originating resource.
- * When there is a subsampling, cell coordinates in this coverage are divided by the subsampling factors.
- * Conversions are done by {@link #coverageToResourceCoordinate(long, int)}.
- *
- * <h2>Tile matrix coordinate (<abbr>TMC</abbr>)</h2>
- * Indices of tiles starts at (0, 0, …).
- * Each {@code Coverage} instance uses its own, independent, Tile Matrix Coordinates (<abbr>TMC</abbr>).
- */
- final class Coverage extends TiledGridCoverage {
- /**
- * Creates a new tiled grid coverage.
- *
- * @param subset description of the {@link TiledGridResource} subset to cover.
- * @throws ArithmeticException if the number of tiles overflows 32 bits integer arithmetic.
- */
- Coverage(TiledGridResource.Subset subset) {
- super(subset);
- }
-
- /**
- * Returns a human-readable identification of this coverage.
- */
- @Override
- protected GenericName getIdentifier() {
- return identifier;
- }
-
- /**
- * Returns all tiles in the given area of interest. Tile indices are relative to this {@code Coverage}:
- * (0,0) is the tile in the upper-left corner of this {@code Coverage} (not necessarily the upper-left
- * corner of the image in the {@link TiledGridResource}). This method must be thread-safe.
- *
- * @param iterator an iterator over the tiles that intersect the Area Of Interest specified by user.
- * @return tiles decoded from the enclosing resource.
- */
- @Override
- protected Raster[] readTiles(final TileIterator iterator) throws Exception {
- final var result = new Raster[iterator.tileCountInQuery];
- final var requests = new ReadContext[result.length];
- int count = 0;
- synchronized (getSynchronizationLock()) {
- try (final var context = new ReadContext(iterator)) {
- do {
- Raster raster = iterator.getCachedTile();
- if (raster != null) {
- result[iterator.getTileIndexInResultArray()] = raster;
- } else {
- requests[count++] = new ReadContext(context, ImageResource.this);
- }
- } while (iterator.next());
- /*
- * For any tile that was not in the cache, read them in the order they appear in the file.
- * The ranges of bytes of all tiles should be declared before to start the reading process,
- * for giving a chance to emit a single "HTTP range" request. Then, for each tile, `input`
- * may be replaced by a view hiding the fact that byte may be spread in more than one extent.
- */
- Arrays.sort(requests, 0, count);
- final ChannelDataInput input = store.ensureOpen();
- if (input.useRangeOfInterest()) {
- for (int i=0; i<count; i++) {
- requests[i].notify(input); // Implementation should take care of merging the ranges.
- }
- }
- for (int i=0; i<count; i++) {
- requests[i].readTile(input, result); // Implementation may create an `input` view.
- }
- }
- }
- return result;
- }
-
- /**
- * Context about a {@code readTile(…)} operation. Contains the tile to create, or
- * the image reader to use in the case of read operations delegated to Image I/O.
- */
- static final class ReadContext extends ByteRanges implements AutoCloseable {
- /**
- * Iterator over the tiles to read.
- */
- private final AOI iterator;
-
- /**
- * The image readers created for reading the tiles.
- */
- private final Map<ImageReaderSpi, ImageReader> readers;
-
- /**
- * The function to execute for reading the image as a tile.
- */
- private final Image.Reader reader;
-
- /**
- * 0-based index (column and row) of the tile to read inside the image to read.
- * This is a tile inside the {@linkplain #tile}, i.e. a second level of tiling.
- */
- final long subTileX, subTileY;
-
- /**
- * Creates a new read context.
- *
- * @param iterator iterator over the tiles to read.
- */
- private ReadContext(final AOI iterator) {
- this.iterator = iterator;
- this.readers = new HashMap<>();
- this.reader = null;
- this.subTileX = 0;
- this.subTileY = 0;
- }
-
- /**
- * Creates a context which is a snapshot of the given context at the current iterator position.
- *
- * @param parent the parent from which to create a snapshot.
- * @param tileX 0-based column index of the tile to read, starting from image left.
- * @param tileY 0-based row index of the tile to read, starting from image top.
- */
- private ReadContext(final ReadContext parent, final ImageResource owner) throws DataStoreException {
- this.iterator = new Snapshot(parent.iterator);
- this.readers = parent.readers;
- final long[] tileCoord = iterator.getTileCoordinatesInResource();
- final Image tile = owner.getTile(tileCoord[0], tileCoord[1]);
- subTileX = tileCoord[0] % tile.numXTiles;
- subTileY = tileCoord[1] % tile.numYTiles;
- reader = tile.computeByteRanges(this);
- }
-
- /**
- * Reads the tile and store the result in the given array.
- * The given input is the stream over the <abbr>HEIF</abbr> file
- * (not yet the view showing all bytes as if they were stored in a single extent).
- *
- * @param input the input from which to read bytes.
- * @param result where to store the result.
- */
- final void readTile(ChannelDataInput input, final Raster[] result) throws Exception {
- input = viewAsConsecutiveBytes(input);
- Raster raster = reader.readTile(input);
- raster = iterator.cache(iterator.moveRaster(raster));
- result[iterator.getTileIndexInResultArray()] = raster;
- }
-
- /**
- * Returns the destination raster. This method shall be invoked at most once per tile.
- * It may be invoked not at all if the read operation is delegated to Image I/O,
- * in which case the image reader will create the raster itself.
- *
- * @return a newly created, initially empty raster.
- */
- public WritableRaster createRaster() {
- return iterator.createRaster();
- }
-
- /**
- * Returns an image reader created by the given provider.
- * This method caches the first reader created by this method,
- * then returns the cached value in subsequent calls.
- *
- * @param spi the provider of image reader.
- * @return an image reader instance created by the given provider.
- * @throws IOException if an error occurred while creating the image reader.
- */
- public ImageReader getReader(final ImageReaderSpi spi) throws IOException {
- try {
- return readers.computeIfAbsent(spi, (factory) -> {
- try {
- return factory.createReaderInstance();
- } catch (IOException e) {
- throw new UncheckedIOException(e);
- }
- });
- } catch (UncheckedIOException e) {
- throw e.getCause();
- }
- }
-
- /**
- * Invoked after a sequence of tiles have been read.
- * This method disposes the image readers.
- */
- @Override
- public void close() {
- readers.values().forEach(ImageReader::dispose);
- }
- }
- }
-
- /**
- * Returns information (not pixel values) about the tile at the given tile coordinates.
- * The tile coordinates are in the tile matrix including the sub-divisions in each tile.
- * This method returns the image which contains the requested tile.
- *
- * @param tileX 0-based column index of the tile to read, starting from image left.
- * @param tileY 0-based row index of the tile to read, starting from image top.
- * @return information about the tile at the specified tile coordinates.
- */
- final Image getTile(long tileX, long tileY) {
- Image template = tiles[0]; // First tile taken as a template for all tiles.
- tileX /= template.numXTiles;
- tileY /= template.numYTiles;
- return tiles[Math.toIntExact(addExact(tileX, multiplyExact(tileY, tileMatrixRowStride)))];
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Pyramid.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Pyramid.java
deleted file mode 100644
index 58c4261ca1..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Pyramid.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.geoheif;
-
-import org.opengis.util.GenericName;
-import org.apache.sis.storage.AbstractResource;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.storage.isobmff.image.ImagePyramid;
-
-
-/**
- * A pyramid of images.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- *
- * @todo Not yet implemented. Not to integrate with {@code TiledGridCoverage}.
- * It will require completion of the work for making {@code TiledGridCoverage}.
- * an implementation of {@code TileMatrixSet}.
- */
-final class Pyramid extends AbstractResource {
- /**
- * Name of this pyramid.
- */
- private final GenericName name;
-
- /**
- * Creates a new pyramid.
- *
- * @param store the parent of this pyramid.
- * @param name the name of this pyramid.
- * @param components the child resources.
- */
- Pyramid(final GeoHeifStore store, final GenericName name, final ImagePyramid pyramid, final GridCoverageResource[] components) {
- super(store);
- this.name = name;
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java
deleted file mode 100644
index 087cabb903..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * 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.geoheif;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.awt.image.RasterFormatException;
-import java.io.IOException;
-import javax.imageio.spi.ImageReaderSpi;
-import org.opengis.util.GenericName;
-import org.apache.sis.util.ArraysExt;
-import org.apache.sis.storage.Resource;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.UnsupportedEncodingException;
-import org.apache.sis.storage.isobmff.Box;
-import org.apache.sis.storage.isobmff.ByteRanges;
-import org.apache.sis.storage.isobmff.Root;
-import org.apache.sis.storage.isobmff.base.EntityToGroup;
-import org.apache.sis.storage.isobmff.base.GroupList;
-import org.apache.sis.storage.isobmff.base.Meta;
-import org.apache.sis.storage.isobmff.base.ItemInfo;
-import org.apache.sis.storage.isobmff.base.ItemInfoEntry;
-import org.apache.sis.storage.isobmff.base.ItemLocation;
-import org.apache.sis.storage.isobmff.base.ItemProperties;
-import org.apache.sis.storage.isobmff.base.ItemPropertyAssociation;
-import org.apache.sis.storage.isobmff.base.SingleItemTypeReference;
-import org.apache.sis.storage.isobmff.base.ItemReference;
-import org.apache.sis.storage.isobmff.base.MediaData;
-import org.apache.sis.storage.isobmff.base.PrimaryItem;
-import org.apache.sis.storage.isobmff.image.DerivedImageReference;
-import org.apache.sis.storage.isobmff.image.ImagePyramid;
-import org.apache.sis.util.resources.Errors;
-
-
-/**
- * Helper class for building the resources of a GeoHEIF file.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-final class ResourceBuilder {
- /**
- * The data store for which the resources are built.
- */
- private final GeoHeifStore store;
-
- /**
- * Identifier of the primary item. Should contain at most one element, but we are paranoiac.
- */
- private final List<PrimaryItem> primaryItem;
-
- /**
- * The location of items in the stream of bytes.
- * Keys are the {@link ItemLocation.Item#itemID} value of the associated map value.
- */
- private final Map<Integer, ItemLocation.Item> itemLocations;
-
- /**
- * Various properties (image size, coordinate reference system, <i>etc.</i>).
- * They should be inferred from exactly one {@link ItemProperties} instance.
- * If nevertheless many instances are found, their content will be merged.
- * Keys are {@link ItemPropertyAssociation.Entry#itemID} values.
- */
- private final Map<Integer, ItemProperties.ForID> properties;
-
- /**
- * Information about all resources, in the order the were found in the file.
- * Keys are resource identifiers, or 0 for the {@linkplain #primaryItem}.
- * Keys are {@link ItemInfoEntry#itemID} values of the associated map value.
- * Each list should contain only one item, but this class nevertheless accept many.
- * Note that some items may be members of a group such as a pyramid.
- */
- private final Map<Integer, List<ItemInfoEntry>> itemInfos;
-
- /**
- * References from the resources to other resources.
- * The main usage is for a tiled image referencing each tile as an individual image.
- * May be {@code null} if no such information was found.
- */
- private SingleItemTypeReference[] references;
-
- /**
- * Helper objects for building coverages.
- * The internal state of each builder depends only on the properties in the associated key.
- */
- private final Map<ItemProperties.ForID, CoverageBuilder> builders;
-
- /**
- * Names of boxes that were duplicated.
- * Used for logging a warning only once per type of box.
- */
- private final Set<String> duplicatedBoxes;
-
- /**
- * How to group the resources. If there is pyramids, they are declared here.
- */
- private final List<GroupList> groups;
-
- /**
- * Resources built by this class.
- */
- private final List<Resource> resources;
-
- /**
- * All data when no specific data where found in {@link #locations}.
- */
- private MediaData data;
-
- /**
- * Provider of Image I/O readers for the JPEG format, or {@code null} if not yet fetched.
- *
- * @see #readerJPEG()
- */
- private ImageReaderSpi readerJPEG;
-
- /**
- * Prepares a new builder from the information found in the boxes.
- *
- * @param store the data store for which the resources are built.
- * @param root the root node which contains all boxes of the file.
- */
- ResourceBuilder(final GeoHeifStore store, final Root root) {
- this.store = store;
- primaryItem = new ArrayList<>(3);
- itemLocations = new HashMap<>();
- properties = new HashMap<>();
- itemInfos = new LinkedHashMap<>();
- builders = new HashMap<>();
- duplicatedBoxes = new HashSet<>();
- groups = new ArrayList<>();
- resources = new ArrayList<>();
- for (final Box box : root.children) {
- switch (box.type()) {
- case MediaData.BOXTYPE: {
- data = (MediaData) box;
- break;
- }
- case Meta.BOXTYPE: {
- for (Box meta : ((Meta) box).children) {
- acceptMetaBox(meta);
- }
- break;
- }
- }
- }
- }
-
- /**
- * Takes the information from a box contained inside the {@link Meta} box.
- * Each type of box should appear only once. If, nevertheless, a type appears twice or more,
- * then this method concatenates the information if possible, or logs a warning otherwise.
- */
- private void acceptMetaBox(final Box box) {
- switch (box.type()) {
- // Name, content type, etc.
- case ItemInfo.BOXTYPE: {
- for (final ItemInfoEntry entry : ((ItemInfo) box).entries) {
- itemInfos.computeIfAbsent(entry.itemID, (itemID) -> new ArrayList<ItemInfoEntry>(3)).add(entry);
- }
- break;
- }
- // Where to find the sequence of bytes for an item
- case ItemLocation.BOXTYPE: {
- for (final ItemLocation.Item item : ((ItemLocation) box).items) {
- if (itemLocations.putIfAbsent(item.itemID, item) != null) {
- warning("Many locations found for the \"{0}\" resource.", getResourceName(item.itemID));
- }
- }
- break;
- }
- case ItemProperties.BOXTYPE: {
- ((ItemProperties) box).collect(properties);
- break;
- }
- case ItemReference.BOXTYPE: {
- references = ArraysExt.concatenate(references, ((ItemReference) box).references);
- break;
- }
- case GroupList.BOXTYPE: {
- groups.add((GroupList) box);
- break;
- }
- case PrimaryItem.BOXTYPE: {
- primaryItem.add((PrimaryItem) box);
- break;
- }
- }
- }
-
- /**
- * Logs a warning as if it was emitted by {@link GeoHeifStore#components()}.
- *
- * @param message the message with a "{0}" pattern to be replaced by the resource name.
- * @param name the resource name.
- */
- private void warning(String message, final String name) {
- message = message.replace("{0}", name);
- store.warning(new LogRecord(Level.WARNING, message));
- }
-
- /**
- * Returns the provider of JPEG readers.
- */
- private ImageReaderSpi readerJPEG() throws UnsupportedEncodingException {
- if (readerJPEG == null) {
- readerJPEG = FromImageIO.byFormatName("JPEG");
- }
- return readerJPEG;
- }
-
- /**
- * Returns the name for the item specified by the given identifier.
- * If no name is found, then the give {@code itemID} is formatted.
- *
- * @param itemID identifier of the item for which to get name.
- * @return a non-null item name.
- */
- private String getResourceName(final int itemID) {
- final List<ItemInfoEntry> info = itemInfos.get(itemID);
- if (info != null) {
- for (ItemInfoEntry entry : info) {
- if (entry.itemName != null) {
- return entry.itemName;
- }
- }
- }
- return Integer.toUnsignedString(itemID);
- }
-
- /**
- * Returns the location of data for the item having the given identifier, or {@code null} if none.
- *
- * @param itemID identifier of the item to read.
- * @return the item for locating the identified data, or {@code null} if none.
- * @throws DataStoreContentException if there is two ore more items for the same identifier.
- */
- private ByteRanges.Reader getLocationByIdentifier(final int itemID) throws DataStoreContentException {
- final Object item = itemLocations.get(itemID);
- if (item == null) {
- return data; // May be null.
- }
- if (item instanceof ItemLocation.Item) {
- return (ItemLocation.Item) item;
- }
- throw new DataStoreContentException(Errors.format(Errors.Keys.DuplicatedIdentifier_1, itemID));
- }
-
- /**
- * Creates all tiles referenced by the given box.
- *
- * @param coverage the builder of the coverage that contains the tiles.
- * @param items references to the tiles.
- * @param addTo a list where to add the tiles.
- * @throws DataStoreException if an error occurred while building a tile.
- * @return the builder used for building the first tile.
- */
- private void createTiles(final CoverageBuilder coverage, final SingleItemTypeReference items, final List<Image> addTo)
- throws DataStoreException, IOException
- {
- switch (items.type()) {
- // Only one case for now, but more cases may be added in the future.
- case DerivedImageReference.BOXTYPE: {
- for (final Integer toItem : items.toItemID) {
- final List<ItemInfoEntry> info = itemInfos.remove(toItem);
- if (info != null) {
- coverage.setTileBuilder(createImage(toItem, info, addTo));
- }
- }
- }
- break;
- }
- }
-
- /**
- * Creates the image for the item specified by the given identifier.
- * The resource may be an untiled image (item type {@code unci}) or a tiled image (item type {@code grid}).
- * If the {@code addTo} list is {@code null}, then the image is added to the {@linkplain #resources} list.
- *
- * <p>The given {@code info} list should contain exactly one entry.
- * This method nevertheless tries to be robust to cases where two or more entries exist,
- * but it shouldn't happen. The first entry that this method recognizes has precedence.</p>
- *
- * @param itemID identifier of the item to build as a coverage.
- * @param info information about the item, normally as a singleton but other size are nevertheless accepted.
- * @param addTo a list where to add the image, or {@code null} for adding to {@link #resources} instead.
- * @return the builder used for building the image. If many images were created, returns the first builder.
- * @throws RasterFormatException if the sample dimensions or sample model cannot be created.
- * @throws DataStoreException if another error occurred while building the image or resource.
- */
- private CoverageBuilder createImage(final Integer itemID, final List<ItemInfoEntry> info, final List<Image> addTo)
- throws DataStoreException, IOException
- {
- CoverageBuilder firstBuilder = null;
- for (final ItemInfoEntry entry : info) {
- final String name = entry.itemName();
- if (entry.itemProtectionIndex != 0) {
- warning("The \"{0}\" resource is protected.", name);
- continue;
- }
- final int imageIndex = (addTo != null ? addTo : resources).size();
- final ItemProperties.ForID itemProperties = properties.remove(itemID);
- final CoverageBuilder coverage = builders.computeIfAbsent(itemProperties,
- (p) -> new CoverageBuilder(store, imageIndex, p, duplicatedBoxes));
- if (coverage.reportUnknownBoxes(name)) {
- // Warning already logged by `reportUnknownBoxes(…)`.
- continue;
- }
- if (coverage.isEmpty()) {
- warning("The \"{0}\" resource is empty.", name);
- continue;
- }
- if (firstBuilder == null) {
- firstBuilder = coverage;
- }
- final ByteRanges.Reader locator;
- final Image.Supplier image;
- switch (entry.itemType) {
- default: {
- warning("Unsupported type " + Box.formatFourCC(entry.itemType) + " for the \"{0}\" resource.", name);
- continue;
- }
- /*
- * Tiled image: the tiles are defined as an array of images of type `ItemInfoEntry.UNCI`.
- * This case invokes this method recursively for each tile. The tiles are collected into
- * the `addTo` list. In the current implementation, if some tiles are themselves gridded
- * image, the list of tiles is flattened. However, we don't know if such nested grids
- * happen in practice and if this is the way to handle them.
- */
- case ItemInfoEntry.GRID: {
- if (references != null) {
- List<Image> tiles = null;
- for (final SingleItemTypeReference items : references) {
- if (items.fromItemID == entry.itemID) {
- if (tiles == null && (tiles = addTo) == null) {
- tiles = new ArrayList<>(items.toItemID.length);
- }
- createTiles(coverage, items, tiles);
- }
- }
- if (addTo == null && tiles != null && !tiles.isEmpty()) {
- builders.remove(itemProperties); // Builder cannot be reused after resource creation.
- resources.add(coverage.build(name, tiles));
- }
- }
- continue;
- }
- /*
- * JPEG compression, handled like `UNCI` except that the payload is decoded by Image I/O.
- * Contrarily to the `UNCI` case, it is okay to build the `Image` instance now because
- * the constructor will not ask for the sample model.
- */
- case ItemInfoEntry.JPEG: {
- final ImageReaderSpi reader = readerJPEG();
- locator = getLocationByIdentifier(itemID);
- final var prepared = new FromImageIO(coverage, locator, reader, name);
- if (locator != null) coverage.setImageLayout(prepared);
- image = () -> prepared;
- break;
- }
- /*
- * Untiled image, or a single tile of a tiled image. This case gets the box that contains
- * all pixel values (the "reader", as the byte values are behind an input stream), but the
- * actual reading is deferred.
- */
- case ItemInfoEntry.UNCI: {
- locator = getLocationByIdentifier(itemID);
- image = () -> new UncompressedImage(coverage, locator, name);
- break;
- }
- }
- if (locator == null) {
- warning("No data found for the \"{0}\" resource.", name);
- } else {
- if (addTo != null) {
- addTo.add(image.get());
- } else {
- builders.remove(itemProperties); // Builder cannot be reused after resource creation.
- resources.add(coverage.build(name, image));
- }
- }
- }
- return firstBuilder;
- }
-
- /**
- * Creates the resources. This method only prepares the information needed for reading pixel values.
- * The actual reading does not happen here.
- *
- * @return the resource.
- * @throws DataStoreException if another error occurred while building the image or resource.
- */
- final Resource[] build() throws DataStoreException, IOException {
- for (final PrimaryItem primary : primaryItem) {
- List<ItemInfoEntry> info = itemInfos.remove(primary.itemID);
- if (info == null) {
- info = itemInfos.remove(0); // `itemInfoEntry.itemID` = 0 means the primary item.
- if (info == null) continue;
- }
- try {
- createImage(primary.itemID, info, null);
- } catch (RasterFormatException e) {
- // Considered fatal because it was the primary resource.
- throw new DataStoreContentException("Unsupported image layout.", e);
- }
- }
- // Iterate over a snapshot because elements may be removed by `createImage(…)`.
- for (final Integer itemID : itemInfos.keySet().toArray(Integer[]::new)) {
- final List<ItemInfoEntry> info = itemInfos.remove(itemID);
- if (info != null) try {
- createImage(itemID, info, null);
- } catch (RasterFormatException e) {
- store.listeners().warning("A resource uses an unsupported sample model.", e);
- }
- }
- /*
- * At this point, all resources have either been created or discarded.
- * Some components may be members of groups, with pyramid as a special kind of group.
- */
- for (final GroupList box : groups) {
- for (Box child : box.children) {
- if (child instanceof EntityToGroup group) { // Should be the type of all children.
- final GenericName name = store.createComponentName(getResourceName(group.groupID));
- var grids = new GridCoverageResource[group.entityID.length];
- int count = 0;
- for (int entityID : group.entityID) {
- // TODO: wrong class
- var grid = (GridCoverageResource) itemInfos.remove(entityID);
- if (grid != null) grids[count++] = grid;
- }
- grids = ArraysExt.resize(grids, count);
- final Resource resource;
- if (child instanceof ImagePyramid pyramid) {
- new Pyramid(store, name, pyramid, grids); // TODO
- continue;
- } else {
- resource = new Group(store, name, grids);
- }
- resources.add(resource);
- }
- }
- }
- return resources.toArray(Resource[]::new);
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java
deleted file mode 100644
index d36d2ec798..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.geoheif;
-
-import static java.lang.Math.addExact;
-import static java.lang.Math.multiplyExact;
-import java.awt.image.DataBuffer;
-import java.awt.image.SampleModel;
-import java.awt.image.WritableRaster;
-import java.awt.image.RasterFormatException;
-import org.apache.sis.image.DataType;
-import org.apache.sis.image.internal.shared.ImageUtilities;
-import org.apache.sis.image.internal.shared.RasterFactory;
-import org.apache.sis.io.stream.ChannelDataInput;
-import org.apache.sis.io.stream.HyperRectangleReader;
-import org.apache.sis.io.stream.Region;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.isobmff.ByteRanges;
-
-
-/**
- * A single image ({@code 'unci'} item type) from the HEIF file.
- * An image may be used as a tile in a larger image ({@code 'grid'} item type).
- * The image may be implicitly tiled if {@link #numXTiles} is greater than 1.
- *
- * <h4>Requirement</h4>
- * This class requires that {@link CoverageBuilder#sampleModel()} can build a sample model.
- * In other words, the boxes such as {@code UncompressedFrameConfig} must have been found.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-final class UncompressedImage extends Image {
- /**
- * The type of sample values in the raster.
- */
- private final DataType dataType;
-
- /**
- * The sample model of each tile. The model size is the tile size.
- *
- * @see #getSampleModel(int[])
- */
- private final SampleModel sampleModel;
-
- /**
- * Creates a new tile.
- *
- * @param builder helper class for building the grid geometry and sample dimensions.
- * @param locator the provider of bytes to read from the <abbr>ISOBMFF</abbr> box.
- * @param name a name that identifies this image, for debugging purpose.
- * @throws RasterFormatException if the sample model cannot be created.
- */
- UncompressedImage(final CoverageBuilder builder, final ByteRanges.Reader locator, final String name)
- throws DataStoreException
- {
- super(builder, locator, name);
- sampleModel = builder.sampleModel();
- dataType = builder.dataType(); // Shall be after `sampleModel()`.
- }
-
- /**
- * Computes the range of bytes that will be needed for reading a single tile of this image.
- *
- * @param context where to store the ranges of bytes.
- * @throws DataStoreException if an error occurred while computing the range of bytes.
- */
- @Override
- protected Reader computeByteRanges(final ImageResource.Coverage.ReadContext context) throws DataStoreException {
- final long[] sourceSize = {
- // Note: the following ignores `MultiPixelPackedSampleModel`, but that model does not seem used by HEIF.
- sampleModel.getWidth() * (long) sampleModel.getNumDataElements(),
- sampleModel.getHeight()
- };
- /*
- * In the current implementation, we read the whole tile. If a future implementation allows
- * to read a sub-region of the tile, we would need to make `HyperRectangleReader` accepts a
- * `Buffer` with an arbitrary position in argument.
- */
- final var region = new Region(sourceSize, new long[2], sourceSize, new long[] {1, 1});
- final int dataSize = dataType.bytes();
- final long tileSize = multiplyExact(region.length, dataSize);
- final long skipBytes = region.getStartByteOffset(dataSize);
- final long tileIndex = addExact(multiplyExact(context.subTileY, numXTiles), context.subTileX);
- final long offset = addExact(multiplyExact(tileIndex, tileSize), skipBytes);
- locator.resolve(offset, tileSize - skipBytes, context);
- return (final ChannelDataInput input) -> {
- /*
- * Now read all banks and store the values in the image buffer.
- * If there is many banks (`InterleavingMode.COMPONENT`), these
- * banks are assumed consecutive.
- */
- input.buffer.order(byteOrder);
- final var hr = new HyperRectangleReader(ImageUtilities.toNumberEnum(dataType), input);
- hr.setOrigin(context.offset() - skipBytes);
- final WritableRaster raster = context.createRaster();
- final DataBuffer data = raster.getDataBuffer();
- final int numBanks = data.getNumBanks();
- for (int b=0; b<numBanks; b++) {
- if (b != 0) {
- hr.setOrigin(addExact(hr.getOrigin(), tileSize));
- }
- hr.setDestination(RasterFactory.wrapAsBuffer(data, b));
- hr.readAsBuffer(region, 0);
- }
- return raster;
- };
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/package-info.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/package-info.java
deleted file mode 100644
index 499930df35..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/package-info.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * A data store that can read GeoHEIF files as grid coverages.
- * The <abbr>HEIF</abbr> abbreviation stands for <q>High Efficiency Image Format</q>.
- * This implementation supports only a subset of the data structures ("boxes")
- * that an <abbr>HEIF</abbr> file may contain.
- * The supported subset should be sufficient for georeferenced images.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-package org.apache.sis.storage.geoheif;
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Box.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Box.java
deleted file mode 100644
index 929675474a..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Box.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * 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.isobmff;
-
-import java.time.Instant;
-import java.util.UUID;
-import org.apache.sis.storage.base.MetadataBuilder;
-
-
-/**
- * Building block defined by a unique type identifier and a length in bytes.
- * All data in a GeoHEIF file are contained in boxes, there is no other data within the file.
- * A box may be a {@link ContainerBox} containing other boxes.
- *
- * <h4>Reading process</h4>
- * Each box in the input stream starts with an header declaring the size and the box type.
- * This header is parsed by the {@link Reader} for determining which {@code Box} class to instantiate.
- * The <dfn>box payload</dfn> is defined as all bytes in a box following the header.
- * The box payload shall be read by the {@code Box} subclass constructor.
- * Constructors do not need to read the payload fully, as remaining bytes will be automatically skipped.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-public abstract class Box extends TreeNode {
- /**
- * The epoch of dates in <abbr>ISO</abbr> <abbr>BMFF</abbr> files.
- * This is fixed to midnight, January 1, 1904 in UTC time.
- */
- protected static final Instant EPOCH = Instant.ofEpochMilli(-2082844800000L);
-
- /**
- * Creates a new box. The header, which contains the size and the box type, shall have been read by the caller.
- * Therefore, there is no more field to read in this constructor. The <dfn>box payload</dfn> (all bytes after
- * the header) shall be read by the subclass constructor. It is okay to read the payload only partially.
- */
- protected Box() {
- }
-
- /**
- * Returns the four-character type of this box. This is the value defined in the {@code BOXTYPE} constant
- * of each sub-class. If the value is {@link Extension#BOXTYPE}, then the {@link #extendedType()} method
- * shall return a non-null value.
- *
- * @return the four-character type of this box.
- *
- * @see #formatFourCC(int)
- */
- public abstract int type();
-
- /**
- * Returns the identifier of this box. For normative boxes defined by <abbr>ISO</abbr> 14496,
- * the identifier is derived by an algorithm defined in the <abbr>ISO</abbr> specification.
- * For all other boxes, this is the value of the {@code EXTENDED_TYPE} constant defined in
- * each {@link Extension} sub-class.
- *
- * @return the box identifier.
- */
- public UUID extendedType() {
- return new UUID((((long) type()) << Integer.SIZE) | 0x0011_0010, 0x8000_00AA00389B71L);
- }
-
- /**
- * Returns a unique key for the type of this box.
- * This is either {@link #type()} or {@link #extendedType()}.
- *
- * @return a unique key for the type of this box.
- */
- public Object typeKey() {
- return type();
- }
-
- /**
- * Returns a human-readable name for this node to shown in the tree.
- * This method adds the {@linkplain #typeKey() type} between parenthesis after the box name.
- *
- * @return Human-readable name of this node.
- */
- @Override
- public String typeName() {
- String name = super.typeName();
- Object type = typeKey();
- if (type instanceof Integer fourCC) {
- type = formatFourCC(fourCC);
- }
- if (type != null) {
- name = name + " (" + type + ')';
- }
- return name;
- }
-
- /**
- * Converts node properties to <abbr>ISO</abbr> 19115 metadata if applicable.
- * The default implementation does nothing.
- *
- * @param builder the builder where to set metadata information.
- */
- public void metadata(MetadataBuilder builder) {
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/BoxRegistry.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/BoxRegistry.java
deleted file mode 100644
index e77c97c890..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/BoxRegistry.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.isobmff;
-
-import java.util.UUID;
-import java.io.IOException;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-
-
-/**
- * A factory of <abbr>ISO</abbr> <abbr>BMFF</abbr> boxes for given types or identifiers.
- * Users can register their own factory as a service to be used with {@link java.util.ServiceLoader}.
- *
- * @todo This mechanism makes possible to create custom boxes, but we do not yet have a mechanism for using them.
- * {@link Reader} will not know what to do with custom boxes.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-public abstract class BoxRegistry {
- /**
- * Creates a new registry.
- */
- protected BoxRegistry() {
- }
-
- /**
- * Creates a new box for the given box type.
- * Unknown types should be ignored.
- *
- * <p>The default implementation logs a warning and returns {@code null}.
- * Subclasses should override this method or {@link #create(Reader, UUID)}.</p>
- *
- * @param reader the reader from which to read bytes.
- * @param fourCC four-character code identifying the box type.
- * @return box, or {@code null} if the given type is not recognized by this registry.
- * @throws IOException if an error occurred while reading the box content.
- * @throws NegativeArraySizeException if an unsigned integer exceeds the capacity of 32-bits signed integers.
- * @throws ArithmeticException if an integer overflow occurred for another reason.
- * @throws ArrayStoreException if a child box is not of the type expected by its container box.
- * @throws ArrayIndexOutOfBoundsException if a box does not have the expected number of elements.
- * @throws UnsupportedVersionException if the box declare an unsupported version number.
- * @throws DataStoreContentException if the <abbr>HEIF</abbr> file is malformed.
- * @throws DataStoreException if the box creation failed for another reason.
- *
- * @see Box#formatFourCC(int)
- */
- public Box create(Reader reader, int fourCC) throws IOException, DataStoreException {
- reader.unknownBoxType(fourCC);
- return null;
- }
-
- /**
- * Creates a new box for the given extension identifier.
- * This method is invoked when the box type is {@link Extension#BOXTYPE}.
- * Unknown identifiers should be ignored.
- *
- * <p>The default implementation logs a warning and returns {@code null}.
- * Subclasses should override this method or {@link #create(Reader, int)}.</p>
- *
- * @param reader the reader from which to read bytes.
- * @param extension identifier of user-defined box.
- * @return box, or {@code null} if the given identifier is not recognized by this registry.
- * @throws IOException if an error occurred while reading the box content.
- * @throws NegativeArraySizeException if an unsigned integer exceeds the capacity of 32-bits signed integers.
- * @throws ArithmeticException if an integer overflow occurred for another reason.
- * @throws ArrayStoreException if a child box is not of the type expected by its container box.
- * @throws ArrayIndexOutOfBoundsException if a box does not have the expected number of elements.
- * @throws UnsupportedVersionException if the box declare an unsupported version number.
- * @throws DataStoreContentException if the <abbr>HEIF</abbr> file is malformed.
- * @throws DataStoreException if the box creation failed for another reason.
- */
- public Box create(Reader reader, UUID extension) throws IOException, DataStoreException {
- reader.unknownBoxType(extension);
- return null;
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/ByteRanges.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/ByteRanges.java
deleted file mode 100644
index 2d2df96047..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/ByteRanges.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * 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.isobmff;
-
-import java.util.Arrays;
-import org.apache.sis.io.stream.ChannelDataInput;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.UnsupportedEncodingException;
-
-
-/**
- * Ranges of bytes to read from a <abbr>HEIF</abbr> file.
- * Instances are given to {@link Reader#resolve(long, long, ByteRanges)} for
- * converting values relative to a box item to values relative to the stream.
- *
- * @author Martin Desruisseaux (Geomatys)
- */
-public class ByteRanges implements Comparable<ByteRanges> {
- /**
- * Interface implemented by the {@link TreeNode} subclasses which read bytes only when requested.
- * Contrarily to the constructors of {@link Box} subclasses which read all the payload immediately,
- * the method provided by this interface allow access to a subset of a potentially large sequence of bytes.
- *
- * @author Martin Desruisseaux (Geomatys)
- */
- public interface Reader {
- /**
- * Converts an offset relative to the data of this item to offsets relative to the origin of the input stream.
- * The subset is specified by the {@code offset} and {@code length} arguments, where an {@code offset} of zero
- * is for the first byte stored by this item. Implementation will typically add to {@code offset} the position
- * in the file of the first byte.
- *
- * @param offset offset of the first byte to read relative to the data stored is this item.
- * @param length maximum number of bytes to read, starting at the offset, or a negative value for reading all.
- * @param addTo where to add the ranges of bytes to read as offsets relatives to the beginning of the file.
- * @throws UnsupportedEncodingException if this item uses an unsupported construction method.
- * @throws DataStoreContentException if the <abbr>HEIF</abbr> file is malformed.
- * @throws DataStoreException if another logical error occurred.
- * @throws ArithmeticException if an integer overflow occurred.
- *
- * @see #addRange(long, long)
- */
- void resolve(long offset, long length, ByteRanges addTo) throws DataStoreException;
- }
-
- /**
- * Ranges of bytes to read, relative to the file and in the order they were added.
- * Consecutive ranges are merged in a single range, but no other simplification is performed.
- * Offsets at even indexes are starting point (inclusive) and offsets at odd indexes are end point (exclusive).
- */
- private long[] offsets;
-
- /**
- * Creates an initially empty set of byte ranges.
- */
- public ByteRanges() {
- }
-
- /**
- * Adds a range of byte offsets relative to the beginning of the <abbr>HEIF</abbr> file.
- * this method is invoked by {@link Reader#resolve(long, long, ByteRanges)} implementations
- * for specifying all range of bytes to read. This method is usually invoked exactly once.
- * It may be invoked more often if the bytes are spread over many regions of the file.
- *
- * @param start offset of the first byte to read, inclusive.
- * @param end offset after the last byte to read.
- */
- public void addRange(final long start, final long end) {
- if (start < end) {
- if (offsets == null) {
- offsets = new long[] {start, end};
- } else {
- int i = offsets.length - 1;
- if (offsets[i] == start) {
- offsets[i] = end;
- } else {
- offsets = Arrays.copyOf(offsets, ++i + 2);
- offsets[i] = start;
- offsets[i+1] = end;
- }
- }
- }
- }
-
- /**
- * Returns the offset of the first byte to read, or 0 if unknown.
- * Note that this is not necessarily the smallest offset, because nothing prevent the
- * ranges to be declared out-of-order. However, out-of-order ranges are assumed rare.
- */
- public final long offset() {
- return (offsets != null) ? offsets[0] : 0; // A non-null array should be non-empty.
- }
-
- /**
- * Compares this set of ranges with the given ranges for the order in which they appear in the file.
- * In the current implementation, the ordering is based on the offset of the first byte to read.
- * It may be revised in a future version if useful.
- *
- * @param other the other range of bytes to compare with this instance.
- * @return negative is this range of bytes is before {@code other}, positive if after, 0 if same offset.
- */
- @Override
- public final int compareTo(final ByteRanges other) {
- return Long.compare(offset(), other.offset());
- }
-
- /**
- * Notifies the given input about the range of bytes which will be requested. This method should be
- * invoked for the {@code ByteRanges} associated to all tiles to read before the actual reading starts.
- * This notification is only a hint. It can be used for preparing a <abbr>HTTP</abbr> range request.
- *
- * @param input the input stream to notify about the ranges of bytes that will be requested.
- */
- public final void notify(final ChannelDataInput input) {
- @SuppressWarnings("LocalVariableHidesMemberVariable")
- final long[] offsets = this.offsets;
- if (offsets != null) {
- for (int i=0; i < offsets.length;) {
- // Note: FileCacheByteChannel uses a RangeSet for merging efficiently those ranges.
- input.rangeOfInterest(offsets[i++], offsets[i++]);
- }
- }
- }
-
- /**
- * Returns a stream of bytes for the given request as if all bytes were stored in one sequence.
- * If all data are stored in the same extent, then this method returns {@code input} directly.
- * Otherwise, this method returns a view over the given input as if all extents were consecutive.
- *
- * @todo The view is not yet implemented.
- *
- * @param input the channel opened on the <abbr>HEIF</abbr> file.
- * @param request the region to read, as adjusted by {@link #resolve(long, long, ByteRanges)}.
- * @return the input to use. By default, this is {@code input} directly.
- * @throws DataStoreException if the input cannot be created.
- */
- public final ChannelDataInput viewAsConsecutiveBytes(ChannelDataInput input) throws DataStoreException {
- if (offsets != null && offsets.length == 2) {
- return input;
- }
- /*
- * There is at least two extents to read. Create a channel
- * which will read each extent as if they were consecutive.
- * TODO: not yet implemented.
- */
- throw new UnsupportedEncodingException("Not supported yet");
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/ContainerBox.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/ContainerBox.java
deleted file mode 100644
index 65338d2da8..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/ContainerBox.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.isobmff;
-
-import java.io.IOException;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.base.MetadataBuilder;
-
-
-/**
- * Box whose sole purpose is to contain and group a set of related boxes.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-public abstract class ContainerBox extends Box {
- /**
- * All boxes contained in this container box. This array may or may not accept null elements,
- * depending on the {@code indexed} argument given at construction time:
- *
- * <ul>
- * <li>If {@code indexed} was {@code false}, all array elements are non-null but indexes in the array
- * may not correspond to the indexes in the file. This is because unknown boxes were skipped.</li>
- * <li>If {@code indexed} was {@code true}, the indexes in the array correspond to the indexes in the
- * file, but the array may contain null elements in place of unknown boxes.</li>
- * </ul>
- */
- public final Box[] children;
-
- /**
- * Creates a new box and loads the payload using the given box registry.
- * A custom registry is specified for filtering the type of boxes to accept.
- * Boxes of unknown types are ignored and skipped.
- *
- * @param reader the reader from which to read the payload.
- * @param registry the registry to use for box instantiations, or {@code null} for the main registry.
- * @param indexed whether index matter. If {@code true}, then the children array may contain null elements.
- * @throws IOException if an error occurred while reading the payload.
- * @throws DataStoreContentException if the <abbr>HEIF</abbr> file is malformed.
- * @throws DataStoreException if the reading failed for another reason.
- */
- protected ContainerBox(final Reader reader, final BoxRegistry registry, final boolean indexed)
- throws IOException, DataStoreException
- {
- children = reader.readChildren(registry, indexed).toArray(Box[]::new);
- }
-
- /**
- * Converts node properties of all children to <abbr>ISO</abbr> 19115 metadata.
- *
- * @param builder the builder where to set metadata information.
- */
- @Override
- public void metadata(final MetadataBuilder builder) {
- for (final Box child : children) {
- if (child != null) {
- child.metadata(builder);
- }
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Extension.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Extension.java
deleted file mode 100644
index 811b7952b6..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Extension.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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.isobmff;
-
-import java.util.UUID;
-import org.apache.sis.util.collection.TreeTable;
-import org.apache.sis.util.collection.TableColumn;
-
-
-/**
- * A box identified by an <abbr>UUID</abbr>.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-public abstract class Extension extends Box {
- /**
- * Numerical representation of the {@code "uuid"} box type.
- */
- public static final int BOXTYPE = ((((('u' << 8) | 'u') << 8) | 'i') << 8) | 'd';
-
- /**
- * Returns the four-character type of this box.
- * This value is fixed to {@link #BOXTYPE}.
- */
- @Override
- public final int type() {
- return BOXTYPE;
- }
-
- /**
- * Creates a new box. Subclass constructors should read the payload.
- */
- protected Extension() {
- }
-
- /**
- * Returns the identifier of this extension.
- * This is the value of the {@code EXTENDED_TYPE} constant defined in each sub-class.
- *
- * @return the user-extension identifier.
- */
- @Override
- public abstract UUID extendedType();
-
- /**
- * Returns a unique key for the type of this box.
- */
- @Override
- public final Object typeKey() {
- return extendedType();
- }
-
- /**
- * Appends properties other than the ones defined by public fields.
- * Those properties will be shown first in the tree.
- *
- * @param context the tree being formatted. Can be used for fetching contextual information.
- * @param target the node where to add properties.
- * @param after {@code false} for the first nodes, or {@code true} for the last nodes.
- */
- @Override
- protected void appendTreeNodes(final Tree context, final TreeTable.Node target, final boolean after) {
- super.appendTreeNodes(context, target, after);
- if (!after) {
- final UUID value = extendedType();
- if (value != null) {
- final TreeTable.Node child = target.newChild();
- child.setValue(TableColumn.NAME, "extendedType");
- child.setValue(TableColumn.VALUE, value);
- child.setValue(TableColumn.VALUE_AS_TEXT, value.toString());
- }
- }
- }
-}
diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/FullBox.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/FullBox.java
deleted file mode 100644
index c39d78e9f0..0000000000
--- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/FullBox.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.isobmff;
-
-import java.io.IOException;
-import org.apache.sis.util.collection.TableColumn;
-import org.apache.sis.util.collection.TreeTable;
-
-
-/**
- * A box containing a version and a set of flags.
- * Full boxes with an unrecognized version should be ignored and skipped.
- *
- * @author Johann Sorel (Geomatys)
- * @author Martin Desruisseaux (Geomatys)
- */
-public abstract class FullBox extends Box {
- /**
- * Right shift to apply to the {@link #flags} bits in order to get the version numbers.
- *
- * @see #version()
- */
- protected static final int VERSION_BIT_SHIFT = 3 * Byte.SIZE;
-
- /**
- * Version and flags encoded in a single integer.
- * The first 8 bits contains the version, the rest are the flags.
- *
- * @see #version()
- */
- protected final int flags;
-
- /**
- * Creates a new box. This constructor reads the flags immediately.
- * Subclass constructors should read the <dfn>full box payload</dfn>,
- * defined as all bytes in the box following the flags.
- * It is okay to read the payload only partially.
- *
- * @param reader the reader from which to read the payload.
- * @throws IOException if an error occurred while reading the payload.
- */
- protected FullBox(final Reader reader) throws IOException {
- flags = reader.input.readInt();
- }
-
- /**
- * Returns the version of this format of the box.
- * Typically, version 0 means that fields are 32-bits integers and version 1 means that fields are 64-bits integers.
- *
- * @return the version encoded in the {@linkplain #flags}.
- */
- public final int version() {
- return flags >>> VERSION_BIT_SHIFT;
- }
-
- /**
- * Verifies that the box version is zero.
- * This is a convenience check for boxes having only one version.
- *
- * @throws UnsupportedVersionException if the box version is not zero.
- */
- protected final void requireVersionZero() throws UnsupportedVersionException {
- final int version = version();
- if (version != 0) {
- throw new UnsupportedVersionException(type(), version);
- }
- }
-
- /**
- * Appends properties other than the ones defined by public fields.
- * Those properties will be shown first in the tree.
- *
- * @param context the tree being formatted. Can be used for fetching contextual information.
- * @param target the node where to add properties.
- * @param after {@code false} for the first nodes, or {@code true} for the last nodes.
- */
- @Override
- protected void appendTreeNodes(final Tree context, final TreeTable.Node target, final boolean after) {
- super.appendTreeNodes(context, target, after);
- if (!after) {
- final int version = version();
- final int options = flags & ((1 << VERSION_BIT_SHIFT) - 1);
- if (version != 0) {
- TreeTable.Node child = target.newChild();
- child.setValue(TableColumn.NAME, "version");
- child.setValue(TableColumn.VALUE, version);
- child.setValue(TableColumn.VALUE_AS_TEXT, String.valueOf(version));
- }
- if (options != 0) {
- TreeTable.Node child = target.newChild();
- child.setValue(TableColumn.NAME, "flags");
- child.setValue(TableColumn.VALUE, options);
... 40236 lines suppressed ...