This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/sis.git
commit a60d84a9a39d7e4c6fd583e88a7e2afb77ad9c42 Merge: 6942b67282 cae1934156 Author: Martin Desruisseaux <[email protected]> AuthorDate: Sat Nov 7 16:24:33 2026 +0100 Merge branch 'geoapi-3.1' endorsed/build.gradle.kts | 10 +- .../sis/coverage/grid/DimensionalityReduction.java | 6 +- .../apache/sis/coverage/grid/GridDerivation.java | 4 +- .../org/apache/sis/coverage/grid/GridExtent.java | 187 ++++--------- .../org/apache/sis/coverage/grid/GridGeometry.java | 144 ++++++++-- .../sis/coverage/grid/GridPointIterator.java | 301 +++++++++++++++++++++ .../apache/sis/coverage/grid/LatticeIterator.java | 209 ++++++++++++++ .../main/org/apache/sis/image/ImageProcessor.java | 8 +- .../main/org/apache/sis/image/MaskedImage.java | 4 +- .../apache/sis/coverage/grid/GridGeometryTest.java | 78 ++++++ .../org/apache/sis/image/PixelIteratorTest.java | 8 +- .../metadata/iso/identification/DefaultUsage.java | 4 +- .../metadata/iso/identification/package-info.java | 2 +- .../main/org/apache/sis/style/se1/ColorMap.java | 48 +++- .../org/apache/sis/style/se1/ColorReplacement.java | 43 ++- .../org/apache/sis/style/se1/ColorMapTest.java | 63 +++++ .../sis/style/se1/ColorReplacementTest.java} | 37 ++- .../org/apache/sis/geometry/AbstractEnvelope.java | 14 +- .../main/org/apache/sis/geometry/Envelopes.java | 2 +- .../org/apache/sis/geometry/GeneralEnvelope.java | 20 +- .../apache/sis/geometry/WraparoundAdjustment.java | 2 +- .../referencing/factory/IdentifiedObjectSet.java | 20 +- .../sis/referencing/factory/package-info.java | 2 +- .../referencing/factory/sql/EPSGDataAccess.java | 2 + .../referencing/internal/ServicesForMetadata.java | 6 +- .../internal/shared/CoordinateOperations.java | 8 + .../internal/shared/DirectPositionView.java | 10 +- .../internal/shared/TemporalAccessor.java | 15 +- .../operation/CoordinateOperationFinder.java | 2 +- .../operation/CoordinateOperationRegistry.java | 93 +++++-- .../operation/builder/ProjectedTransformTry.java | 11 +- .../operation/transform/AbstractMathTransform.java | 9 +- .../operation/transform/ConcatenatedTransform.java | 1 + .../operation/CoordinateOperationFinderTest.java | 22 +- .../operation/CoordinateOperationRegistryTest.java | 59 ++++ .../transform/AbstractMathTransformTest.java | 3 +- .../operation/transform/MathTransformTestCase.java | 3 +- .../apache/sis/storage/tiling/TileReadEvent.java | 6 +- .../main/org/apache/sis/setup/Configuration.java | 12 +- .../main/org/apache/sis/system/DaemonThread.java | 7 +- .../main/org/apache/sis/system/Shutdown.java | 31 ++- .../src/org.apache.sis.web/main/module-info.java | 25 +- .../org/apache/sis/web/jakarta/JavaBeanHook.java | 60 ++++ .../org/apache/sis/web/jakarta/package-info.java | 5 +- .../org/apache/sis/web/javaee/JavaBeanHook.java | 60 ++++ .../org/apache/sis/web/javaee/package-info.java | 5 +- incubator/build.gradle.kts | 3 + netbeans-project/ivy.xml | 4 + .../main/org/apache/sis/gui/map/MapCanvasAWT.java | 4 +- 49 files changed, 1369 insertions(+), 313 deletions(-) diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java index 82cdf16cc3,6d86170cee..949022548c --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java @@@ -102,10 -99,10 +101,10 @@@ import org.apache.sis.coverage.PointOut * @author Martin Desruisseaux (IRD, Geomatys) * @author Alexis Manin (Geomatys) * @author Johann Sorel (Geomatys) - * @version 1.7 + * @version 1.8 * @since SIS 1.0 */ -public class GridExtent implements GridEnvelope, LenientComparable, Serializable { +public class GridExtent implements Serializable, LenientComparable { /** * Serial number for inter-operability with different versions. */ diff --cc endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/ColorMap.java index 688e34e843,d910f0541f..65e6f56d1f --- a/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/ColorMap.java +++ b/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/ColorMap.java @@@ -19,6 -20,9 +20,9 @@@ import java.util.Optional import jakarta.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.XmlRootElement; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Expression; ++// Specific to the main branch: ++import org.apache.sis.filter.Expression; + /** * Mapping of fixed-numeric pixel values to colors. diff --cc endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/ColorReplacement.java index 2067434a57,f0806a2457..714a97d2f4 --- a/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/ColorReplacement.java +++ b/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/ColorReplacement.java @@@ -19,13 -20,17 +20,17 @@@ import java.util.Optional import jakarta.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.XmlRootElement; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Expression; ++// Specific to the main branch: ++import org.apache.sis.filter.Expression; + /** - * Replacement of a color in an external graphic. + * Replacement of colors in an external graphic. + * The replacement is defined by a function, which is usually a {@link org.apache.sis.style.se1.function.Recode} + * function using the color of each pixel of the external graphic as its lookup value, and mapping some colors + * to replacement colors. Colors without replacement are left unchanged. Renderers may not support other kinds + * of expressions. * - * <p>This is a placeholder for future development. - * OGC 05-077r4 standard defines the dependent classes, - * but there is too many of them for this initial draft.</p> * * @author Johann Sorel (Geomatys) * @author Martin Desruisseaux (Geomatys) diff --cc endorsed/src/org.apache.sis.portrayal/test/org/apache/sis/style/se1/ColorMapTest.java index 0000000000,8084985996..e2ecc1199f mode 000000,100644..100644 --- a/endorsed/src/org.apache.sis.portrayal/test/org/apache/sis/style/se1/ColorMapTest.java +++ b/endorsed/src/org.apache.sis.portrayal/test/org/apache/sis/style/se1/ColorMapTest.java @@@ -1,0 -1,75 +1,63 @@@ + /* + * 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.style.se1; + + import java.awt.Color; -import java.util.List; -import org.apache.sis.style.se1.function.Categorize; -import org.apache.sis.style.se1.function.Interpolate; + + // Test dependencies + import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; + + + /** + * Tests for {@link ColorMap}. + * + * @author Johann Sorel (Geomatys) + */ + public final class ColorMapTest extends StyleTestCase { + /** + * Creates a new test case. + */ + public ColorMapTest() { + } + + /** + * Test of {@code Function} property. + */ + @Test + public void testFunction() { + final var cdt = factory.createColorMap(); + + // Check default + assertEmpty(cdt.getFunction()); + - // Check get/set - final var function = new Categorize<>(null, List.of(literal(Color.RED)), List.of(), null, null); - cdt.setFunction(function); - assertSame(function, cdt.getFunction().orElseThrow()); - + // Any expression is accepted. + cdt.setFunction(literal(Color.BLUE)); + assertLiteralEquals(Color.BLUE, cdt.getFunction().orElseThrow()); + + cdt.setFunction(null); + assertEmpty(cdt.getFunction()); + } + + /** + * Tests that clones share the function, which is immutable. + */ + @Test + public void testClone() { + final var cdt = factory.createColorMap(); - cdt.setFunction(new Interpolate<>(null, List.of(), null, null, null)); - final var clone = cdt.clone(); - assertEquals(cdt, clone); - assertSame(cdt.getFunction().orElseThrow(), clone.getFunction().orElseThrow()); ++ // TODO: actuel test in other SIS branches. + } + } diff --cc endorsed/src/org.apache.sis.portrayal/test/org/apache/sis/style/se1/ColorReplacementTest.java index 739613c974,bbf91d1657..8b5aee4d9d --- a/endorsed/src/org.apache.sis.portrayal/test/org/apache/sis/style/se1/ColorReplacementTest.java +++ b/endorsed/src/org.apache.sis.portrayal/test/org/apache/sis/style/se1/ColorReplacementTest.java @@@ -14,13 -14,49 +14,40 @@@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.sis.style.se1; + -import java.awt.Color; -import java.util.List; -import org.apache.sis.style.se1.function.Recode.MapItem; -import org.apache.sis.style.se1.function.Recode; + + // Test dependencies + import org.junit.jupiter.api.Test; + import static org.junit.jupiter.api.Assertions.*; /** - * All classes having a dependencies to JavaEE ({@code javax.servlet} packages). - * JavaEE is replaced by Jakarta ({@code jakarta.servlet} packages), but not all applications have migrated. - * This package is provided for web applications that are still using JavaEE. + * Tests for {@link ColorReplacement}. * - * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) */ - package org.apache.sis.web.javaee; + public final class ColorReplacementTest extends StyleTestCase { + /** + * Creates a new test case. + */ + public ColorReplacementTest() { + } + + /** + * Test of {@code Function} property. + */ + @Test + public void testFunction() { + final var cdt = factory.createColorReplacement(); + + // Check default + assertEmpty(cdt.getFunction()); + - // Check get/set - final var function = new Recode<>(null, List.of(new MapItem<>(literal(Color.RED), literal(Color.BLUE))), null); - cdt.setFunction(function); - assertSame(function, cdt.getFunction().orElseThrow()); - + // Equality and copy. + assertEquals(cdt, new ColorReplacement<>(cdt)); + assertEquals(cdt, cdt.clone()); + cdt.setFunction(null); + assertEmpty(cdt.getFunction()); + } + } diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java index c620476859,a4d30e2157..71a67a7386 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java @@@ -47,9 -47,10 +47,10 @@@ import org.apache.sis.util.ComparisonMo import org.apache.sis.util.LenientComparable; import org.apache.sis.util.OptionalCandidate; import org.apache.sis.util.resources.Errors; + import static org.apache.sis.referencing.internal.shared.CoordinateOperations.MAXIMUM_BUFFER_SIZE; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.coordinate.MismatchedDimensionException; +// Specific to the main branch: +import org.opengis.geometry.MismatchedDimensionException; /** diff --cc endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java index cc8d080c1f,17fe6ab0c0..be45ad51eb --- a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java +++ b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java @@@ -48,10 -48,11 +48,11 @@@ import org.junit.jupiter.api.extension. import org.apache.sis.test.LoggingWatcher; import org.apache.sis.referencing.operation.transform.MathTransformTestCase; import static org.apache.sis.referencing.Assertions.assertEpsgNameAndIdentifierEqual; + import org.apache.sis.referencing.operation.transform.MathTransforms; import static org.apache.sis.test.TestCase.assumeConnectionToEPSG; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.metadata.Identifier; +// Specific to the main branch: +import org.opengis.referencing.ReferenceIdentifier; /**
