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
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new 5ee494c8e8 Remove last links to GeoAPI-pending `org.opengis.style`
package. Add a `Style` interface as a placeholder for future style API (to be
determined according the result of OGC/ISO works).
5ee494c8e8 is described below
commit 5ee494c8e84350014aa49be02f3cd98848a141eb
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Sat Jul 1 14:16:06 2023 +0200
Remove last links to GeoAPI-pending `org.opengis.style` package.
Add a `Style` interface as a placeholder for future style API
(to be determined according the result of OGC/ISO works).
---
.../org/apache/sis/internal/map/SEPortrayer.java | 6 +-
.../apache/sis/internal/map/SymbologyVisitor.java | 7 +++
.../java/org/apache/sis/portrayal/MapLayer.java | 2 +-
.../src/main/java/org/apache/sis/style/Style.java | 29 ++++++++++
.../java/org/apache/sis/style/package-info.java | 41 +++++++++++++
.../org/apache/sis/style/se1/AbstractStyle.java | 7 +--
.../apache/sis/style/se1/ContrastEnhancement.java | 1 -
.../org/apache/sis/style/se1/ContrastMethod.java | 54 +++++++++++++++++
.../org/apache/sis/style/se1/OverlapBehavior.java | 52 +++++++++++++++++
.../org/apache/sis/style/se1/RasterSymbolizer.java | 1 -
.../org/apache/sis/style/se1/SemanticType.java | 67 ++++++++++++++++++++++
.../sis/style/se1/{Style.java => Symbology.java} | 13 +++--
.../org/apache/sis/style/se1/package-info.java | 11 ++--
.../apache/sis/internal/map/SEPortrayerTest.java | 30 +++++-----
.../sis/style/se1/ContrastEnhancementTest.java | 3 -
.../apache/sis/style/se1/FeatureTypeStyleTest.java | 3 -
.../apache/sis/style/se1/RasterSymbolizerTest.java | 3 -
.../se1/{StyleTest.java => SymbologyTest.java} | 16 +++---
18 files changed, 292 insertions(+), 54 deletions(-)
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SEPortrayer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SEPortrayer.java
index 5814406f92..d7af50d65c 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SEPortrayer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SEPortrayer.java
@@ -60,6 +60,8 @@ import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.style.se1.FeatureTypeStyle;
import org.apache.sis.style.se1.Rule;
import org.apache.sis.style.se1.Symbolizer;
+import org.apache.sis.style.se1.SemanticType;
+import org.apache.sis.style.se1.Symbology;
// Branch-dependent imports
import org.opengis.feature.AttributeType;
@@ -71,7 +73,6 @@ import org.opengis.feature.PropertyType;
import org.opengis.filter.Filter;
import org.opengis.filter.FilterFactory;
import org.opengis.filter.Expression;
-import org.opengis.style.SemanticType;
// Optional-dependencies (TODO: make library-independent)
import org.locationtech.jts.geom.Geometry;
@@ -244,7 +245,8 @@ public final class SEPortrayer {
return stream;
}
final double seScale = getSEScale(canvas, objToDisp);
- for (FeatureTypeStyle fts : layer.getStyle().featureTypeStyles()) {
+ final Symbology style = (Symbology) layer.getStyle(); // TODO: we
do not yet support other implementations.
+ for (FeatureTypeStyle fts : style.featureTypeStyles()) {
final List<Rule<Feature>> rules = getValidRules(fts, seScale,
type);
if (rules.isEmpty()) continue;
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SymbologyVisitor.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SymbologyVisitor.java
index 723526fc1b..a633f4332f 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SymbologyVisitor.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/SymbologyVisitor.java
@@ -22,6 +22,7 @@ import org.opengis.filter.Expression;
import org.opengis.filter.Literal;
import org.opengis.filter.ValueReference;
import org.apache.sis.style.se1.*;
+import org.apache.sis.style.Style;
import static org.apache.sis.internal.util.CollectionsExt.nonNull;
@@ -43,6 +44,12 @@ public abstract class SymbologyVisitor {
}
protected void visit(final Style candidate) {
+ if (candidate instanceof Symbology) {
+ visit((Symbology) candidate);
+ }
+ }
+
+ protected void visit(final Symbology candidate) {
if (candidate != null) {
nonNull(candidate.featureTypeStyles()).forEach(this::visit);
}
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/MapLayer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/MapLayer.java
index 7c93058e94..c886c9a231 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/MapLayer.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/MapLayer.java
@@ -24,7 +24,7 @@ import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.Query;
import org.apache.sis.storage.Resource;
import org.apache.sis.util.ArgumentChecks;
-import org.apache.sis.style.se1.Style;
+import org.apache.sis.style.Style;
import org.opengis.coverage.Coverage;
import org.opengis.feature.Feature;
import org.opengis.geometry.Envelope;
diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/style/Style.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/Style.java
new file mode 100644
index 0000000000..811741134a
--- /dev/null
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/style/Style.java
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+
+/**
+ * Place-holder for future definition of a style API.
+ * See package description for more information.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.5
+ * @since 1.5
+ */
+public interface Style {
+}
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/package-info.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/package-info.java
new file mode 100644
index 0000000000..ed8db5cafc
--- /dev/null
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/style/package-info.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+
+/**
+ * Symbology for styling map data independently of their source.
+ * This is a placeholder for future evolution.
+ * The following works in progress can be sources for the definition of a
future style API:
+ *
+ * <ul>
+ * <li>ISO 19117:2012 — Portrayal (under review as of June 2023)</li>
+ * <li>OGC Styles and Symbology Encoding standard working group</li>
+ * <li>OGC 3D Portrayal standard working group</li>
+ * <li>OGC Portrayal discussion working group</li>
+ * <li>OGC API — Styles standard working group</li>
+ * </ul>
+ *
+ * As of June 2023 we have not yet determined how to consolidate above works
in a Java API.
+ * The {@link org.apache.sis.style.se1} package, which is derived from SE 1.1
standard,
+ * is used an an interim API.
+ *
+ * @author Johann Sorel (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.5
+ * @since 1.5
+ */
+package org.apache.sis.style;
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/AbstractStyle.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/AbstractStyle.java
index 78fc11bda8..0bcc54eada 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/AbstractStyle.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/AbstractStyle.java
@@ -19,17 +19,16 @@ package org.apache.sis.style.se1;
import java.util.Set;
import java.util.List;
import java.util.ArrayList;
+import java.util.EnumSet;
import java.util.Optional;
import jakarta.xml.bind.Unmarshaller;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlAttribute;
import org.opengis.util.GenericName;
-import org.apache.sis.util.collection.CodeListSet;
// Branch-dependent imports
import org.opengis.filter.ResourceId;
-import org.opengis.style.SemanticType;
/**
@@ -114,7 +113,7 @@ public abstract class AbstractStyle<R> extends
StyleElement<R> {
* @see #semanticTypeIdentifiers()
*/
// @XmlElement(name = "SemanticTypeIdentifier")
- private CodeListSet<SemanticType> semanticTypeIdentifiers;
+ private EnumSet<SemanticType> semanticTypeIdentifiers;
/**
* List of rules.
@@ -156,7 +155,7 @@ public abstract class AbstractStyle<R> extends
StyleElement<R> {
public AbstractStyle(final StyleFactory<R> factory) {
super(factory);
version = VERSION;
- semanticTypeIdentifiers = new CodeListSet<>(SemanticType.class);
+ semanticTypeIdentifiers = EnumSet.noneOf(SemanticType.class);
rules = new ArrayList<>();
}
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastEnhancement.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastEnhancement.java
index 36c5f5d76e..2069d30b05 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastEnhancement.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastEnhancement.java
@@ -22,7 +22,6 @@ import jakarta.xml.bind.annotation.XmlRootElement;
// Branch-dependent imports
import org.opengis.filter.Expression;
-import org.opengis.style.ContrastMethod;
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastMethod.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastMethod.java
new file mode 100644
index 0000000000..56c625f748
--- /dev/null
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/ContrastMethod.java
@@ -0,0 +1,54 @@
+/*
+ * 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;
+
+
+/**
+ * Contrast enhancement for an image channel.
+ * In the case of a color image, the relative grayscale brightness of a pixel
color is used.
+ *
+ * @author Johann Sorel (Geomatys)
+ * @version 1.5
+ * @since 1.5
+ */
+public enum ContrastMethod {
+ /**
+ * Dimmest color is stretched to black and the brightest color is
stretched to white.
+ * All colors in between are stretched out linearly.
+ */
+ NORMALIZE,
+
+ /**
+ * Contrast based on a histogram of how many colors are at each brightness
level on input.
+ * The goal is to produce equal number of pixels in the image at each
brightness level on output.
+ * This has the effect of revealing many subtle ground features.
+ */
+ HISTOGRAM,
+
+ /**
+ * Contrast based on a gamma value.
+ * A gamma value tells how much to brighten (value greater than 1)
+ * or dim (value less than 1) an image, with 1 meaning no change.
+ */
+ GAMMA,
+
+ /**
+ * No enhancement.
+ * This is the default value.
+ */
+ NONE;
+}
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/OverlapBehavior.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/OverlapBehavior.java
new file mode 100644
index 0000000000..41c053d8d0
--- /dev/null
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/OverlapBehavior.java
@@ -0,0 +1,52 @@
+/*
+ * 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;
+
+
+/**
+ * Behavior when multiple raster images in a layer overlap each other.
+ * Overlaps happen for example with satellite-image scenes.
+ *
+ * @author Johann Sorel (Geomatys)
+ * @version 1.5
+ * @since 1.5
+ */
+public enum OverlapBehavior {
+ /**
+ * Most recently captured scene on top.
+ */
+ LATEST_ON_TOP,
+
+ /**
+ * Less recently captures scene on top.
+ */
+ EARLIEST_ON_TOP,
+
+ /**
+ * Average multiple scenes together.
+ * This can produce blurry results if the source images
+ * are not perfectly aligned in their georeferencing.
+ */
+ AVERAGE,
+
+ /**
+ * Select an image (or piece thereof) randomly and place it on top.
+ * This can produce crisper results than {@link #AVERAGE} but is
potentially
+ * more efficiently than {@link #LATEST_ON_TOP} or {@link
#EARLIEST_ON_TOP}.
+ */
+ RANDOM
+}
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/RasterSymbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/RasterSymbolizer.java
index e0c257370e..2cff799d4f 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/RasterSymbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/RasterSymbolizer.java
@@ -23,7 +23,6 @@ import jakarta.xml.bind.annotation.XmlRootElement;
// Branch-dependent imports
import org.opengis.filter.Expression;
-import org.opengis.style.OverlapBehavior;
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/SemanticType.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/SemanticType.java
new file mode 100644
index 0000000000..5a98cb7c77
--- /dev/null
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/SemanticType.java
@@ -0,0 +1,67 @@
+/*
+ * 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;
+
+
+/**
+ * Identifies the more general "type" of geometry that this style is meant to
act upon.
+ * In the SE 1.1.0 specification, this is restricted to the following values:
+ *
+ * <ul>
+ * <li>{@code generic:point}</li>
+ * <li>{@code generic:line}</li>
+ * <li>{@code generic:polygon}</li>
+ * <li>{@code generic:text}</li>
+ * <li>{@code generic:raster}</li>
+ * <li>{@code generic:any}</li>
+ * </ul>
+ *
+ * @author Johann Sorel (Geomatys)
+ * @version 1.5
+ * @since 1.5
+ */
+public enum SemanticType {
+ /**
+ * Semantic identifies a point geometry.
+ */
+ POINT,
+
+ /**
+ * Semantic identifies a line geometry.
+ */
+ LINE,
+
+ /**
+ * Semantic identifies a polygon geometry.
+ */
+ POLYGON,
+
+ /**
+ * Semantic identifies a text.
+ */
+ TEXT,
+
+ /**
+ * Semantic identifies a raster.
+ */
+ RASTER,
+
+ /**
+ * Semantic identifies any geometry.
+ */
+ ANY;
+}
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/Style.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/Symbology.java
similarity index 95%
rename from core/sis-portrayal/src/main/java/org/apache/sis/style/se1/Style.java
rename to
core/sis-portrayal/src/main/java/org/apache/sis/style/se1/Symbology.java
index 47b97e063c..5fe570e9d6 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/Style.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/Symbology.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Optional;
+import org.apache.sis.style.Style;
/**
@@ -33,7 +34,7 @@ import java.util.Optional;
* @version 1.5
* @since 1.5
*/
-public class Style implements Cloneable {
+public class Symbology implements Style, Cloneable {
/**
* Name for this style, or {@code null} if none.
*
@@ -76,7 +77,7 @@ public class Style implements Cloneable {
/**
* Creates an initially empty style.
*/
- public Style() {
+ public Symbology() {
fts = new ArrayList<>();
}
@@ -86,7 +87,7 @@ public class Style implements Cloneable {
*
* @param source the object to copy.
*/
- public Style(final Style source) {
+ public Symbology(final Symbology source) {
name = source.name;
description = source.description;
isDefault = source.isDefault;
@@ -218,7 +219,7 @@ public class Style implements Cloneable {
return true;
}
return (obj != null) && (obj.getClass() == getClass()) &&
- Arrays.equals(properties(), ((Style) obj).properties());
+ Arrays.equals(properties(), ((Symbology) obj).properties());
}
/**
@@ -228,9 +229,9 @@ public class Style implements Cloneable {
* @return deep clone of all style elements.
*/
@Override
- public Style clone() {
+ public Symbology clone() {
try {
- final var clone = (Style) super.clone();
+ final var clone = (Symbology) super.clone();
clone.selfClone();
return clone;
} catch (CloneNotSupportedException e) {
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/package-info.java
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/package-info.java
index fb73dd6b9a..2f6d89729f 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/package-info.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/style/se1/package-info.java
@@ -27,13 +27,10 @@
* Those classes include different kinds of {@link
org.apache.sis.style.se1.Symbolizer}.
*
* <h2>Future evolution</h2>
- * This package defines an XML encoding.
- * It is not an abstract model for sophisticated styling.
- * Apache SIS temporarily uses the classes of the XML encoding as a style API,
- * but a future version may replace this API by a more abstract one.
- * A good candidate may be <cite>ISO 19117:2012 — Portrayal</cite>.
- * As of 2023, various OGC working groups are also working on new style APIs.
- * The final form of such API has not yet been settled down.
+ * This package defines an XML encoding. It is not an abstract model for
sophisticated styling.
+ * More generic styling API may be provided in a future Apache SIS version in
the {@link org.apache.sis.style} package.
+ * That future API may be derived from <cite>ISO 19117:2012 — Portrayal</cite>
and/or from the outcome of OGC standard
+ * working groups which are currently (as of June 2023) working on new style
API.
*
* <h2>Synchronization</h2>
* Unless otherwise specified in the Javadoc, classes in this package are not
thread-safe.
diff --git
a/core/sis-portrayal/src/test/java/org/apache/sis/internal/map/SEPortrayerTest.java
b/core/sis-portrayal/src/test/java/org/apache/sis/internal/map/SEPortrayerTest.java
index 5198a054f3..c7d3d091d6 100644
---
a/core/sis-portrayal/src/test/java/org/apache/sis/internal/map/SEPortrayerTest.java
+++
b/core/sis-portrayal/src/test/java/org/apache/sis/internal/map/SEPortrayerTest.java
@@ -39,7 +39,7 @@ import org.apache.sis.geometry.GeneralEnvelope;
import org.apache.sis.internal.feature.AttributeConvention;
import org.apache.sis.internal.storage.MemoryFeatureSet;
import org.apache.sis.style.se1.FeatureTypeStyle;
-import org.apache.sis.style.se1.Style;
+import org.apache.sis.style.se1.Symbology;
import org.apache.sis.storage.FeatureQuery;
import org.apache.sis.portrayal.MapItem;
import org.apache.sis.portrayal.MapLayer;
@@ -56,6 +56,7 @@ import org.apache.sis.style.se1.StyleFactory;
import org.apache.sis.test.TestCase;
import org.apache.sis.util.iso.Names;
import org.apache.sis.style.se1.Symbolizer;
+import org.apache.sis.style.se1.SemanticType;
import org.locationtech.jts.geom.CoordinateXY;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
@@ -69,7 +70,6 @@ import org.opengis.filter.Expression;
import org.opengis.filter.Filter;
import org.opengis.filter.FilterFactory;
import org.opengis.filter.MatchAction;
-import org.opengis.style.SemanticType;
import org.junit.Test;
@@ -197,7 +197,7 @@ public class SEPortrayerTest extends TestCase {
*/
@Test
public void testSanity() {
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
final var rule = factory.createRule();
final var symbolizer = factory.createLineSymbolizer();
@@ -234,7 +234,7 @@ public class SEPortrayerTest extends TestCase {
env.setRange(0, 9, 11);
env.setRange(1, 19, 21);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
final var rule = factory.createRule();
final var symbolizer = factory.createLineSymbolizer();
@@ -263,7 +263,7 @@ public class SEPortrayerTest extends TestCase {
*/
@Test
public void testUserQuery() {
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
final var rule = factory.createRule();
final var symbolizer = factory.createLineSymbolizer();
@@ -301,7 +301,7 @@ public class SEPortrayerTest extends TestCase {
*/
@Test
public void testFeatureTypeStyleTypeNames() {
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
fts.setFeatureTypeName(Names.createLocalName(null, null, "boat"));
final var rule = factory.createRule();
@@ -332,7 +332,7 @@ public class SEPortrayerTest extends TestCase {
*/
@Test
public void testFeatureTypeStyleSemanticType() {
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
fts.semanticTypeIdentifiers().add(SemanticType.POINT);
final var rule = factory.createRule();
@@ -366,7 +366,7 @@ public class SEPortrayerTest extends TestCase {
public void testRuleFilter() {
final Filter<Feature> filter = filterFactory.resourceId("2");
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
final var rule = factory.createRule();
rule.setFilter(filter);
@@ -414,7 +414,7 @@ public class SEPortrayerTest extends TestCase {
ruleMatch.setMinScaleDenominator(3e8);
ruleMatch.setMaxScaleDenominator(4e8);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
style.featureTypeStyles().add(fts);
fts.rules().add(ruleAbove);
@@ -452,7 +452,7 @@ public class SEPortrayerTest extends TestCase {
filterFactory.literal("White Shark"),
true, MatchAction.ANY);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
final var rule = factory.createRule();
rule.setFilter(filter);
@@ -496,7 +496,7 @@ public class SEPortrayerTest extends TestCase {
ruleOther.setElseFilter(true);
ruleOther.symbolizers().add(symbolizerElse);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
style.featureTypeStyles().add(fts);
fts.rules().add(ruleBase);
@@ -532,7 +532,7 @@ public class SEPortrayerTest extends TestCase {
final var ruleBase = factory.createRule();
ruleBase.symbolizers().add(symbolizerBase);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
style.featureTypeStyles().add(fts);
fts.rules().add(ruleBase);
@@ -588,7 +588,7 @@ public class SEPortrayerTest extends TestCase {
rule.symbolizers().add(symbolizer);
rule.setFilter(filter);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
style.featureTypeStyles().add(fts);
fts.rules().add(rule);
@@ -655,7 +655,7 @@ public class SEPortrayerTest extends TestCase {
rule.symbolizers().add(symbolizer);
rule.setFilter(filter);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
style.featureTypeStyles().add(fts);
fts.rules().add(rule);
@@ -696,7 +696,7 @@ public class SEPortrayerTest extends TestCase {
final var rule = factory.createRule();
rule.symbolizers().add(symbolizer);
- final Style style = new Style();
+ final Symbology style = new Symbology();
final FeatureTypeStyle fts = new FeatureTypeStyle();
style.featureTypeStyles().add(fts);
fts.rules().add(rule);
diff --git
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/ContrastEnhancementTest.java
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/ContrastEnhancementTest.java
index 86ac956a29..41cb432557 100644
---
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/ContrastEnhancementTest.java
+++
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/ContrastEnhancementTest.java
@@ -19,9 +19,6 @@ package org.apache.sis.style.se1;
import org.junit.Test;
import static org.junit.Assert.*;
-// Branch-dependent imports
-import org.opengis.style.ContrastMethod;
-
/**
* Tests for {@link ContrastEnhancement}.
diff --git
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/FeatureTypeStyleTest.java
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/FeatureTypeStyleTest.java
index cff66ade8e..495e2721a0 100644
---
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/FeatureTypeStyleTest.java
+++
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/FeatureTypeStyleTest.java
@@ -22,9 +22,6 @@ import org.apache.sis.util.iso.Names;
import org.junit.Test;
import static org.junit.Assert.*;
-// Branch-dependent imports
-import org.opengis.style.SemanticType;
-
/**
* Tests for {@link FeatureTypeStyle}.
diff --git
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/RasterSymbolizerTest.java
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/RasterSymbolizerTest.java
index 6be7723072..86aeb088de 100644
---
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/RasterSymbolizerTest.java
+++
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/RasterSymbolizerTest.java
@@ -19,9 +19,6 @@ package org.apache.sis.style.se1;
import org.junit.Test;
import static org.junit.Assert.*;
-// Branch-dependent imports
-import org.opengis.style.OverlapBehavior;
-
/**
* Tests for {@link RasterSymbolizer}.
diff --git
a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/StyleTest.java
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/SymbologyTest.java
similarity index 89%
rename from
core/sis-portrayal/src/test/java/org/apache/sis/style/se1/StyleTest.java
rename to
core/sis-portrayal/src/test/java/org/apache/sis/style/se1/SymbologyTest.java
index 7273586f27..6b81c369e3 100644
--- a/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/StyleTest.java
+++
b/core/sis-portrayal/src/test/java/org/apache/sis/style/se1/SymbologyTest.java
@@ -21,17 +21,17 @@ import static org.junit.Assert.*;
/**
- * Tests for {@link Style}.
+ * Tests for {@link Symbology}.
*
* @author Johann Sorel (Geomatys)
* @version 1.5
* @since 1.5
*/
-public final class StyleTest extends StyleTestCase {
+public final class SymbologyTest extends StyleTestCase {
/**
* Creates a new test case.
*/
- public StyleTest() {
+ public SymbologyTest() {
}
/**
@@ -39,7 +39,7 @@ public final class StyleTest extends StyleTestCase {
*/
@Test
public void testFeatureTypeStyles() {
- Style cdt = new Style();
+ Symbology cdt = new Symbology();
// Check defaults
assertTrue(cdt.featureTypeStyles().isEmpty());
@@ -54,7 +54,7 @@ public final class StyleTest extends StyleTestCase {
*/
@Test
public void testIsDefault() {
- Style cdt = new Style();
+ Symbology cdt = new Symbology();
// Check defaults
assertFalse(cdt.isDefault());
@@ -69,7 +69,7 @@ public final class StyleTest extends StyleTestCase {
*/
@Test
public void testDefaultSpecification() {
- Style cdt = new Style();
+ Symbology cdt = new Symbology();
// Check defaults
assertEmpty(cdt.getDefaultSpecification());
@@ -85,7 +85,7 @@ public final class StyleTest extends StyleTestCase {
*/
@Test
public void testName() {
- Style cdt = new Style();
+ Symbology cdt = new Symbology();
// Check defaults
assertEmpty(cdt.getName());
@@ -101,7 +101,7 @@ public final class StyleTest extends StyleTestCase {
*/
@Test
public void testDescription() {
- Style cdt = new Style();
+ Symbology cdt = new Symbology();
// Check defaults
assertEmpty(cdt.getDescription());