This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/sis.git
commit d162d1255bdf7d61d92678beed79f503b7c2d4c5 Merge: 76fed8a0e3 edc8e9e83e Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Tue Oct 1 19:22:44 2024 +0200 Merge branch 'geoapi-3.1'. .../apache/sis/buildtools/gradle/Dependency.java | 11 +- .../org/apache/sis/cloud/aws/s3/FileService.java | 1 - .../main/org/apache/sis/cloud/aws/s3/KeyPath.java | 1 - .../apache/sis/cloud/aws/s3/ObjectAttributes.java | 1 - .../sis/cloud/aws/{internal => s3}/Resources.java | 6 +- .../aws/{internal => s3}/Resources.properties | 0 .../cloud/aws/{internal => s3}/Resources_en.java | 4 +- .../cloud/aws/{internal => s3}/Resources_fr.java | 4 +- .../aws/{internal => s3}/Resources_fr.properties | 0 .../sis/cloud/aws/s3/KeyPathMatcherTest.java | 13 + .../org/apache/sis/cloud/aws/s3/KeyPathTest.java | 8 +- .../org.apache.sis.feature/main/module-info.java | 1 + .../sis/coverage/grid/BufferedGridCoverage.java | 1 + .../apache/sis/coverage/grid/GridDerivation.java | 177 +- .../org/apache/sis/coverage/grid/GridExtent.java | 63 +- .../org/apache/sis/coverage/grid/GridGeometry.java | 27 +- .../apache/sis/coverage/grid/ImageRenderer.java | 15 +- .../sis/coverage/privy/ColorModelBuilder.java | 13 +- .../sis/coverage/privy/ColorModelFactory.java | 8 +- .../org/apache/sis/coverage/privy/ImageLayout.java | 40 +- .../apache/sis/coverage/privy/ImageUtilities.java | 36 +- .../apache/sis/coverage/privy/ObservableImage.java | 2 +- .../apache/sis/coverage/privy/RangeArgument.java | 16 +- .../apache/sis/coverage/privy/RasterFactory.java | 4 +- .../apache/sis/coverage/privy/TilePlaceholder.java | 16 +- .../main/org/apache/sis/image/DataType.java | 39 +- .../main/org/apache/sis/image/ImageProcessor.java | 2 +- .../org/apache/sis/image/MultiSourceLayout.java | 2 +- .../main/org/apache/sis/image/Transferer.java | 2 +- .../sis/coverage/grid/GridDerivationTest.java | 16 +- .../apache/sis/coverage/grid/GridExtentTest.java | 4 +- .../apache/sis/coverage/grid/GridGeometryTest.java | 2 +- .../apache/sis/coverage/privy/ImageLayoutTest.java | 8 + .../sis/coverage/privy/ImageUtilitiesTest.java | 8 - .../sis/coverage/privy/RangeArgumentTest.java | 2 +- .../apache/sis/image/BandAggregateImageTest.java | 2 +- .../sis/metadata/iso/citation/Citations.java | 58 +- .../main/org/apache/sis/metadata/sql/Citations.sql | 33 +- .../main/org/apache/sis/metadata/sql/Metadata.sql | 4 +- .../apache/sis/metadata/sql/MetadataFallback.java | 26 +- .../sis/metadata/iso/citation/CitationsTest.java | 2 +- .../sis/metadata/sql/MetadataFallbackVerifier.java | 3 +- .../test/org/apache/sis/xml/test/InfiniteSet.java | 2 +- .../main/module-info.java | 2 + .../main/org/apache/sis/io/wkt/AbstractParser.java | 6 +- .../main/org/apache/sis/io/wkt/Element.java | 5 +- .../main/org/apache/sis/io/wkt/Warnings.java | 14 +- .../referencing/datum/DefaultVerticalDatum.java | 2 +- .../factory/ConcurrentAuthorityFactory.java | 24 +- .../referencing/factory/GeodeticObjectFactory.java | 4 +- .../operation/provider/NorthPoleRotation.java | 3 +- .../operation/provider/SouthPoleRotation.java | 3 +- .../operation/transform/ProjectiveTransform.java | 2 +- .../apache/sis/storage/landsat/LandsatStore.java | 3 +- .../apache/sis/storage/landsat/MetadataReader.java | 14 +- .../sis/storage/geotiff/CompressedSubset.java | 34 +- .../org/apache/sis/storage/geotiff/DataCube.java | 34 +- .../org/apache/sis/storage/geotiff/DataSubset.java | 66 +- .../apache/sis/storage/geotiff/GeoTiffStore.java | 11 +- .../sis/storage/geotiff/ImageFileDirectory.java | 55 +- .../sis/storage/geotiff/MultiResolutionImage.java | 11 +- .../geotiff/reader/ImageMetadataBuilder.java | 2 - .../apache/sis/storage/netcdf/MetadataReader.java | 68 +- .../org/apache/sis/storage/netcdf/NetcdfStore.java | 7 +- .../sis/storage/netcdf/NetcdfStoreProvider.java | 12 +- .../org/apache/sis/storage/netcdf/base/Axis.java | 18 +- .../apache/sis/storage/netcdf/base/CRSBuilder.java | 16 +- .../apache/sis/storage/netcdf/base/Convention.java | 8 +- .../apache/sis/storage/netcdf/base/Decoder.java | 31 +- .../apache/sis/storage/netcdf/base/FeatureSet.java | 26 +- .../sis/storage/netcdf/base/GridMapping.java | 11 +- .../org/apache/sis/storage/netcdf/base/HYCOM.java | 124 -- .../sis/storage/netcdf/base/NamedElement.java | 6 + .../org/apache/sis/storage/netcdf/base/Node.java | 27 +- .../sis/storage/netcdf/base/RasterResource.java | 13 +- .../apache/sis/storage/netcdf/base/Variable.java | 94 +- .../storage/netcdf/base/VariableTransformer.java | 312 ++++ .../sis/storage/netcdf/classic/ChannelDecoder.java | 32 +- .../sis/storage/netcdf/classic/GridInfo.java | 22 +- .../sis/storage/netcdf/classic/VariableInfo.java | 51 +- .../sis/storage/netcdf/ucar/DecoderWrapper.java | 65 +- .../sis/storage/netcdf/ucar/GridWrapper.java | 3 +- .../sis/storage/netcdf/ucar/VariableWrapper.java | 14 +- .../sis/storage/netcdf/MetadataReaderTest.java | 117 +- .../apache/sis/storage/netcdf/NetcdfStoreTest.java | 2 +- .../sis/storage/sql/feature/FeatureAnalyzer.java | 7 +- .../sis/storage/sql/feature/TableReference.java | 2 +- .../org.apache.sis.storage/main/module-info.java | 3 + .../apache/sis/io/stream/HyperRectangleWriter.java | 2 +- .../main/org/apache/sis/io/stream/Region.java | 4 +- .../sis/storage/AbstractGridCoverageResource.java | 2 +- .../main/org/apache/sis/storage/FeatureNaming.java | 28 +- .../main/org/apache/sis/storage/Resource.java | 206 ++- .../apache/sis/storage/base/MetadataBuilder.java | 156 +- .../org/apache/sis/storage/base/PRJDataStore.java | 35 +- .../sis/storage/base/ResourceOnFileSystem.java | 71 - .../sis/storage/base/TiledDeferredImage.java | 15 +- .../apache/sis/storage/base/TiledGridCoverage.java | 853 +++++++--- .../apache/sis/storage/base/TiledGridResource.java | 384 ++++- .../org/apache/sis/storage/base/URIDataStore.java | 37 +- .../sis/storage/base/URIDataStoreProvider.java | 9 +- .../main/org/apache/sis/storage/csv/Store.java | 31 +- .../org/apache/sis/storage/esri/RasterStore.java | 16 +- .../apache/sis/storage/esri/RawRasterReader.java | 4 +- .../apache/sis/storage/esri/RawRasterStore.java | 5 +- .../main/org/apache/sis/storage/folder/Store.java | 6 +- .../apache/sis/storage/folder/WritableStore.java | 39 +- .../sis/storage/image/WorldFileResource.java | 18 +- .../apache/sis/storage/image/WorldFileStore.java | 13 +- .../org/apache/sis/storage/internal/Resources.java | 5 + .../sis/storage/internal/Resources.properties | 1 + .../sis/storage/internal/Resources_fr.properties | 1 + .../sis/io/stream/HyperRectangleReaderTest.java | 10 +- .../sis/io/stream/HyperRectangleWriterTest.java | 2 +- .../io/stream/SubsampledRectangleWriterTest.java | 2 +- .../sis/storage/esri/AsciiGridStoreTest.java | 59 +- .../sis/storage/test/CoverageReadConsistency.java | 12 +- .../src/org.apache.sis.util/main/module-info.java | 4 + .../main/org/apache/sis/math/Vector.java | 2 +- .../main/org/apache/sis/system/Cleaners.java} | 28 +- .../apache/sis/system/ReferenceQueueConsumer.java | 13 +- .../main/org/apache/sis/system/Shutdown.java | 2 +- .../main/org/apache/sis/util/Version.java | 53 +- .../main/org/apache/sis/util/collection/Cache.java | 1 + .../org/apache/sis/util/privy/CollectionsExt.java | 69 +- .../main/org/apache/sis/util/privy/Constants.java | 11 + .../main/org/apache/sis/util/resources/Errors.java | 5 + .../apache/sis/util/resources/Errors.properties | 1 + .../apache/sis/util/resources/Errors_fr.properties | 1 + .../test/org/apache/sis/test/ContentVerifier.java | 17 +- .../org/apache/sis/test/LogRecordCollector.java | 2 +- .../test/org/apache/sis/util/VersionTest.java | 9 + .../apache/sis/util/privy/CollectionsExtTest.java | 4 +- incubator/build.gradle.kts | 4 +- .../apache/sis/storage/geopackage/GpkgStore.java | 26 +- .../org/apache/sis/storage/gimi/GimiProvider.java | 2 +- .../org/apache/sis/storage/gimi/GimiStore.java | 17 +- .../apache/sis/storage/gimi/GimiTileMatrix.java | 4 +- .../org/apache/sis/storage/gimi/ResourceGrid.java | 64 +- .../storage/gimi/ResourceImageUncompressed.java | 134 +- .../apache/sis/storage/gimi/ResourcePyramid.java | 62 +- .../storage/gimi/internal/MatrixGridRessource.java | 32 +- .../sis/storage/gimi/internal/ScaleSortedMap.java | 2 +- .../isobmff/gimi/ModelTransformationProperty.java | 9 + .../gimi/isobmff/gimi/WellKnownText2Property.java | 9 + .../gimi/isobmff/iso23001_17/TAIClockInfo.java | 4 +- .../main/module-info.java | 2 + .../main/org/apache/sis/storage/gsf/Attitude.java | 11 +- .../main/org/apache/sis/storage/gsf/Comment.java | 10 +- .../main/org/apache/sis/storage/gsf/DataID.java | 9 +- .../main/org/apache/sis/storage/gsf/GSF.java | 1780 ++++++-------------- .../apache/sis/storage/gsf/GSFException.java} | 16 +- .../apache/sis/storage/gsf/GSFRecordReader.java | 122 +- .../main/org/apache/sis/storage/gsf/GSFStore.java | 102 ++ .../apache/sis/storage/gsf/GSFStoreProvider.java | 212 +++ .../apache/sis/storage/gsf/HVNavigationError.java | 9 +- .../main/org/apache/sis/storage/gsf/Header.java | 9 +- .../main/org/apache/sis/storage/gsf/History.java | 10 +- .../apache/sis/storage/gsf/NavigationError.java | 10 +- .../main/org/apache/sis/storage/gsf/Position.java | 13 +- .../apache/sis/storage/gsf/PositionOffsets.java | 8 +- .../sis/storage/gsf/ProcessingParameters.java | 8 +- .../main/org/apache/sis/storage/gsf/Records.java | 10 +- .../apache/sis/storage/gsf/SBSensorSpecific.java | 48 +- .../main/org/apache/sis/storage/gsf/SVP.java | 9 +- .../org/apache/sis/storage/gsf/ScaleFactors.java | 10 +- .../main/org/apache/sis/storage/gsf/ScaleInfo.java | 10 +- .../apache/sis/storage/gsf/SensorParameters.java | 10 +- .../org/apache/sis/storage/gsf/SensorSpecific.java | 141 +- .../org/apache/sis/storage/gsf/SingleBeamPing.java | 10 +- .../org/apache/sis/storage/gsf/StructClass.java | 32 +- .../org/apache/sis/storage/gsf/SwathBathyPing.java | 8 +- .../apache/sis/storage/gsf/SwathBathySummary.java | 10 +- .../main/org/apache/sis/storage/gsf/TimeSpec.java | 8 +- .../sis/storage/gsf/panama/LibraryLoader.java | 125 ++ .../sis/storage/gsf/panama/LibraryStatus.java | 26 +- .../sis/storage/gsf/panama/NativeFunctions.java | 84 + .../sis/storage/gsf/panama}/package-info.java | 16 +- .../gsf/specific/{BDBSpecific.java => BDB.java} | 11 +- .../{CmpSassSpecific.java => CmpSass.java} | 12 +- .../specific/{DeltaTSpecific.java => DeltaT.java} | 11 +- .../specific/{EM100Specific.java => EM100.java} | 18 +- .../gsf/specific/{EM12Specific.java => EM12.java} | 171 +- .../specific/{EM121ASpecific.java => EM121A.java} | 227 +-- .../gsf/specific/{EM3Specific.java => EM3.java} | 268 +-- .../{EM3ImagerySpecific.java => EM3Imagery.java} | 242 +-- .../specific/{EM3RawSpecific.java => EM3Raw.java} | 442 +---- .../sis/storage/gsf/specific/EM3RawTxSector.java | 238 +-- .../sis/storage/gsf/specific/EM3RunTime.java | 679 +------- .../gsf/specific/{EM4Specific.java => EM4.java} | 418 +---- .../{EM4ImagerySpecific.java => EM4Imagery.java} | 339 +--- .../sis/storage/gsf/specific/EM4TxSector.java | 262 +-- .../specific/{EM950Specific.java => EM950.java} | 155 +- .../sis/storage/gsf/specific/EMPUStatus.java | 167 +- .../apache/sis/storage/gsf/specific/EMRunTime.java | 790 +-------- .../{EchotracSpecific.java => Echotrac.java} | 83 +- .../{ElacMkIISpecific.java => ElacMkII.java} | 179 +- ...GeoSwathPlusSpecific.java => GeoSwathPlus.java} | 626 +------ .../specific/{KMALLSpecific.java => KMALL.java} | 11 +- .../sis/storage/gsf/specific/KMALLExtraDet.java | 94 +- ...n7100ImagerySpecific.java => KMALLImagery.java} | 100 +- .../sis/storage/gsf/specific/KMALLTxSector.java | 334 +--- ...Klein5410BssSpecific.java => Klein5410Bss.java} | 434 +---- ...agerySpecific.java => Klein5410BssImagery.java} | 138 +- .../specific/{MGD77Specific.java => MGD77.java} | 155 +- .../specific/{NOSHDBSpecific.java => NOSHDB.java} | 60 +- .../{R2SonicSpecific.java => R2Sonic.java} | 806 +-------- ...nicImagerySpecific.java => R2SonicImagery.java} | 695 +------- .../{Reson7100Specific.java => Reson7100.java} | 1196 ++----------- ...LImagerySpecific.java => Reson7100Imagery.java} | 60 +- .../{Reson8100Specific.java => Reson8100.java} | 674 +------- ...0ImagerySpecific.java => Reson8100Imagery.java} | 51 +- ...ResonTSeriesSpecific.java => ResonTSeries.java} | 1542 ++--------------- ...agerySpecific.java => ResonTSeriesImagery.java} | 74 +- .../specific/{SBAmpSpecific.java => SBAmp.java} | 155 +- .../specific/{SBBDBSpecific.java => SBBDB.java} | 218 +-- .../{SBEchotracSpecific.java => SBEchotrac.java} | 146 +- .../specific/{MGD77Specific.java => SBMGD77.java} | 186 +- .../sis/storage/gsf/specific/SBMGD77Specific.java | 400 ----- .../{SBNOSHDBSpecific.java => SBNOSHDB.java} | 98 +- .../{SBNavisoundSpecific.java => SBNavisound.java} | 74 +- .../specific/{SeaBatSpecific.java => SeaBat.java} | 155 +- .../{SeaBat8101Specific.java => SeaBat8101.java} | 434 +---- .../{SeaBatSpecific.java => SeaBatII.java} | 218 ++- .../sis/storage/gsf/specific/SeaBatIISpecific.java | 490 ------ .../{SeaBeam2112Specific.java => SeaBeam2112.java} | 257 +-- .../{SeabeamSpecific.java => Seabeam.java} | 35 +- .../specific/{SeamapSpecific.java => Seamap.java} | 256 +-- .../{TypeIIISpecific.java => TypeIII.java} | 155 +- .../sis/storage/shapefile/ShapefileStore.java | 17 +- .../sis/storage/shapefile/ShapefileStoreTest.java | 31 +- netbeans-project/nbproject/project.properties | 1 + optional/README.md | 3 + optional/build.gradle.kts | 19 +- optional/src/org.apache.sis.gui/bundle/README | 5 +- .../org/apache/sis/gui/coverage/GridTileCache.java | 4 +- .../org/apache/sis/gui/dataset/PathAction.java | 27 +- .../org/apache/sis/gui/map/GestureFollower.java | 2 +- .../main/org/apache/sis/gui/map/MapCanvas.java | 2 +- .../sis/gui/metadata/IdentificationInfo.java | 26 +- .../org/apache/sis/gui/metadata/MetadataTree.java | 12 +- .../org.apache.sis.storage.DataStoreProvider | 4 + .../main/module-info.java | 59 + .../main/org/apache/sis/storage/gdal/Band.java | 368 ++++ .../sis/storage/gdal/ColorInterpretation.java | 78 + .../main/org/apache/sis/storage/gdal/DataType.java | 193 +++ .../main/org/apache/sis/storage/gdal/Driver.java | 380 +++++ .../org/apache/sis/storage/gdal/ErrorHandler.java | 253 +++ .../main/org/apache/sis/storage/gdal/GDAL.java | 606 +++++++ .../org/apache/sis/storage/gdal/GDALStore.java | 511 ++++++ .../apache/sis/storage/gdal/GDALStoreProvider.java | 325 ++++ .../main/org/apache/sis/storage/gdal/OpenFlag.java | 153 ++ .../main/org/apache/sis/storage/gdal/Opener.java | 204 +++ .../org/apache/sis/storage/gdal/SpatialRef.java | 174 ++ .../org/apache/sis/storage/gdal/Subdataset.java | 69 + .../apache/sis/storage/gdal/SubdatasetList.java | 167 ++ .../org/apache/sis/storage/gdal/TiledCoverage.java | 124 ++ .../org/apache/sis/storage/gdal/TiledResource.java | 615 +++++++ .../org/apache/sis/storage/gdal/package-info.java | 44 + .../apache/sis/storage/panama/LibraryLoader.java | 223 +++ .../apache/sis/storage/panama/LibraryStatus.java | 89 + .../apache/sis/storage/panama/NativeFunctions.java | 225 +++ .../org/apache/sis/storage/panama}/Resources.java | 82 +- .../sis/storage/panama}/Resources.properties | 17 +- .../apache/sis/storage/panama}/Resources_en.java | 2 +- .../apache/sis/storage/panama}/Resources_fr.java | 2 +- .../sis/storage/panama}/Resources_fr.properties | 17 +- .../apache/sis/storage/panama}/package-info.java | 14 +- .../org/apache/sis/storage/gdal/GDALStoreTest.java | 221 +++ .../test/org/apache/sis/storage/gdal/test.tiff | Bin 0 -> 4009 bytes 270 files changed, 11042 insertions(+), 16939 deletions(-) diff --cc buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java index b95757d8c3,37d73c3e63..d112f5a46e --- a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java +++ b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java @@@ -71,11 -71,13 +71,12 @@@ public final class Dependency Map.entry("database", "non-free:sis-embedded-data"), // Optional. Map.entry("gui", "application:sis-javafx"), // Optional. Map.entry("cql", "core:sis-cql"), // Incubator. - Map.entry("storage.shapefile", "core:sis-shapefile"), - Map.entry("storage.gimi", "core:sis-gimi"), - Map.entry("storage.gsf", "core:sis-gsf"), - Map.entry("storage.geopackage", "core:sis-geopackage"), - Map.entry("storage.coveragejson", "core:sis-coveragejson"), + Map.entry("storage.shapefile", "storage:sis-shapefile"), + Map.entry("storage.gimi", "storage:sis-gimi"), + Map.entry("storage.gsf", "storage:sis-gsf"), + Map.entry("storage.gdal", "storage:sis-gdal"), + Map.entry("storage.geopackage", "storage:sis-geopackage"), + Map.entry("storage.coveragejson", "storage:sis-coveragejson"), - Map.entry("portrayal.map", "core:sis-portrayal-map"), Map.entry("webapp", "application:sis-webapp") ); diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java index 2f07233dd9,d5da02669e..eff6a7bb30 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java @@@ -280,8 -312,8 +280,8 @@@ public class DefaultVerticalDatum exten /** * Creates a new datum with the same values as the specified datum, which must be dynamic. * - * @param datum the datum to copy. + * @param datum the datum to copy. - * @throws ClassCastException if the given datum is not an instance of {@link DynamicReferenceFrame}. + * @throws ClassCastException if the given datum is not an instance of {@code DynamicReferenceFrame}. * * @see #castOrCopy(VerticalDatum) */ diff --cc endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java index 56a8da6d3a,9ddabf81b3..736716c4c3 --- a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java +++ b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java @@@ -381,14 -380,10 +380,10 @@@ public class GeoTiffStore extends DataS * Sets the {@code metadata/identificationInfo/resourceFormat} node to "GeoTIFF" format. */ final void setFormatInfo(final MetadataBuilder builder) { - try { - builder.setPredefinedFormat(Constants.GEOTIFF); - } catch (MetadataStoreException e) { - builder.addFormatName(Constants.GEOTIFF); - listeners.warning(e); - } + builder.setPredefinedFormat(Constants.GEOTIFF, listeners, true); + builder.addFormatReaderSIS(Constants.GEOTIFF); builder.addLanguage(Locale.ENGLISH, encoding, MetadataBuilder.Scope.METADATA); - builder.addResourceScope(ScopeCode.COVERAGE, null); + builder.addResourceScope(ScopeCode.valueOf("COVERAGE"), null); } /** diff --cc endorsed/src/org.apache.sis.storage.netcdf/test/org/apache/sis/storage/netcdf/MetadataReaderTest.java index da4760b701,ceabb95e9e..0dbb33acf7 --- a/endorsed/src/org.apache.sis.storage.netcdf/test/org/apache/sis/storage/netcdf/MetadataReaderTest.java +++ b/endorsed/src/org.apache.sis.storage.netcdf/test/org/apache/sis/storage/netcdf/MetadataReaderTest.java @@@ -16,6 -16,6 +16,7 @@@ */ package org.apache.sis.storage.netcdf; ++import static java.util.Map.entry; import java.io.IOException; import java.time.ZoneOffset; import java.time.LocalDateTime; diff --cc endorsed/src/org.apache.sis.storage.sql/main/org/apache/sis/storage/sql/feature/FeatureAnalyzer.java index 254ec5bb2f,a3f3375915..17c4f35638 --- a/endorsed/src/org.apache.sis.storage.sql/main/org/apache/sis/storage/sql/feature/FeatureAnalyzer.java +++ b/endorsed/src/org.apache.sis.storage.sql/main/org/apache/sis/storage/sql/feature/FeatureAnalyzer.java @@@ -34,10 -35,9 +35,9 @@@ import org.apache.sis.geometry.wrapper. import org.apache.sis.util.CharSequences; import org.apache.sis.util.Classes; import org.apache.sis.util.Numbers; - import org.apache.sis.util.privy.CollectionsExt; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.FeatureType; +// Specific to the main branch: +import org.apache.sis.feature.DefaultFeatureType; /** diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java index 7d5208d488,83d43908ba..e36b1806ab --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java @@@ -105,8 -106,8 +106,9 @@@ import org.apache.sis.coverage.grid.Gri import org.apache.sis.pending.jdk.JDK21; import org.apache.sis.measure.Units; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.FeatureType; +// Specific to the main branch: +import org.apache.sis.feature.DefaultFeatureType; ++import org.opengis.referencing.ReferenceIdentifier; /** @@@ -1049,19 -1046,24 +1047,29 @@@ public class MetadataBuilder * @see #addCompression(CharSequence) * @see #addFormatName(CharSequence) */ - public final void setPredefinedFormat(final String abbreviation) throws MetadataStoreException { + public boolean setPredefinedFormat(final String abbreviation, final StoreListeners listeners, boolean fallback) { if (abbreviation != null && abbreviation.length() != 0) { - if (format == null) { + if (format == null) try { format = MetadataSource.getProvided().lookup(Format.class, abbreviation); + /* + * Additional step for converting deprecated "name" and "specification" into non-deprecated properties. + * This step is not required on SIS branches that depend on development branches of GeoAPI 3.1 or 4.0. + */ + format = DefaultFormat.castOrCopy(format); - } else { + return true; + } catch (MetadataStoreException e) { + if (listeners != null) { + listeners.warning(Level.FINE, null, e); + } else { + Logging.recoverableException(StoreUtilities.LOGGER, null, null, e); + } + } + if (fallback) { addFormatName(abbreviation); + return true; } } + return false; } /** @@@ -3062,14 -3083,54 +3093,54 @@@ public final void setFormatEdition(final CharSequence value) { final InternationalString i18n = trim(value); if (i18n != null) { - @SuppressWarnings("LocalVariableHidesMemberVariable") - final DefaultFormat format = format(); - DefaultCitation c = DefaultCitation.castOrCopy(format.getFormatSpecificationCitation()); - if (c == null) { - c = new DefaultCitation(); - format.setFormatSpecificationCitation(c); + getFormatCitation().setEdition(i18n); + } + } + + /** + * Adds a note about which reader is used. This method should not be invoked before + * the {@linkplain #addFormatName format name} has been set. Storage location is: + * + * <ul> + * <li>{@code metadata/identificationInfo/resourceFormat/formatSpecificationCitation/identifier}</li> + * <li>{@code metadata/identificationInfo/resourceFormat/formatSpecificationCitation/otherCitationDetails}</li> + * </ul> + * + * If this method is used together with {@link #setPredefinedFormat setPredefinedFormat(…)}, + * then the predefined format should be set <strong>before</strong> this method. + * + * @param driver library-specific way to identify the format (mandatory). + * @param version the library version, or {@code null} if unknown. + */ - public final void addFormatReader(final Identifier driver, final Version version) { ++ public final void addFormatReader(final ReferenceIdentifier driver, final Version version) { + CharSequence title = null; + Citation authority = driver.getAuthority(); + if (authority != null) { + title = authority.getTitle(); + if (title != null) { + for (CharSequence t : authority.getAlternateTitles()) { + if (t.length() < title.length()) { + title = t; // Alternate titles are often abbreviations. + } + } } - c.setEdition(i18n); + } + final DefaultCitation c = getFormatCitation(); + addIfNotPresent(c.getIdentifiers(), driver); + c.setOtherCitationDetails( + Resources.formatInternational(Resources.Keys.ReadBy_2, (title != null) ? title : driver.getCodeSpace(), + (version != null) ? version : Vocabulary.formatInternational(Vocabulary.Keys.Unspecified))); + } + + /** + * Adds a note saying that Apache <abbr>SIS</abbr> has been used for decoding the format. + * This method should not be invoked before the {@linkplain #addFormatName format name} has been set. + * + * @param name the format name, or {@code null} if unspecified. + */ + public void addFormatReaderSIS(final String name) { + if (name != null) { + addFormatReader(new ImmutableIdentifier(Citations.SIS, Constants.SIS, name), Version.SIS); } } diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/csv/Store.java index 260b46eb5f,c45855411b..17a3e7e588 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/csv/Store.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/csv/Store.java @@@ -233,9 -226,9 +224,9 @@@ final class Store extends URIDataStore source = (r instanceof BufferedReader) ? (BufferedReader) r : new LineNumberReader(r); geometries = Geometries.factory(connector.getOption(OptionKey.GEOMETRY_LIBRARY)); dissociate = connector.getOption(DataOptionKey.FOLIATION_REPRESENTATION) == FoliationRepresentation.FRAGMENTED; - GeneralEnvelope envelope = null; - DefaultFeatureType featureType = null; - Foliation foliation = null; + @SuppressWarnings("LocalVariableHidesMemberVariable") GeneralEnvelope envelope = null; - @SuppressWarnings("LocalVariableHidesMemberVariable") FeatureType featureType = null; ++ @SuppressWarnings("LocalVariableHidesMemberVariable") DefaultFeatureType featureType = null; + @SuppressWarnings("LocalVariableHidesMemberVariable") Foliation foliation = null; try { final List<String> elements = new ArrayList<>(); source.mark(StorageConnector.READ_AHEAD_LIMIT); diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/esri/RasterStore.java index 36741066c3,75e4d8c67f..8aec44eba2 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/esri/RasterStore.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/esri/RasterStore.java @@@ -150,13 -150,9 +150,9 @@@ abstract class RasterStore extends PRJD final void createMetadata(final String formatName, final String formatKey) throws DataStoreException { final GridGeometry gridGeometry = getGridGeometry(); // May cause parsing of header. final MetadataBuilder builder = new MetadataBuilder(); - try { - builder.setPredefinedFormat(formatKey); - } catch (MetadataStoreException e) { - builder.addFormatName(formatName); - listeners.warning(e); - } + builder.setPredefinedFormat(formatKey, listeners, true); + builder.addFormatReaderSIS(provider != null ? provider.getShortName() : null); - builder.addResourceScope(ScopeCode.COVERAGE, null); + builder.addResourceScope(ScopeCode.valueOf("COVERAGE"), null); builder.addLanguage(Locale.ENGLISH, encoding, MetadataBuilder.Scope.METADATA); builder.addSpatialRepresentation(null, gridGeometry, true); builder.addExtent(gridGeometry.getEnvelope(), listeners); diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/folder/Store.java index 57ec403f4d,62fbf4df1c..6a92f0a6de --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/folder/Store.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/folder/Store.java @@@ -258,8 -258,8 +258,8 @@@ class Store extends DataStore implement @Override public synchronized Metadata getMetadata() { if (metadata == null) { - final MetadataBuilder mb = new MetadataBuilder(); + final var mb = new MetadataBuilder(); - mb.addResourceScope(ScopeCode.COLLECTION, Resources.formatInternational(Resources.Keys.DirectoryContent_1, getDisplayName())); + mb.addResourceScope(ScopeCode.valueOf("COLLECTION"), Resources.formatInternational(Resources.Keys.DirectoryContent_1, getDisplayName())); mb.addLanguage(configuration.getOption(OptionKey.LOCALE), configuration.getOption(OptionKey.ENCODING), MetadataBuilder.Scope.RESOURCE); diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WorldFileStore.java index 455035af03,692af3ddd9..c6311e4c6d --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WorldFileStore.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WorldFileStore.java @@@ -538,7 -534,8 +534,8 @@@ loop: for (int convention=0;; convent } } builder.addFormatName(format); // Does nothing if `format` is null. + builder.addFormatReaderSIS(WorldFileStoreProvider.NAME); - builder.addResourceScope(ScopeCode.COVERAGE, null); + builder.addResourceScope(ScopeCode.valueOf("COVERAGE"), null); builder.addSpatialRepresentation(null, getGridGeometry(MAIN_IMAGE), true); if (gridGeometry.isDefined(GridGeometry.ENVELOPE)) { builder.addExtent(gridGeometry.getEnvelope(), listeners); diff --cc endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/esri/AsciiGridStoreTest.java index d6486c4325,e4c06e0d50..df45f698fd --- a/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/esri/AsciiGridStoreTest.java +++ b/endorsed/src/org.apache.sis.storage/test/org/apache/sis/storage/esri/AsciiGridStoreTest.java @@@ -31,10 -34,11 +34,11 @@@ import org.apache.sis.storage.ProbeResu import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; import org.apache.sis.test.TestCase; + import static org.apache.sis.test.Assertions.assertMultilinesEquals; import static org.apache.sis.test.TestUtilities.getSingleton; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.metadata.identification.Identification; +// Specific to the main branch: +import org.opengis.metadata.identification.DataIdentification; /** diff --cc endorsed/src/org.apache.sis.util/main/module-info.java index 08bbfa92ad,040cfe0af5..aa0a172715 --- a/endorsed/src/org.apache.sis.util/main/module-info.java +++ b/endorsed/src/org.apache.sis.util/main/module-info.java @@@ -119,7 -120,10 +120,8 @@@ module org.apache.sis.util org.apache.sis.storage.netcdf, org.apache.sis.storage.geotiff, org.apache.sis.storage.earthobservation, - org.apache.sis.cql, // In the "incubator" sub-project. - org.apache.sis.portrayal.map, // In the "incubator" sub-project. org.apache.sis.portrayal, + org.apache.sis.storage.gdal, // In the "incubator" sub-project. org.apache.sis.storage.gsf, // In the "incubator" sub-project. org.apache.sis.cloud.aws, org.apache.sis.console, diff --cc endorsed/src/org.apache.sis.util/test/org/apache/sis/test/ContentVerifier.java index d2c984973f,0000000000..7b572b7e59 mode 100644,000000..100644 --- a/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/ContentVerifier.java +++ b/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/ContentVerifier.java @@@ -1,42 -1,0 +1,57 @@@ +/* + * 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.test; + ++import java.util.Map; ++import java.util.function.Predicate; +import org.opengis.metadata.Metadata; + +// Test dependencies +import static org.junit.jupiter.api.Assumptions.abort; + + +/** + * Place-holder for a GeoAPI 3.1 class. Used only for allowing the code to compile. + * For real test execution, see the development branches on GeoAPI 4.0-SNAPSHOT. + */ +@SuppressWarnings("doclint:missing") +public class ContentVerifier { + public void addPropertyToIgnore(Class<?> type, String property) { + abort("This test requires GeoAPI 3.1."); + } + ++ public void addPropertyToIgnore(Predicate<String> ignore) { ++ abort("This test requires GeoAPI 3.1."); ++ } ++ ++ public void addExpectedValue(String property, Object value) { ++ abort("This test requires GeoAPI 3.1."); ++ } ++ ++ @SafeVarargs ++ public final void addExpectedValues(final Map.Entry<String,?>... properties) { ++ abort("This test requires GeoAPI 3.1."); ++ } ++ + public void addMetadataToVerify(Metadata actual) { + abort("This test requires GeoAPI 3.1."); + } + - public void assertMetadataEquals(final String path, final Object value, final Object... others) { ++ public void assertMetadataEquals() { + abort("This test requires GeoAPI 3.1."); + } +} diff --cc incubator/build.gradle.kts index d4a0e06d86,85c219f390..ddff84ace1 --- a/incubator/build.gradle.kts +++ b/incubator/build.gradle.kts @@@ -129,7 -139,10 +129,9 @@@ fun addExportForTests(args : MutableLis */ tasks.test { val args = mutableListOf("-enableassertions") + args.add("--enable-native-access") + args.add("org.apache.sis.storage.gsf") addExportForTests(args) - addExport(args, "org.apache.sis.cql", "org.apache.sis.cql", "ALL-UNNAMED") setAllJvmArgs(args) testLogging { events("FAILED", "STANDARD_OUT", "STANDARD_ERROR") diff --cc incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java index c706caee80,b5f642304f..7c316a4154 --- a/incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java +++ b/incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java @@@ -197,11 -198,10 +197,10 @@@ public class ShapefileStoreTest final Path temp = folder.resolve("test.shp"); final String name = temp.getFileName().toString().split("\\.")[0]; try (final ShapefileStore store = new ShapefileStore(temp)) { - Path[] componentFiles = store.getComponentFiles(); - assertEquals(0, componentFiles.length); + assertTrue(store.getFileSet().orElseThrow().getPaths().isEmpty()); {//create type - final FeatureType type = createType(); + final DefaultFeatureType type = createType(); store.updateType(type); } diff --cc optional/src/org.apache.sis.gui/main/org/apache/sis/gui/metadata/IdentificationInfo.java index e5617a1c59,9bb222a0f0..b9bfdec7f2 --- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/metadata/IdentificationInfo.java +++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/metadata/IdentificationInfo.java @@@ -200,16 -198,18 +201,18 @@@ final class IdentificationInfo extends BackgroundThreads.execute(aggregateWalker = new Task<Set<GeographicBoundingBox>>() { /** Invoked in a background thread for fetching bounding boxes. */ @Override protected Set<GeographicBoundingBox> call() throws DataStoreException { - final Set<GeographicBoundingBox> boxes = new LinkedHashSet<>(); - for (final Resource child : resource.components()) { - final Metadata metadata = child.getMetadata(); - if (isCancelled()) break; - if (metadata != null) { - for (final Identification id : nonNull(metadata.getIdentificationInfo())) { - if (id instanceof DataIdentification) { - for (final Extent extent : ((DataIdentification) id).getExtents()) { - final GeographicBoundingBox b = Extents.getGeographicBoundingBox(extent); - if (b != null) boxes.add(b); + final var boxes = new LinkedHashSet<GeographicBoundingBox>(); + try { + for (final Resource child : resource.components()) { + final Metadata metadata = child.getMetadata(); + if (isCancelled()) break; + if (metadata != null) { + for (final Identification id : nonNull(metadata.getIdentificationInfo())) { - if (id != null) { - for (final Extent extent : id.getExtents()) { ++ if (id instanceof DataIdentification did) { ++ for (final Extent extent : did.getExtents()) { + final GeographicBoundingBox b = Extents.getGeographicBoundingBox(extent); + if (b != null) boxes.add(b); + } } } }