This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sis.git
commit fb64b0b9b0437845a5c193bea8082bb3f28d5495 Merge: df88006 c2534df Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Thu Jan 20 19:13:39 2022 +0100 Merge branch 'geoapi-3.1' application/sis-javafx/pom.xml | 4 +- .../src/main/artifact/conf/logging.properties | 12 +- .../java/org/apache/sis/gui/dataset/LogViewer.java | 158 +++++++++--- .../apache/sis/gui/dataset/ResourceExplorer.java | 2 +- .../org/apache/sis/gui/metadata/MetadataTree.java | 4 +- .../org/apache/sis/internal/gui/GUIUtilities.java | 64 +++++ .../org/apache/sis/internal/gui/LogHandler.java | 177 +++++++++++--- .../sis/internal/gui/PropertyValueFormatter.java | 16 +- .../org/apache/sis/internal/gui/PropertyView.java | 114 +++------ .../org/apache/sis/internal/gui/Resources.java | 5 + .../apache/sis/internal/gui/Resources.properties | 1 + .../sis/internal/gui/Resources_fr.properties | 1 + .../org/apache/sis/internal/gui/TextFormats.java | 132 ++++++++++ .../apache/sis/internal/gui/GUIUtilitiesTest.java | 81 +++++- core/sis-build-helper/pom.xml | 10 +- .../apache/sis/coverage/grid/DimensionReducer.java | 2 +- .../org/apache/sis/coverage/grid/GridExtent.java | 2 + .../org/apache/sis/coverage/grid/GridGeometry.java | 66 ++++- .../sis/coverage/grid/GridDerivationTest.java | 27 ++ .../apache/sis/coverage/grid/GridGeometryTest.java | 36 ++- .../org/apache/sis/metadata/MetadataStandard.java | 4 +- .../org/apache/sis/metadata/MetadataVisitor.java | 4 +- .../org/apache/sis/metadata/TreeTableView.java | 4 +- .../org/apache/sis/metadata/sql/Dispatcher.java | 4 +- .../java/org/apache/sis/geometry/Envelopes.java | 13 +- .../sis/internal/referencing/AxesMapper.java | 160 ++++++++++++ .../sis/internal/referencing/AxisDirections.java | 59 ++--- .../apache/sis/internal/referencing/Resources.java | 19 +- .../sis/internal/referencing/Resources.properties | 5 +- .../internal/referencing/Resources_fr.properties | 5 +- .../sis/referencing/cs/CoordinateSystems.java | 26 +- .../sis/referencing/cs/DirectionAlongMeridian.java | 15 +- .../apache/sis/referencing/cs/package-info.java | 2 +- .../factory/ConcurrentAuthorityFactory.java | 13 +- .../referencing/factory/FactoryDataException.java | 13 +- .../referencing/factory/GeodeticObjectFactory.java | 30 ++- .../factory/IdentifiedObjectFinder.java | 28 ++- .../sis/referencing/factory/package-info.java | 2 +- .../referencing/factory/sql/EPSGCodeFinder.java | 9 +- .../referencing/factory/sql/EPSGDataAccess.java | 10 +- .../operation/AbstractCoordinateOperation.java | 2 +- .../operation/CoordinateOperationRegistry.java | 4 +- .../operation/DefaultConcatenatedOperation.java | 12 +- .../operation/builder/LinearTransformBuilder.java | 12 +- .../operation/builder/LocalizationGridBuilder.java | 2 +- .../builder/LocalizationGridException.java | 114 +++++++++ .../operation/builder/ProjectedTransformTry.java | 2 +- .../operation/projection/ConformalProjection.java | 2 +- .../operation/projection/ObliqueMercator.java | 12 +- .../sis/internal/referencing/AxesMapperTest.java | 97 ++++++++ .../internal/referencing/AxisDirectionsTest.java | 27 +- .../sis/test/suite/ReferencingTestSuite.java | 1 + .../org/apache/sis/internal/system/Semaphores.java | 26 +- .../apache/sis/internal/system/package-info.java | 2 +- .../apache/sis/internal/util/PropertyFormat.java | 4 +- .../main/java/org/apache/sis/util/Exceptions.java | 5 +- .../apache/sis/util/logging/PerformanceLevel.java | 25 +- .../apache/sis/util/resources/KeyConstants.java | 2 +- .../org/apache/sis/util/resources/Vocabulary.java | 10 + .../sis/util/resources/Vocabulary.properties | 2 + .../sis/util/resources/Vocabulary_fr.properties | 2 + ide-project/NetBeans/nbproject/genfiles.properties | 4 +- ide-project/NetBeans/nbproject/project.xml | 4 + pom.xml | 8 +- .../apache/sis/internal/earth/netcdf/GCOM_C.java | 2 +- .../apache/sis/internal/earth/netcdf/GCOM_W.java | 2 +- src/main/config/logging.properties | 8 +- .../java/org/apache/sis/internal/netcdf/Axis.java | 16 ++ .../org/apache/sis/internal/netcdf/Dimension.java | 16 +- .../java/org/apache/sis/internal/netcdf/Grid.java | 18 +- .../apache/sis/internal/netcdf/GridCacheValue.java | 22 +- .../org/apache/sis/internal/netcdf/Linearizer.java | 139 +++++++++-- .../apache/sis/internal/netcdf/NamedElement.java | 6 +- .../org/apache/sis/internal/netcdf/Variable.java | 24 +- .../sis/internal/netcdf/ucar/DimensionWrapper.java | 13 +- .../sis/internal/storage/AbstractResource.java | 19 ++ .../apache/sis/internal/storage/folder/Store.java | 2 +- .../sis/internal/storage/xml/AbstractProvider.java | 29 +-- .../org/apache/sis/storage/DataStoreProvider.java | 272 +++++++++++++++------ .../apache/sis/storage/event/QuietLogRecord.java | 70 ------ .../apache/sis/storage/event/StoreListeners.java | 59 +++-- .../org/apache/sis/storage/event/package-info.java | 3 +- .../apache/sis/storage/DataStoreProviderTest.java | 28 +-- .../internal/storage/xml/stream/StaxDataStore.java | 10 +- .../sis/internal/storage/gpx/ReaderTest.java | 8 +- .../sis/internal/storage/gpx/WriterTest.java | 17 +- 86 files changed, 1904 insertions(+), 599 deletions(-) diff --cc core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java index 151b374,0ef45e2..2be8464 --- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java +++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java @@@ -883,6 -886,67 +886,67 @@@ public class GridGeometry implements Le } /** + * Returns the "real world" bounding box of this grid geometry transformed to the given CRS. + * This envelope is computed from the {@linkplain #getExtent() grid extent} if available, + * or from the {@linkplain #getEnvelope() envelope} otherwise. + * + * @param crs the desired coordinate reference system for the returned envelope. + * @return the bounding box in "real world" coordinates (never {@code null}). + * @throws IncompleteGridGeometryException if this grid geometry has no extent and no envelope. + * @throws TransformException if the envelope can not be transformed to the specified CRS. + * + * @since 1.2 + */ + public Envelope getEnvelope(final CoordinateReferenceSystem crs) throws TransformException { + ArgumentChecks.ensureNonNull("crs", crs); + final int bitmask; // CRS, EXTENT or GRID_TO_CRS + final short errorKey; // Resource key for error message. + final CoordinateReferenceSystem sourceCRS = getCoordinateReferenceSystem(envelope); + if (Utilities.equalsIgnoreMetadata(sourceCRS, crs)) { + return envelope; + } else if (sourceCRS == null) { + bitmask = CRS; + errorKey = Resources.Keys.UnspecifiedCRS; + } else if (extent == null && envelope == null) { + bitmask = EXTENT; + errorKey = Resources.Keys.UnspecifiedGridExtent; + } else if (cornerToCRS == null && envelope == null) { + bitmask = GRID_TO_CRS; + errorKey = Resources.Keys.UnspecifiedTransform; + } else try { + /* + * At this point the envelope should never be null because of invariants enforced by constructors. + * But we nevertheless perform some paranoiac checks. If we fail to transform the envelope, its okay. + * The main transform is the one operating on grid extent. The envelope transformation is for taking + * in account singularity points (mostly poles) and in case this grid geometry is a sub-grid geometry, + * in which case the envelope may have been clipped and we want to keep that clip. + */ + final boolean onlyEnvelope = (extent == null || cornerToCRS == null); + final CoordinateOperation op = findOperation(sourceCRS, crs, geographicBBox()); + Envelope clip; + try { + clip = Envelopes.transform(op, envelope); + if (onlyEnvelope) return clip; + } catch (TransformException e) { + if (onlyEnvelope) throw e; + recoverableException("getEnvelope", e); + clip = null; + } + MathTransform tr = MathTransforms.concatenate(cornerToCRS, op.getMathTransform()); + final GeneralEnvelope env = extent.toCRS(tr, tr, clip); + env.setCoordinateReferenceSystem(op.getTargetCRS()); + env.normalize(); + if (clip != null) { + env.intersect(clip); + } + return env; + } catch (FactoryException e) { - throw new TransformException(e); ++ throw new TransformException(null, e); + } + throw incomplete(bitmask, errorKey); + } + + /** * Returns the approximate latitude and longitude coordinates of the grid. * The prime meridian is Greenwich, but the geodetic reference frame is not necessarily WGS 84. * This is computed from the {@linkplain #getEnvelope() envelope} if the coordinate reference system diff --cc ide-project/NetBeans/nbproject/genfiles.properties index c9bfff4,f00261f..9598b10 --- a/ide-project/NetBeans/nbproject/genfiles.properties +++ b/ide-project/NetBeans/nbproject/genfiles.properties @@@ -3,6 -3,6 +3,6 @@@ build.xml.data.CRC32=58e6b21c build.xml.script.CRC32=462eaba0 build.xml.stylesheet.CRC32=28e38971@1.53.1.46 - nbproject/build-impl.xml.data.CRC32=bff50692 -nbproject/build-impl.xml.data.CRC32=4e7b2ef2 -nbproject/build-impl.xml.script.CRC32=7ab9bfcf ++nbproject/build-impl.xml.data.CRC32=f188e30a +nbproject/build-impl.xml.script.CRC32=933f5834 - nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 + nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.101.0.48