[sis] 02/02: First draft of a limit applied (at visualisation time) on image reprojection. This is for preventing exceptions when rendering a world image in Mercator. For now we check only the World M
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git commit 06e6987fd070a8677370ca3d9ff38fa503c7472b Author: Martin Desruisseaux AuthorDate: Thu Jun 30 18:55:01 2022 +0200 First draft of a limit applied (at visualisation time) on image reprojection. This is for preventing exceptions when rendering a world image in Mercator. For now we check only the World Mercator projection, but other cases should be added progressively in the future. --- .../internal/map/coverage/ProjectionLimits.java| 108 + .../sis/internal/map/coverage/RenderingData.java | 55 ++- .../main/java/org/apache/sis/referencing/CRS.java | 4 +- 3 files changed, 164 insertions(+), 3 deletions(-) diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/ProjectionLimits.java b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/ProjectionLimits.java new file mode 100644 index 00..c955e3ef3a --- /dev/null +++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/ProjectionLimits.java @@ -0,0 +1,108 @@ +/* + * 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.internal.map.coverage; + +import org.opengis.geometry.Envelope; +import org.opengis.referencing.operation.MathTransform; +import org.opengis.referencing.operation.CoordinateOperation; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.apache.sis.geometry.GeneralEnvelope; +import org.apache.sis.referencing.CRS; +import org.apache.sis.referencing.operation.projection.Mercator; +import org.apache.sis.referencing.operation.projection.NormalizedProjection; +import org.apache.sis.referencing.operation.transform.MathTransforms; + + +/** + * Map projection for which to apply a limit for avoiding rendering problems. + * The most common case is the Mercator projection, for which we need to put + * a limit for avoiding to reach the poles. + * + * This is a first draft to be expanded progressively. + * + * @author Martin Desruisseaux (Geomatys) + * @version 1.3 + * @since 1.3 + * @module + */ +final class ProjectionLimits { +/** + * List of rules for which we defines limits. + * This list may be expanded in future versions. + */ +private static final ProjectionLimits[] RULES = { +new ProjectionLimits(Mercator.class) +}; + +/** + * The type of map projection for which this rule applies. + */ +private final Class target; + +/** + * Creates a new rule for map projection limits. + * + * @param target the type of map projection for which this rule applies. + */ +private ProjectionLimits(final Class target) { +this.target = target; +} + +/** + * Returns the map projection limits for rendering a map in the given objective CRS. + * The default implementation returns the CRS domain of validity, which is okay for + * the "World Mercator" projection but is often too conservative for other projections. + * For example in the case of UTM projection, we needs to allow both hemisphere and a larger zone. + * + * @param objectiveCRS the CRS used for rendering the map. + * @return limits where to crop the projected image in objective CRS, or {@code null} if none. + */ +Envelope limits(final CoordinateReferenceSystem objectiveCRS) { +return CRS.getDomainOfValidity(objectiveCRS); +} + +/** + * Returns the map projection limits for rendering a map after the specified "data to objective" transform. + * + * @param changeOfCRS the operation applied on data before rendering in objective CRS. + * @return limits where to crop the projected image in objective CRS, or {@code null} if none. + */ +static Envelope find(final CoordinateOperation changeOfCRS) { +Envelope limits = null; +if (changeOfCRS != null) { +GeneralEnvelope intersection = null; +for (final MathTransform step : MathTransforms.getSteps(changeOfCRS.getMathTransform())) { +for (final
[sis] branch geoapi-4.0 updated (db22d5470c -> 06e6987fd0)
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a change to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git from db22d5470c Adjust the precision of coordinate numbers shown when automatically scalling from meters to kilometers. new 4bce208f4d Replace "Proj.4" by "PROJ" when refering to the project. We keep "Proj4" as the namespace for PROJ-specific parameters because those parameters were defined before PROJ 6 provided full EPSG support. new 06e6987fd0 First draft of a limit applied (at visualisation time) on image reprojection. This is for preventing exceptions when rendering a world image in Mercator. For now we check only the World Mercator projection, but other cases should be added progressively in the future. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../sis/metadata/iso/citation/Citations.java | 7 +- .../apache/sis/metadata/sql/MetadataFallback.java | 10 +- .../org/apache/sis/metadata/sql/Citations.sql | 6 +- .../sis/metadata/iso/citation/CitationsTest.java | 2 +- .../sis/metadata/sql/MetadataSourceTest.java | 2 +- .../internal/map/coverage/ProjectionLimits.java| 108 + .../sis/internal/map/coverage/RenderingData.java | 55 ++- .../main/java/org/apache/sis/referencing/CRS.java | 4 +- .../operation/projection/NormalizedProjection.java | 4 +- .../operation/projection/TransverseMercator.java | 2 +- .../operation/projection/package-info.java | 3 +- .../operation/projection/AlbersEqualAreaTest.java | 4 +- .../projection/CylindricalEqualAreaTest.java | 2 +- .../operation/projection/SinusoidalTest.java | 4 +- .../report/CoordinateReferenceSystems.java | 4 +- .../sis/test/integration/ConsistencyTest.java | 4 +- .../org/apache/sis/internal/util/Constants.java| 2 + 17 files changed, 197 insertions(+), 26 deletions(-) create mode 100644 core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/ProjectionLimits.java
[sis] 01/02: Replace "Proj.4" by "PROJ" when refering to the project. We keep "Proj4" as the namespace for PROJ-specific parameters because those parameters were defined before PROJ 6 provided full EP
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git commit 4bce208f4d803db8d13832ea50af7bec141eb006 Author: Martin Desruisseaux AuthorDate: Thu Jun 30 12:50:40 2022 +0200 Replace "Proj.4" by "PROJ" when refering to the project. We keep "Proj4" as the namespace for PROJ-specific parameters because those parameters were defined before PROJ 6 provided full EPSG support. --- .../java/org/apache/sis/metadata/iso/citation/Citations.java | 7 +-- .../java/org/apache/sis/metadata/sql/MetadataFallback.java | 10 +- .../main/resources/org/apache/sis/metadata/sql/Citations.sql | 6 +++--- .../org/apache/sis/metadata/iso/citation/CitationsTest.java| 2 +- .../java/org/apache/sis/metadata/sql/MetadataSourceTest.java | 2 +- .../referencing/operation/projection/NormalizedProjection.java | 4 ++-- .../referencing/operation/projection/TransverseMercator.java | 2 +- .../sis/referencing/operation/projection/package-info.java | 3 ++- .../referencing/operation/projection/AlbersEqualAreaTest.java | 4 ++-- .../operation/projection/CylindricalEqualAreaTest.java | 2 +- .../sis/referencing/operation/projection/SinusoidalTest.java | 4 ++-- .../sis/referencing/report/CoordinateReferenceSystems.java | 4 +++- .../java/org/apache/sis/test/integration/ConsistencyTest.java | 4 +++- .../src/main/java/org/apache/sis/internal/util/Constants.java | 2 ++ 14 files changed, 33 insertions(+), 23 deletions(-) diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java index c3a74c6c72..1a8f066afe 100644 --- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java +++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java @@ -351,7 +351,10 @@ public final class Citations extends Static { public static final IdentifierSpace GEOTIFF = new CitationConstant.Authority<>(Constants.GEOTIFF); /** - * The authority for identifiers of objects defined by the https://proj4.org/;>Proj.4 project. + * The authority for identifiers of objects defined by the https://proj.org/;>PROJ project. + * We use the {@code PROJ4} name for historical reasons, because those identifiers were defined mostly + * when the project was known as "Proj.4". Starting at PROJ version 6, EPSG identifiers should be used + * instead. * * Main usage * This value can be returned by: @@ -361,7 +364,7 @@ public final class Citations extends Static { * * @since 0.4 */ -public static final IdentifierSpace PROJ4 = new CitationConstant.Authority<>(Constants.PROJ4); +public static final IdentifierSpace PROJ4 = new CitationConstant.Authority<>("PROJ", Constants.PROJ4); /** * The authority for identifiers of objects defined by MapInfo. diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java index b094e70a31..4f7a6f2f3e 100644 --- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java +++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java @@ -156,8 +156,8 @@ final class MetadataFallback extends MetadataSource { presentationForm = PresentationForm.DOCUMENT_DIGITAL; break; } -case "IOGP": { // Not in public API (see Citations.IOGP javadoc) -title = "IOGP Surveying and Positioning Guidance Note 7"; +case "IOGP": { // Not in public API (see Citations.IOGP javadoc) +title= "IOGP Surveying and Positioning Guidance Note 7"; code = Constants.IOGP; copyFrom = Constants.EPSG; presentationForm = PresentationForm.DOCUMENT_DIGITAL; @@ -188,9 +188,9 @@ final class MetadataFallback extends MetadataSource { alternateTitle = key; break; } -case Constants.PROJ4: { -title = "Proj"; -code = "Proj4"; +case "PROJ": { +title = "PROJ coordinate transformation software library"; +code = "PROJ"; codeSpace = "OSGeo"; break; } diff --git a/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Citations.sql b/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Citations.sql index 392881ce98..69a3fc4cce 100644 --- a/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Citations.sql +++
[sis] 01/01: Merge branch 'geoapi-3.1'
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 09d75edb69ea5c0f394c768ac7cdf4a5de80 Merge: 78262e7625 b2d141b5e9 Author: Martin Desruisseaux AuthorDate: Thu Jun 30 12:13:16 2022 +0200 Merge branch 'geoapi-3.1' application/sis-console/src/main/artifact/README | 6 +- .../org/apache/sis/console/TransformCommand.java | 4 +- application/sis-javafx/pom.xml | 5 + application/sis-javafx/src/main/artifact/README| 4 +- .../main/java/org/apache/sis/gui/DataViewer.java | 13 +- .../apache/sis/gui/coverage/CoverageCanvas.java| 286 --- .../apache/sis/gui/coverage/CoverageControls.java | 107 +-- .../apache/sis/gui/coverage/CoverageExplorer.java | 128 ++- .../apache/sis/gui/coverage/CoverageStyling.java | 12 +- .../org/apache/sis/gui/coverage/GridControls.java | 45 +- .../apache/sis/gui/coverage/GridSliceSelector.java | 638 +++ .../java/org/apache/sis/gui/coverage/GridView.java | 95 ++- .../org/apache/sis/gui/coverage/GridViewSkin.java | 19 +- .../org/apache/sis/gui/coverage/ImageRequest.java | 181 ++--- .../gui/coverage/MultiResolutionImageLoader.java | 74 +- .../apache/sis/gui/coverage/ViewAndControls.java | 188 +++-- .../org/apache/sis/gui/coverage/package-info.java | 2 +- .../org/apache/sis/gui/dataset/DataWindow.java | 116 --- .../org/apache/sis/gui/dataset/FeatureTable.java | 7 +- .../java/org/apache/sis/gui/dataset/LoadEvent.java | 47 -- .../java/org/apache/sis/gui/dataset/LogViewer.java | 2 +- .../org/apache/sis/gui/dataset/ResourceEvent.java | 2 +- .../apache/sis/gui/dataset/ResourceExplorer.java | 170 ++-- .../org/apache/sis/gui/dataset/ResourceTree.java | 113 +-- .../org/apache/sis/gui/dataset/SelectedData.java | 91 --- .../org/apache/sis/gui/dataset/WindowHandler.java | 474 +++ .../org/apache/sis/gui/dataset/WindowManager.java | 246 ++ .../org/apache/sis/gui/dataset/package-info.java | 2 +- .../org/apache/sis/gui/map/GestureFollower.java| 293 +++ .../java/org/apache/sis/gui/map/MapCanvas.java | 339 +++- .../java/org/apache/sis/gui/map/MapCanvasAWT.java | 16 +- .../main/java/org/apache/sis/gui/map/MapMenu.java | 4 +- .../org/apache/sis/gui/map/OperationFinder.java| 8 +- .../java/org/apache/sis/gui/map/StatusBar.java | 862 - .../org/apache/sis/gui/map/ValuesUnderCursor.java | 74 +- .../java/org/apache/sis/gui/map/package-info.java | 2 +- .../org/apache/sis/gui/metadata/MetadataTree.java | 4 +- .../main/java/org/apache/sis/gui/package-info.java | 2 +- .../apache/sis/gui/referencing/AuthorityCodes.java | 4 +- .../org/apache/sis/gui/referencing/MenuSync.java | 291 +-- .../sis/gui/referencing/ObjectStringConverter.java | 14 +- .../gui/referencing/PositionableProjection.java| 4 +- .../gui/referencing/RecentReferenceSystems.java| 391 +++--- .../java/org/apache/sis/gui/referencing/Utils.java | 4 +- .../apache/sis/internal/gui/BackgroundThreads.java | 28 +- .../apache/sis/internal/gui/DataStoreOpener.java | 106 ++- .../apache/sis/internal/gui/ExceptionReporter.java | 62 +- .../org/apache/sis/internal/gui/GUIUtilities.java | 54 +- .../apache/sis/internal/gui/ImageConverter.java| 4 +- .../sis/internal/gui/OptionalDataDownloader.java | 2 +- .../org/apache/sis/internal/gui/PrivateAccess.java | 54 ++ .../org/apache/sis/internal/gui/Resources.java | 15 + .../apache/sis/internal/gui/Resources.properties | 3 + .../sis/internal/gui/Resources_fr.properties | 3 + .../java/org/apache/sis/internal/gui/Styles.java | 13 +- .../org/apache/sis/internal/gui/ToolbarButton.java | 8 +- .../internal/gui/control/ColorColumnHandler.java | 5 +- .../sis/internal/gui/control/SyncWindowList.java | 252 ++ .../sis/internal/gui/control/TabularWidget.java| 99 +++ .../sis/internal/gui/control/ValueColorMapper.java | 26 +- .../sis/internal/gui/control/package-info.java | 2 +- .../org/apache/sis/internal/gui/package-info.java | 2 +- .../apache/sis/gui/coverage/CoverageCanvasApp.java | 4 +- .../sis/gui/coverage/GridSliceSelectorApp.java | 80 ++ .../java/org/apache/sis/openoffice/CalcAddins.java | 3 +- .../org/apache/sis/internal/book/Assembler.java| 111 +-- .../book/{Resources.java => Characters.java} | 37 +- .../apache/sis/internal/book/CodeColorizer.java| 37 +- .../org/apache/sis/internal/book/Resources_en.java | 33 - .../org/apache/sis/internal/book/Resources_fr.java | 47 -- .../org/apache/sis/internal/book/package-info.java | 8 +- .../org/apache/sis/internal/doclet/Rewriter.java | 3 +- .../sis/coverage/grid/BufferedGridCoverage.java| 82 +- .../sis/coverage/grid/ConvertedGridCoverage.java | 66 +-
[sis] branch master updated (78262e7625 -> 09d75edb69)
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/sis.git from 78262e7625 Set version to 1.3-SNAPSHOT. add 2170ce336f Keep (for now) the Java 8 layout (no module page) in generated javadoc. add afb0926294 Remove `LoggerFactory` and related classes and methods. add 58cd2d406c Remove deprecated methods that do not override an abstract methods. add 3fa01381f1 Apply a longitude wraparound on the Mercator projection. add f91de6eb21 Partial revert of commit 58cd2d4: the null check is still needed. add 610a9f8a9e Increment version number from 1.2 to 1.3. add 1169e55956 Generate the developer guide directly in the `asf-staging` branch. add 7d88d4c0f3 Remove the generation of TOC fragment in each chapter. Will be replaced by better navigation pane. add 85769b9542 Avoid misleading error message for unsupported JPEG compression in GeoTIFF. Documentation update. add bc23143019 Add a `GridCoverageProcessor.convert(…)` method. add ab28c7b648 JTS : fix empty geometry transform exception add ceb6064e23 Add missing synchronization. add 8da18e9dcb Add assertions relative to synchronization. add 47cde567fb Rename logging level relative to slow operations. add 3ad01bce4c Fix the number of fraction digits shown in the table of values. add 985839f07f Ignore soft-hyphens when searching keyword. Reduce the number of heading levels used for the table of content. add 9b361070f3 Upgrade JavaFX dependencies. Minor documentation fixes. add fd6ef02230 Handle the status bar layout outside `GridView`. Handle more common properties in the `ViewAndControls` parent class. add 9adfa358f6 Add sliders for selecting the slice to show in a 3 (or more) dimensional data cube. Slider graduation is okay but selecting a value does not yet have an effect. add b74a638936 Fix an erroneous temporal coordinate shown in the status bar with the CRS is (x,y,t). add 6664478fd9 More compact representation of the temporal coordinate in a (x,y,t) tuple. add 72c433cb3a Add a `GridExtent.setRange(…)` method. Change the order of some other methods for grouping related methods. add 20be7e050e Build new `GridExtent` from slider positions. add 270416850b More tolerant parsing of NaN value for GDAL_NODATA in TIFF file. It is sometime written as "nan" (all lower case). add ad004b9f2b Show the currently selected value in the status bar during slider adjustment. add b82266fafa Use CRS axis name instead of grid axis name when possible. add ad2649f616 Rename `GridExtent.setRange(…)` as `withRange(…)` because it does not modify the current instance. add 6dd5c5754d Add a `PixelInCell` argument to the `GridExtent.getPointOfInterest()` method. It matter when we use that method for getting the coordinates of a slice. add e26c2825bf Change of slider position now cause the rendering of corresponding slice of data. It works for `GridView` only at this stage, not yet for `CoverageCanvas`. add 9a63af427f Add a `Envelopes.transformWraparounds(…)` method for getting the individual envelopes before their union is computed. This method is useful only if the transforms chain contains at least one `WraparoundTransform` step. add fbde8a0a60 Avoid wraparound when the result does not intersect the base grid geometry. The fix use `GridExtent.toEnvelopes(…)` (note the pluarl form) is applied in only once place for now, but we should check if it applies to more places. add c0494204bc Method renaming, documentation update, more specific exception. add 98dd50f7ab Revert commit 58cd2d406c5703fc029b0ad402bdbec30401e662 (removal of `sliceExtentProperty`) but without public access for now. We need this property for taking in account the slice selected by the slider. add c112a871b4 Initial version of a `CoverangeCanvas` capable to navigate in dimensions over 2 (using sliders). It required a change in the ways controls are managed, e.g. with `StatusBar` now managed by `ViewAndControls`. add f25739200b Various bug fixes related to the navigation in two-dimensional slices: - Random `MismatchedDimensionException` in the status bar. - Slice not updated when navigating using keyboard. - Map projection and zoom level lost when changing slice. - `CoverageExplorer` resource and coverage properties set to null. add fc5d74d945 When the position given to `GridEvaluator.apply(…)` does not have enough dimensions, default to the grid coordinates specified by `setDefaultSlice(…)` method call. add 4d0e134cc8 Improvement in the cache of `RenderedImage` instances: - Revisit the `equals(Object)` and `hashCode()` methods. - Reuse existing `RenderedImage` instances for a given `SliceExtent`. add 6224e87dca Redesign the management of multiple windows opened on the same
[sis] branch geoapi-3.1 updated (1eaa4fa82c -> b2d141b5e9)
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a change to branch geoapi-3.1 in repository https://gitbox.apache.org/repos/asf/sis.git from 1eaa4fa82c Merge branch 'geoapi-4.0' into geoapi-3.1 for getting last fixes before release. add 2170ce336f Keep (for now) the Java 8 layout (no module page) in generated javadoc. add afb0926294 Remove `LoggerFactory` and related classes and methods. add 58cd2d406c Remove deprecated methods that do not override an abstract methods. add 3fa01381f1 Apply a longitude wraparound on the Mercator projection. add f91de6eb21 Partial revert of commit 58cd2d4: the null check is still needed. add 610a9f8a9e Increment version number from 1.2 to 1.3. add 1169e55956 Generate the developer guide directly in the `asf-staging` branch. add 7d88d4c0f3 Remove the generation of TOC fragment in each chapter. Will be replaced by better navigation pane. add 85769b9542 Avoid misleading error message for unsupported JPEG compression in GeoTIFF. Documentation update. add bc23143019 Add a `GridCoverageProcessor.convert(…)` method. add ab28c7b648 JTS : fix empty geometry transform exception add ceb6064e23 Add missing synchronization. add 8da18e9dcb Add assertions relative to synchronization. add 47cde567fb Rename logging level relative to slow operations. add 3ad01bce4c Fix the number of fraction digits shown in the table of values. add 985839f07f Ignore soft-hyphens when searching keyword. Reduce the number of heading levels used for the table of content. add 9b361070f3 Upgrade JavaFX dependencies. Minor documentation fixes. add fd6ef02230 Handle the status bar layout outside `GridView`. Handle more common properties in the `ViewAndControls` parent class. add 9adfa358f6 Add sliders for selecting the slice to show in a 3 (or more) dimensional data cube. Slider graduation is okay but selecting a value does not yet have an effect. add b74a638936 Fix an erroneous temporal coordinate shown in the status bar with the CRS is (x,y,t). add 6664478fd9 More compact representation of the temporal coordinate in a (x,y,t) tuple. add 72c433cb3a Add a `GridExtent.setRange(…)` method. Change the order of some other methods for grouping related methods. add 20be7e050e Build new `GridExtent` from slider positions. add 270416850b More tolerant parsing of NaN value for GDAL_NODATA in TIFF file. It is sometime written as "nan" (all lower case). add ad004b9f2b Show the currently selected value in the status bar during slider adjustment. add b82266fafa Use CRS axis name instead of grid axis name when possible. add ad2649f616 Rename `GridExtent.setRange(…)` as `withRange(…)` because it does not modify the current instance. add 6dd5c5754d Add a `PixelInCell` argument to the `GridExtent.getPointOfInterest()` method. It matter when we use that method for getting the coordinates of a slice. add e26c2825bf Change of slider position now cause the rendering of corresponding slice of data. It works for `GridView` only at this stage, not yet for `CoverageCanvas`. add 9a63af427f Add a `Envelopes.transformWraparounds(…)` method for getting the individual envelopes before their union is computed. This method is useful only if the transforms chain contains at least one `WraparoundTransform` step. add fbde8a0a60 Avoid wraparound when the result does not intersect the base grid geometry. The fix use `GridExtent.toEnvelopes(…)` (note the pluarl form) is applied in only once place for now, but we should check if it applies to more places. add c0494204bc Method renaming, documentation update, more specific exception. add 98dd50f7ab Revert commit 58cd2d406c5703fc029b0ad402bdbec30401e662 (removal of `sliceExtentProperty`) but without public access for now. We need this property for taking in account the slice selected by the slider. add c112a871b4 Initial version of a `CoverangeCanvas` capable to navigate in dimensions over 2 (using sliders). It required a change in the ways controls are managed, e.g. with `StatusBar` now managed by `ViewAndControls`. add f25739200b Various bug fixes related to the navigation in two-dimensional slices: - Random `MismatchedDimensionException` in the status bar. - Slice not updated when navigating using keyboard. - Map projection and zoom level lost when changing slice. - `CoverageExplorer` resource and coverage properties set to null. add fc5d74d945 When the position given to `GridEvaluator.apply(…)` does not have enough dimensions, default to the grid coordinates specified by `setDefaultSlice(…)` method call. add 4d0e134cc8 Improvement in the cache of `RenderedImage` instances: - Revisit the `equals(Object)` and `hashCode()` methods. - Reuse existing `RenderedImage` instances for a given `SliceExtent`. add 6224e87dca Redesign the
[sis] 01/01: Merge branch 'geoapi-4.0' into geoapi-3.1
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-3.1 in repository https://gitbox.apache.org/repos/asf/sis.git commit b2d141b5e948e7cd0f65e3720ca2e5b1f143d88a Merge: 1eaa4fa82c db22d5470c Author: Martin Desruisseaux AuthorDate: Thu Jun 30 11:22:59 2022 +0200 Merge branch 'geoapi-4.0' into geoapi-3.1 application/sis-console/src/main/artifact/README | 6 +- .../org/apache/sis/console/TransformCommand.java | 4 +- application/sis-javafx/pom.xml | 5 + application/sis-javafx/src/main/artifact/README| 4 +- .../main/java/org/apache/sis/gui/DataViewer.java | 13 +- .../apache/sis/gui/coverage/CoverageCanvas.java| 286 --- .../apache/sis/gui/coverage/CoverageControls.java | 107 +-- .../apache/sis/gui/coverage/CoverageExplorer.java | 128 ++- .../apache/sis/gui/coverage/CoverageStyling.java | 12 +- .../org/apache/sis/gui/coverage/GridControls.java | 45 +- .../apache/sis/gui/coverage/GridSliceSelector.java | 638 +++ .../java/org/apache/sis/gui/coverage/GridView.java | 95 ++- .../org/apache/sis/gui/coverage/GridViewSkin.java | 19 +- .../org/apache/sis/gui/coverage/ImageRequest.java | 181 ++--- .../gui/coverage/MultiResolutionImageLoader.java | 74 +- .../apache/sis/gui/coverage/ViewAndControls.java | 188 +++-- .../org/apache/sis/gui/coverage/package-info.java | 2 +- .../org/apache/sis/gui/dataset/DataWindow.java | 116 --- .../org/apache/sis/gui/dataset/FeatureTable.java | 6 +- .../java/org/apache/sis/gui/dataset/LoadEvent.java | 47 -- .../java/org/apache/sis/gui/dataset/LogViewer.java | 2 +- .../org/apache/sis/gui/dataset/ResourceEvent.java | 2 +- .../apache/sis/gui/dataset/ResourceExplorer.java | 170 ++-- .../org/apache/sis/gui/dataset/ResourceTree.java | 113 +-- .../org/apache/sis/gui/dataset/SelectedData.java | 91 --- .../org/apache/sis/gui/dataset/WindowHandler.java | 474 +++ .../org/apache/sis/gui/dataset/WindowManager.java | 246 ++ .../org/apache/sis/gui/dataset/package-info.java | 2 +- .../org/apache/sis/gui/map/GestureFollower.java| 293 +++ .../java/org/apache/sis/gui/map/MapCanvas.java | 339 +++- .../java/org/apache/sis/gui/map/MapCanvasAWT.java | 16 +- .../main/java/org/apache/sis/gui/map/MapMenu.java | 4 +- .../org/apache/sis/gui/map/OperationFinder.java| 8 +- .../java/org/apache/sis/gui/map/StatusBar.java | 863 - .../org/apache/sis/gui/map/ValuesUnderCursor.java | 74 +- .../java/org/apache/sis/gui/map/package-info.java | 2 +- .../org/apache/sis/gui/metadata/MetadataTree.java | 4 +- .../main/java/org/apache/sis/gui/package-info.java | 2 +- .../apache/sis/gui/referencing/AuthorityCodes.java | 4 +- .../org/apache/sis/gui/referencing/MenuSync.java | 291 +-- .../sis/gui/referencing/ObjectStringConverter.java | 14 +- .../gui/referencing/PositionableProjection.java| 4 +- .../gui/referencing/RecentReferenceSystems.java| 391 +++--- .../java/org/apache/sis/gui/referencing/Utils.java | 4 +- .../apache/sis/internal/gui/BackgroundThreads.java | 28 +- .../apache/sis/internal/gui/DataStoreOpener.java | 106 ++- .../apache/sis/internal/gui/ExceptionReporter.java | 62 +- .../org/apache/sis/internal/gui/GUIUtilities.java | 54 +- .../apache/sis/internal/gui/ImageConverter.java| 4 +- .../sis/internal/gui/OptionalDataDownloader.java | 2 +- .../org/apache/sis/internal/gui/PrivateAccess.java | 54 ++ .../org/apache/sis/internal/gui/Resources.java | 15 + .../apache/sis/internal/gui/Resources.properties | 3 + .../sis/internal/gui/Resources_fr.properties | 3 + .../java/org/apache/sis/internal/gui/Styles.java | 13 +- .../org/apache/sis/internal/gui/ToolbarButton.java | 8 +- .../internal/gui/control/ColorColumnHandler.java | 5 +- .../sis/internal/gui/control/SyncWindowList.java | 252 ++ .../sis/internal/gui/control/TabularWidget.java| 99 +++ .../sis/internal/gui/control/ValueColorMapper.java | 26 +- .../sis/internal/gui/control/package-info.java | 2 +- .../org/apache/sis/internal/gui/package-info.java | 2 +- .../apache/sis/gui/coverage/CoverageCanvasApp.java | 4 +- .../sis/gui/coverage/GridSliceSelectorApp.java | 80 ++ .../java/org/apache/sis/openoffice/CalcAddins.java | 3 +- .../org/apache/sis/internal/book/Assembler.java| 111 +-- .../book/{Resources.java => Characters.java} | 37 +- .../apache/sis/internal/book/CodeColorizer.java| 37 +- .../org/apache/sis/internal/book/Resources_en.java | 33 - .../org/apache/sis/internal/book/Resources_fr.java | 47 -- .../org/apache/sis/internal/book/package-info.java | 8 +- .../org/apache/sis/internal/doclet/Rewriter.java | 3 +- .../sis/coverage/grid/BufferedGridCoverage.java| 82 +- .../sis/coverage/grid/ConvertedGridCoverage.java | 66 +-
[sis] 01/03: Adjust the way that buffer capacity is computed.
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git commit e04f9239ba9ad08d570005aba453bdd8e190b1b6 Author: Martin Desruisseaux AuthorDate: Thu Jun 30 10:12:26 2022 +0200 Adjust the way that buffer capacity is computed. --- .../sis/internal/storage/inflater/CompressionChannel.java| 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java b/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java index f80239ab1c..ab41f72001 100644 --- a/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java +++ b/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java @@ -41,7 +41,7 @@ abstract class CompressionChannel extends PixelChannel { * Desired size of the buffer where to temporarily copy decompressed data. * The actual buffer size may be larger, but should not be smaller. */ -private static final int BUFFER_SIZE = 8192; +private static final int BUFFER_SIZE = 4096; /** * The source of data to decompress. @@ -99,14 +99,16 @@ abstract class CompressionChannel extends PixelChannel { * @throws IOException if an error occurred while filling the buffer with initial data. * @return the data input for uncompressed data. */ -final ChannelDataInput createDataInput(final PixelChannel channel, int scanlineStride) throws IOException { +final ChannelDataInput createDataInput(final PixelChannel channel, final int scanlineStride) throws IOException { +final int capacity; if (scanlineStride > BUFFER_SIZE) { final int[] divisors = MathFunctions.divisors(scanlineStride); int i = Arrays.binarySearch(divisors, BUFFER_SIZE); -if (i < 0) i = ~i; // Really tild, not minus. -scanlineStride = divisors[i]; +if (i < 0) i = ~i; // Really tild, not minus. +capacity = divisors[i]; // Smallest divisor ≥ BUFFER_SIZE +} else { +capacity = Numerics.ceilDiv(BUFFER_SIZE, scanlineStride) * scanlineStride; // ≥ BUFFER_SIZE } -final int capacity = Numerics.ceilDiv(BUFFER_SIZE, scanlineStride) * scanlineStride; // TODO: remove cast with JDK9. final ByteBuffer buffer = (ByteBuffer) ByteBuffer.allocate(capacity).order(input.buffer.order()).limit(0); return new ChannelDataInput(input.filename, channel, buffer, true);
[sis] 02/03: Documentation fixes.
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git commit dba3047b30caf3476de8b3ac14dab190de736fd4 Author: Martin Desruisseaux AuthorDate: Thu Jun 30 10:12:55 2022 +0200 Documentation fixes. --- .../java/org/apache/sis/coverage/grid/CoordinateOperationFinder.java| 2 +- .../src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java | 2 +- .../java/org/apache/sis/internal/coverage/j2d/ColorModelFactory.java| 2 +- .../test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java | 2 +- .../src/main/java/org/apache/sis/internal/util/AbstractIterator.java| 2 +- .../src/main/java/org/apache/sis/internal/util/DefinitionURI.java | 2 +- .../main/java/org/apache/sis/storage/geotiff/GridGeometryBuilder.java | 2 +- .../src/main/java/org/apache/sis/internal/netcdf/FeatureSet.java| 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/CoordinateOperationFinder.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/CoordinateOperationFinder.java index 2b2fefbc6d..c33a71d0f6 100644 --- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/CoordinateOperationFinder.java +++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/CoordinateOperationFinder.java @@ -717,7 +717,7 @@ apply: if (forwardChangeOfCRS == null) { /** * Configures the accuracy hints on the given processor. * - * Pre-requite + * Prerequisite * This method assumes that {@link #gridToCRS()} or {@link #inverse()} * has already been invoked before this method. */ diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java index 1e437360e5..9b4c695615 100644 --- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java +++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java @@ -141,7 +141,7 @@ public class GridCoverageBuilder { /** * The data buffer containing the coverage values. - * Exactly one of {@link #image}, {@link #raster} and {@code #buffer} shall be non-null. + * Exactly one of {@link #image}, {@link #raster} and {@code buffer} shall be non-null. * * @see #setValues(DataBuffer, Dimension) */ diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ColorModelFactory.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ColorModelFactory.java index 9e67346848..c5ff8d778a 100644 --- a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ColorModelFactory.java +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ColorModelFactory.java @@ -210,7 +210,7 @@ public final class ColorModelFactory { } /** - * Constructs the color model from the {@code #codes} and {@link #ARGB} data. + * Constructs the color model from the {@code codes} and {@link #ARGB} data. * This method is invoked the first time the color model is created, or when * the value in the cache has been discarded. */ diff --git a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java index 39b5f120e1..021c59d249 100644 --- a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java +++ b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java @@ -628,7 +628,7 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase { /** * Tests the annotations in the {@code package-info} files of Apache SIS implementations of the - * interfaces enumerated in the {@code #types} array. More specifically this method tests that: + * interfaces enumerated in the {@link #types} array. More specifically this method tests that: * * * The prefixes declared in the {@link XmlNs} annotations match the diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java b/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java index 06abb78e5e..89a4d98054 100644 --- a/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java +++ b/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java @@ -23,7 +23,7 @@ import java.util.NoSuchElementException; /** * Base class for iterators that prepare the next element in advance. * The {@link #next} field is initially {@code null} and is reset to {@code null} after each call to {@link #next()}. - * The {@link #hasNext()} method shall
[sis] branch geoapi-4.0 updated (748a5a1fff -> db22d5470c)
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a change to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git from 748a5a1fff Adjust the size of the temporary buffer for TIFF decompression. new e04f9239ba Adjust the way that buffer capacity is computed. new dba3047b30 Documentation fixes. new db22d5470c Adjust the precision of coordinate numbers shown when automatically scalling from meters to kilometers. The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../coverage/grid/CoordinateOperationFinder.java | 2 +- .../sis/coverage/grid/GridCoverageBuilder.java | 2 +- .../internal/coverage/j2d/ColorModelFactory.java | 2 +- .../sis/test/xml/AnnotationConsistencyCheck.java | 2 +- .../org/apache/sis/geometry/CoordinateFormat.java | 23 -- .../apache/sis/geometry/CoordinateFormatTest.java | 11 +-- .../apache/sis/internal/util/AbstractIterator.java | 2 +- .../apache/sis/internal/util/DefinitionURI.java| 2 +- .../storage/inflater/CompressionChannel.java | 12 ++- .../sis/storage/geotiff/GridGeometryBuilder.java | 2 +- .../org/apache/sis/internal/netcdf/FeatureSet.java | 2 +- 11 files changed, 41 insertions(+), 21 deletions(-)
[sis] 03/03: Adjust the precision of coordinate numbers shown when automatically scalling from meters to kilometers.
This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git commit db22d5470c243dfab438f440e8ad08f8cee2db59 Author: Martin Desruisseaux AuthorDate: Thu Jun 30 11:00:29 2022 +0200 Adjust the precision of coordinate numbers shown when automatically scalling from meters to kilometers. --- .../org/apache/sis/geometry/CoordinateFormat.java | 23 -- .../apache/sis/geometry/CoordinateFormatTest.java | 11 +-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java b/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java index bd629e9ff3..194ae0ec89 100644 --- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java +++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/CoordinateFormat.java @@ -25,6 +25,7 @@ import java.text.FieldPosition; import java.text.ParsePosition; import java.text.ParseException; import java.util.Optional; +import java.util.Set; import java.util.Arrays; import java.util.Date; import java.util.Locale; @@ -51,6 +52,7 @@ import org.apache.sis.internal.referencing.ReferencingUtilities; import org.apache.sis.internal.system.Loggers; import org.apache.sis.internal.util.LocalizedParseException; import org.apache.sis.internal.util.Numerics; +import org.apache.sis.internal.jdk9.JDK9; import org.apache.sis.math.DecimalFunctions; import org.apache.sis.util.logging.Logging; import org.apache.sis.util.resources.Errors; @@ -128,6 +130,13 @@ public class CoordinateFormat extends CompoundFormat { */ private static final int DEFAULT_DIMENSION = 4; +/** + * Units of measurement which are allowed to be automatically scaled to a larger unit. + * For example if the unit of measurement of an axis is meter but the precision is 1000 metres, + * then {@code CoordinateFormat} will automatically uses kilometres units instead of metres. + */ +private static final Set> SCALABLES = JDK9.setOf(Units.METRE, Units.PASCAL); + /** * The separator between each coordinate values to be formatted. * The default value is a EM space space (U+2003). @@ -819,10 +828,7 @@ public class CoordinateFormat extends CompoundFormat { * fractions of 1 (by contrast, CompactNumberFormat may apply fraction to larger values). */ if (format instanceof DecimalFormat && (types == null || types[dim] != INDEX)) { -final int c = Math.max(DecimalFunctions.fractionDigitsForDelta(precision, false), 0); -final DecimalFormat nf = (DecimalFormat) getFormatClone(dim); -nf.setMinimumFractionDigits(c); -nf.setMaximumFractionDigits(c); +int digits = DecimalFunctions.fractionDigitsForDelta(precision, false); if (unitSymbols != null) { /* * The `units` array can not be null if `unitSymbols` is non-null since unit symbols @@ -830,8 +836,9 @@ public class CoordinateFormat extends CompoundFormat { * but more general scaling may be added in a future version. */ final Unit unit = units[dim]; -if (Units.METRE.equals(unit) || Units.PASCAL.equals(unit)) { -if (precision >= 1000) { +if (SCALABLES.contains(unit)) { +if (precision >= 10) { // If precision < 1000, we will use 1 or 2 fraction digits. +digits += 3;// Because `scaleUnit(…)` scales by a factor 1000. scaleUnit(dim, unit); } else if (toFormatUnit != null) { toFormatUnit[dim] = null; @@ -839,6 +846,10 @@ public class CoordinateFormat extends CompoundFormat { } } } +digits = Math.max(digits, 0); +final DecimalFormat nf = (DecimalFormat) getFormatClone(dim); +nf.setMinimumFractionDigits(digits); +nf.setMaximumFractionDigits(digits); } else if (format instanceof AngleFormat) { ((AngleFormat) getFormatClone(dim)).setPrecision(precision, true); } diff --git a/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java b/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java index 79427aa5ae..f7ad6838d5 100644 --- a/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java +++ b/core/sis-referencing/src/test/java/org/apache/sis/geometry/CoordinateFormatTest.java @@ -42,7 +42,7 @@ import static org.junit.Assert.*; *