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 2024/05/20 12:40:14 UTC
(sis) 01/01: Merge branch 'geoapi-3.1'. This commit contains one incompatible change: the `org.opengis.referencing.datum.PixelInCell` code list has been replaced by the `org.apache.sis.coverage.grid.PixelInCell` enumeration, except in `ImageDatum`. This is in preparation for the code list removal from ISO 19111:2019.
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 485bf63bb32bb21f4db964143401eca02ec85489
Merge: 6027cd3d71 5dab0950ea
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon May 20 14:38:04 2024 +0200
Merge branch 'geoapi-3.1'. This commit contains one incompatible change:
the `org.opengis.referencing.datum.PixelInCell` code list has been replaced by the
`org.apache.sis.coverage.grid.PixelInCell` enumeration, except in `ImageDatum`.
This is in preparation for the code list removal from ISO 19111:2019.
.../org/apache/sis/coverage/CoverageCombiner.java | 2 +-
.../org/apache/sis/coverage/RegionOfInterest.java | 2 +-
.../coverage/grid/CoordinateOperationFinder.java | 1 -
.../apache/sis/coverage/grid/DefaultEvaluator.java | 1 -
.../sis/coverage/grid/DimensionalityReduction.java | 11 +-
.../apache/sis/coverage/grid/DomainLinearizer.java | 1 -
.../coverage/grid/FractionalGridCoordinates.java | 1 -
.../apache/sis/coverage/grid/GridCoverage2D.java | 1 -
.../sis/coverage/grid/GridCoverageProcessor.java | 1 -
.../apache/sis/coverage/grid/GridDerivation.java | 1 -
.../org/apache/sis/coverage/grid/GridExtent.java | 3 +-
.../apache/sis/coverage/grid/GridExtentCRS.java | 1 -
.../org/apache/sis/coverage/grid/GridGeometry.java | 11 +-
.../apache/sis/coverage/grid/GridOrientation.java | 1 -
.../org/apache/sis/coverage/grid/PixelInCell.java | 115 +++++++++++++++++++++
.../apache/sis/coverage/grid/PixelTranslation.java | 29 +-----
.../sis/coverage/grid/ResampledGridCoverage.java | 1 -
.../apache/sis/coverage/grid/SliceGeometry.java | 1 -
.../sis/coverage/privy/CommonDomainFinder.java | 2 +-
.../sis/coverage/privy/MultiSourceArgument.java | 2 +-
.../main/org/apache/sis/image/ImageCombiner.java | 2 +-
.../main/org/apache/sis/image/ImageProcessor.java | 2 +-
.../main/org/apache/sis/image/ResampledImage.java | 4 +-
.../grid/BandAggregateGridCoverageTest.java | 1 -
.../coverage/grid/BufferedGridCoverageTest.java | 1 -
.../coverage/grid/ConvertedGridCoverageTest.java | 1 -
.../sis/coverage/grid/DimensionAppenderTest.java | 1 -
.../coverage/grid/DimensionalityReductionTest.java | 1 -
.../sis/coverage/grid/GridCoverage2DTest.java | 1 -
.../sis/coverage/grid/GridCoverageBuilderTest.java | 1 -
.../sis/coverage/grid/GridDerivationTest.java | 1 -
.../apache/sis/coverage/grid/GridGeometryTest.java | 1 -
.../sis/coverage/grid/PixelTranslationTest.java | 1 -
.../coverage/grid/ResampledGridCoverageTest.java | 2 +-
.../coverage/grid/TranslatedGridCoverageTest.java | 1 -
.../test/org/apache/sis/util/iso/TypesTest.java | 5 -
.../coverage/MultiResolutionCoverageLoader.java | 2 +-
.../org/apache/sis/map/coverage/RenderingData.java | 2 +-
.../main/org/apache/sis/portrayal/Canvas.java | 2 +-
.../org/apache/sis/portrayal/CanvasExtent.java | 2 +-
.../MultiResolutionCoverageLoaderTest.java | 2 +-
.../apache/sis/referencing/cs/DefaultAffineCS.java | 3 -
.../sis/referencing/cs/DefaultCartesianCS.java | 3 -
.../sis/referencing/datum/DatumShiftGrid.java | 2 +-
.../referencing/operation/SubOperationInfo.java | 2 +-
.../operation/builder/LinearTransformBuilder.java | 2 +-
.../operation/builder/LocalizationGridBuilder.java | 4 +-
.../sis/referencing/operation/gridded/Tile.java | 13 ++-
.../referencing/operation/provider/Robinson.java | 12 ++-
.../referencing/operation/provider/Sinusoidal.java | 13 ++-
.../apache/sis/referencing/crs/HardCodedCRS.java | 2 +-
.../sis/storage/geotiff/MultiResolutionImage.java | 2 +-
.../geotiff/reader/GridGeometryBuilder.java | 2 +-
.../sis/storage/geotiff/writer/GeoEncoder.java | 2 +-
.../org/apache/sis/storage/netcdf/base/Grid.java | 2 +-
.../sis/storage/netcdf/base/GridAdjustment.java | 2 +-
.../sis/storage/netcdf/base/GridMapping.java | 2 +-
.../sis/storage/sql/postgis/RasterFormat.java | 2 +-
.../sis/storage/aggregate/CoverageAggregator.java | 2 +-
.../sis/storage/aggregate/DimensionAppender.java | 2 +-
.../apache/sis/storage/aggregate/GridSlice.java | 2 +-
.../sis/storage/base/MemoryGridResource.java | 2 +-
.../apache/sis/storage/base/TiledGridCoverage.java | 2 +-
.../apache/sis/storage/esri/AsciiGridStore.java | 2 +-
.../apache/sis/storage/esri/RawRasterStore.java | 2 +-
.../org/apache/sis/storage/esri/WritableStore.java | 2 +-
.../apache/sis/storage/image/WorldFileStore.java | 2 +-
.../org/apache/sis/storage/tiling/TileMatrix.java | 2 +-
.../org/apache/sis/storage/CoverageQueryTest.java | 2 +-
.../aggregate/BandAggregateGridResourceTest.java | 2 +-
.../sis/storage/base/MemoryGridResourceTest.java | 2 +-
.../sis/storage/coveragejson/CoverageResource.java | 2 +-
.../apache/sis/gui/coverage/CoverageCanvas.java | 2 +-
.../apache/sis/gui/coverage/GridSliceSelector.java | 2 +-
.../sis/gui/coverage/StyledRenderingData.java | 2 +-
.../main/org/apache/sis/gui/map/MapCanvas.java | 2 +-
.../org/apache/sis/gui/map/OperationFinder.java | 2 +-
.../main/org/apache/sis/gui/map/StatusBar.java | 2 +-
.../gui/referencing/RecentReferenceSystems.java | 2 +-
.../apache/sis/gui/coverage/CoverageCanvasApp.java | 2 +-
80 files changed, 206 insertions(+), 132 deletions(-)
diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/PixelInCell.java
index 0000000000,0e94ee071d..cd33d042c1
mode 000000,100644..100644
--- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/PixelInCell.java
+++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/PixelInCell.java
@@@ -1,0 -1,129 +1,115 @@@
+ /*
+ * 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.coverage.grid;
+
-import org.opengis.util.ControlledVocabulary;
+ import org.opengis.metadata.spatial.PixelOrientation;
+
+
+ /**
+ * Whether a "grid to real world" transform gives the coordinates of the cell corner or cell center.
+ * This enumeration is equivalent to a subset of {@link PixelOrientation},
+ * but applicable to any number of dimensions.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.5
+ *
+ * @see PixelOrientation
+ *
+ * @since 1.5
+ */
-public enum PixelInCell implements ControlledVocabulary {
++public enum PixelInCell {
+ /**
+ * "Real world" coordinates give the location of the cell center.
+ *
+ * @see PixelOrientation#CENTER
+ */
+ CELL_CENTER("cell center", PixelOrientation.CENTER, 0),
+
+ /**
+ * "Real world" coordinates give the location of the cell corner having smallest coordinate values.
+ * For a two-dimensional image having row indices (<var>y</var> coordinates) increasing downward,
+ * this the upper-left corner.
+ *
+ * @see PixelOrientation#UPPER_LEFT
+ */
+ CELL_CORNER("cell corner", PixelOrientation.UPPER_LEFT, -0.5);
+
+ /**
+ * The identifier in legacy ISO 19111 specification.
+ */
+ private final String identifier;
+
+ /**
+ * The two-dimensional pixel orientation which is equivalent to this enumeration value.
+ * This equivalence can be used for converting <var>n</var>-dimensional parameters to
+ * the more specific two-dimensional case.
+ *
+ * <table class="sis">
+ * <caption>Pixel orientation equivalences</caption>
+ * <tr><th>Pixel in cell</th><th>Pixel orientation</th></tr>
+ * <tr><td>{@link #CELL_CENTER}</td><td>{@link PixelOrientation#CENTER}</td></tr>
+ * <tr><td>{@link #CELL_CORNER}</td><td>{@link PixelOrientation#UPPER_LEFT}</td></tr>
+ * </table>
+ *
+ * @see PixelTranslation#getPixelOrientation(PixelInCell)
+ */
+ final PixelOrientation orientation;
+
+ /**
+ * The position relative to the cell center, in fractional number of cells.
+ * This is typically used for <var>n</var>-dimensional grids, where the number of dimension is unknown.
+ * The translation is determined from the following table, with the same value applied to all dimensions:
+ *
+ * <table class="sis">
+ * <caption>Translations</caption>
+ * <tr><th>Pixel in cell</th><th>offset</th></tr>
+ * <tr><td>{@link #CELL_CENTER}</td><td>{@code 0.0}</td></tr>
+ * <tr><td>{@link #CELL_CORNER}</td><td>{@code -0.5}</td></tr>
+ * </table>
+ *
+ * @see PixelTranslation#getPixelTranslation(PixelInCell)
+ */
+ final double translationFromCentre;
+
+ /**
+ * Creates a new enumeration value.
+ */
+ private PixelInCell(final String identifier, final PixelOrientation orientation, final double translationFromCentre) {
+ this.identifier = identifier;
+ this.orientation = orientation;
+ this.translationFromCentre = translationFromCentre;
+ }
+
+ /**
+ * Returns the identifier declared in the legacy ISO 19111 specification.
+ *
+ * @return the legacy ISO/OGC identifier for this constant.
+ */
- @Override
+ public String identifier() {
+ return identifier;
+ }
+
+ /**
+ * Returns all the names of this enumeration value. The returned array contains
+ * the {@linkplain #name() name} and the {@linkplain #identifier() identifier}.
+ *
+ * @return all names of this constant. This array is never null and never empty.
+ */
- @Override
+ public String[] names() {
+ return new String[] {name(), identifier};
+ }
-
- /**
- * Returns the enumeration of the same kind as this item.
- * This is equivalent to {@link #values()}.
- *
- * @return the enumeration of the same kind as this item.
- */
- @Override
- public ControlledVocabulary[] family() {
- return values();
- }
+ }
diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/util/iso/TypesTest.java
index 4cb5582b2e,056bf5d03e..baa5a79d47
--- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/util/iso/TypesTest.java
+++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/util/iso/TypesTest.java
@@@ -140,15 -153,8 +140,10 @@@ public final class TypesTest extends Te
assertSame(ImagingCondition.SEMI_DARKNESS, Types.forCodeName(ImagingCondition.class, "semi-darkness", null));
assertNull(Types.forCodeName(ImagingCondition.class, "darkness", null));
- assertSame(Restriction.LICENCE, Types.forCodeName(Restriction.class, "licence", null));
- assertSame(Restriction.LICENCE, Types.forCodeName(Restriction.class, "license", null));
+ assertSame(PixelInCell.CELL_CORNER, Types.forCodeName(PixelInCell.class, "cell corner", null));
+ assertSame(PixelInCell.CELL_CORNER, Types.forCodeName(PixelInCell.class, "cellCorner", null));
+ assertSame(PixelInCell.CELL_CENTER, Types.forCodeName(PixelInCell.class, "cell center", null));
+ assertSame(PixelInCell.CELL_CENTER, Types.forCodeName(PixelInCell.class, "cellCenter", null));
-
- if (PENDING_NEXT_GEOAPI_RELEASE) {
- assertSame(PixelInCell.CELL_CENTER, Types.forCodeName(PixelInCell.class, "cell centre", null));
- assertSame(PixelInCell.CELL_CENTER, Types.forCodeName(PixelInCell.class, "cellCentre", null));
- }
}
/**