This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits 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 72dc0cbdae Allow the SIS geometry implementation (incubator) to be
detected.
72dc0cbdae is described below
commit 72dc0cbdaef0bc0f40d4e91ddf195040ae2af990
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Wed Nov 4 12:35:34 2026 +0100
Allow the SIS geometry implementation (incubator) to be detected.
---
.../apache/sis/geometry/wrapper/Geometries.java | 5 --
.../sis/geometry/wrapper/GeometryFactories.java | 32 +++------
.../main/org/apache/sis/setup/GeometryLibrary.java | 78 ++++++++++++----------
.../main/org/apache/sis/setup/package-info.java | 2 +-
.../org.apache.sis.geometry/main/module-info.java | 2 +
.../SIS.java => geometry/wrapper/sis/Factory.java} | 10 +--
.../adapter => geometry/wrapper/sis}/Wrapper.java | 7 +-
.../sis/geometry/wrapper/sis/FactoryTest.java | 47 +++++++++++++
.../main/module-info.java | 1 +
.../shared => geometry/wrapper}/s2/Factory.java | 5 +-
.../shared => geometry/wrapper}/s2/S2.java | 2 +-
.../shared => geometry/wrapper}/s2/Wrapper.java | 2 +-
.../sis/referencing/dggs/DiscreteGlobalGrid.java | 2 +-
.../org/apache/sis/referencing/dggs/s2/S2Zone.java | 2 +-
.../storage/dggs/DiscreteGlobalGridGeometry.java | 2 +-
.../storage/dggs/DiscreteGlobalGridSystems.java | 4 +-
.../org/apache/sis/storage/rs/CodedDerivation.java | 2 +-
17 files changed, 126 insertions(+), 79 deletions(-)
diff --git
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/Geometries.java
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/Geometries.java
index 48e6b337cf..cae98f1b24 100644
---
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/Geometries.java
+++
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/Geometries.java
@@ -103,11 +103,6 @@ public abstract class Geometries<G> implements
Serializable {
* This is set by {@link GeometryFactories} and should not change after
initialization.
* We do not synchronize the accesses to this field because we keep the
field value stable
* after {@link GeometryFactories} class initialization.
- *
- * <h4>Temporarily permitted change</h4>
- * {@link GeometryFactories#setStandard(Geometries)} temporarily permits a
change of this field,
- * but only for {@link GeometryLibrary#GEOAPI}. This is internal API and a
temporary flexibility
- * for experimenting different GeoAPI implementations.
*/
transient Geometries<?> fallback;
diff --git
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/GeometryFactories.java
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/GeometryFactories.java
index 13a01772c2..1be7e0138e 100644
---
a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/GeometryFactories.java
+++
b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/geometry/wrapper/GeometryFactories.java
@@ -18,7 +18,6 @@ package org.apache.sis.geometry.wrapper;
import java.util.logging.Level;
import java.util.logging.LogRecord;
-import org.apache.sis.setup.GeometryLibrary;
import org.apache.sis.util.logging.Logging;
import org.apache.sis.feature.internal.Resources;
@@ -37,11 +36,16 @@ import org.apache.sis.feature.internal.Resources;
public final class GeometryFactories {
/**
* The default geometry implementation to use. The default implementation
- * is JTS if present, or otherwise ESRI if present, or otherwise Java2D.
+ * is <abbr>JTS</abbr> if present, or otherwise <abbr>ESRI</abbr> if
present.
+ * Java2D is used as the last fallback. The order may change in future
version.
*/
- static final Geometries<?> DEFAULT = link(link(link(null, "j2d"), "esri"),
"jts");
+ static final Geometries<?> DEFAULT = link(link(link(link(link(null,
"j2d"), "s2"), "sis"), "esri"), "jts");
static {
- setStandard(new StandardGeometries<>(DEFAULT));
+ Geometries<?> factory = DEFAULT; // Should never be null
because at least "j2d" should be present.
+ while (factory.fallback != null) {
+ factory = factory.fallback;
+ }
+ factory.fallback = new StandardGeometries<>(DEFAULT);
}
/**
@@ -54,6 +58,8 @@ public final class GeometryFactories {
* Gets the library implementation of the given package (JTS or ESRI) if
present.
* The given name shall be the sub-package name of a {@code Factory} class.
* The last registered library will be the default implementation.
+ *
+ * @todo Replace by service loader. It may require that we move JTS, ESRI
and S2 in their own modules.
*/
private static Geometries<?> link(final Geometries<?> previous, final
String name) {
final String classname = GeometryFactories.class.getPackageName() +
'.' + name + ".Factory";
@@ -69,22 +75,4 @@ public final class GeometryFactories {
factory.fallback = previous;
return factory;
}
-
- /**
- * Sets the implementation to associate to {@link GeometryLibrary#GEOAPI}.
- * This method is used for experimenting GeoAPI implementations outside
Apache SIS.
- * This method may be removed in a future version if a stable GeoAPI
geometry implementation
- * become available.
- *
- * @param standard the implementation to associate to {@link
GeometryLibrary#GEOAPI}.
- */
- public static void setStandard(final Geometries<?> standard) {
- Geometries<?> factory = DEFAULT; // Should never be null
because at least "j2d" should be present.
- Geometries<?> last;
- do {
- last = factory;
- factory = factory.fallback;
- } while (factory != null && factory.library != GeometryLibrary.GEOAPI);
- last.fallback = standard;
- }
}
diff --git
a/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/GeometryLibrary.java
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/GeometryLibrary.java
index d4330df70d..36d9e01db7 100644
---
a/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/GeometryLibrary.java
+++
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/GeometryLibrary.java
@@ -17,19 +17,18 @@
package org.apache.sis.setup;
import org.opengis.metadata.acquisition.GeometryType;
-import org.apache.sis.util.internal.shared.Constants;
/**
* Some libraries providing geometric objects or topological operations.
- * Apache SIS uses its own implementation for the most basic objects like
+ * Apache <abbr>SIS</abbr> uses its own implementation for the most basic
objects like
* {@linkplain org.apache.sis.geometry.GeneralDirectPosition direct positions}
and
* {@linkplain org.apache.sis.geometry.GeneralEnvelope envelopes},
* and can delegate to one of the enumerated libraries for more complex
geometries.
* All those libraries are optional.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.5
+ * @version 1.8
*
* @see org.apache.sis.storage.OptionKey#GEOMETRY_LIBRARY
* @see
org.apache.sis.feature.builder.FeatureTypeBuilder#addAttribute(GeometryType)
@@ -38,8 +37,9 @@ import org.apache.sis.util.internal.shared.Constants;
*/
public enum GeometryLibrary {
/**
- * The Java 2D Graphics and Imaging library. This library does not provide
as many topological operations
- * than other libraries, but is available on most standard Java
environments and constitute a reliable
+ * The Java 2D Graphics and Imaging library.
+ * This library does not provide as many topological operations as other
libraries,
+ * but is available on most standard Java environments and constitutes a
reliable
* fallback when no other library is available.
*
* <table class="sis">
@@ -50,14 +50,15 @@ public enum GeometryLibrary {
* <tr><td>{@link GeometryType#AREAL}</td> <td>{@code
java.awt.Shape}</td></tr>
* </table>
*
- * Note that contrary to JTS and ESRI libraries,
+ * Note that contrary to <abbr>JTS</abbr> and <abbr>ESRI</abbr> libraries,
* a point does not extend any root geometry class in Java2D.
*/
- JAVA2D("Java2D"),
+ JAVA2D,
/**
- * The ESRI geometry API library. This library can be used for spatial
vector data processing.
- * It is used in ESRI GIS Tools for Hadoop and has an Android port.
+ * The <abbr>ESRI</abbr> geometry <abbr>API</abbr> library.
+ * This library can be used for spatial vector data processing.
+ * It is used in <abbr>ESRI</abbr> <abbr>GIS</abbr> Tools for Hadoop and
has an Android port.
* The library is available under Apache 2 license.
*
* <table class="sis">
@@ -69,13 +70,14 @@ public enum GeometryLibrary {
* <tr><td>{@link GeometryType#AREAL}</td> <td>{@code
com.esri.core.geometry.Polygon}</td></tr>
* </table>
*
- * @see <a href="https://github.com/Esri/geometry-api-java/wiki">API wiki
page</a>
+ * @see <a
href="https://github.com/Esri/geometry-api-java/wiki"><abbr>API</abbr> wiki
page</a>
*/
- ESRI(Constants.ESRI),
+ ESRI,
/**
- * The Java Topology Suite (JTS) library. This open source library
provides an object model
- * for Euclidean planar geometry together with a set of fundamental
geometric functions.
+ * The Java Topology Suite (<abbr>JTS</abbr>) library.
+ * This open source library provides an object model for Euclidean planar
geometry
+ * together with a set of fundamental geometric functions.
* The library is licensed under Eclipse Distribution License.
*
* <table class="sis">
@@ -87,11 +89,28 @@ public enum GeometryLibrary {
* <tr><td>{@link GeometryType#AREAL}</td> <td>{@code
org.locationtech.jts.geom.Polygon}</td></tr>
* </table>
*
- * @see <a href="http://locationtech.github.io/jts/">JTS home page</a>
+ * @see <a href="http://locationtech.github.io/jts/"><abbr>JTS</abbr> home
page</a>
*
* @since 1.0
*/
- JTS("JTS"),
+ JTS,
+
+ /**
+ * The Google S2 library.
+ * This library is designed to work with shapes drawn on a sphere rather
than on a plane.
+ * The library is licensed under the Apache License.
+ *
+ * <table class="sis">
+ * <caption>Implementation classes</caption>
+ * <tr><th>Geometry type</th> <th>Class name</th></tr>
+ * <tr><td>Root geometry class</td> <td>{@code
com.google.common.geometry.S2Region}</td></tr>
+ * </table>
+ *
+ * @see <a
href="https://github.com/google/s2-geometry-library-java"><abbr>S2</abbr>
repository</a>
+ *
+ * @since 2.0 (temporary version number until the code in incubator is
released)
+ */
+ S2,
/**
* The SIS library. This open source library provides an object model
@@ -107,14 +126,14 @@ public enum GeometryLibrary {
* <tr><td>{@link GeometryType#AREAL}</td> <td>{@code
org.apache.sis.geometries.Polygon}</td></tr>
* </table>
*
- * @since 2.0 (temporary version number until this branch is released)
+ * @since 2.0 (temporary version number until the code in incubator is
released)
*/
- SIS("SIS"),
+ SIS,
/**
* The GeoAPI geometry interfaces.
* Since GeoAPI interfaces are implementation neutral, the actual
implementation is currently unspecified
- * (a future Apache SIS version may provide some control on that).
+ * (a future Apache <abbr>SIS</abbr> version may provide some control on
that).
*
* <table class="sis">
* <caption>Implementation classes</caption>
@@ -130,21 +149,7 @@ public enum GeometryLibrary {
*
* @since 1.4
*/
- GEOAPI("GeoAPI");
-
- /**
- * Human-readable name of this library.
- */
- private final String name;
-
- /**
- * Creates a new enumeration value.
- *
- * @param name human-readable name of this library.
- */
- private GeometryLibrary(final String name) {
- this.name = name;
- }
+ GEOAPI;
/**
* Returns the name of this geometry library in a way suitable for user
interfaces.
@@ -155,7 +160,12 @@ public enum GeometryLibrary {
*
* @since 1.5
*/
+ @Override
public String toString() {
- return name;
+ switch (this) {
+ case JAVA2D: return "Java2D";
+ case GEOAPI: return "GeoAPI";
+ default: return name();
+ }
}
}
diff --git
a/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/package-info.java
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/package-info.java
index c595795802..b6ac490d81 100644
---
a/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/package-info.java
+++
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/package-info.java
@@ -20,7 +20,7 @@
* System-wide information are provided by the {@link
org.apache.sis.setup.About} class.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.7
+ * @version 1.8
* @since 0.3
*/
package org.apache.sis.setup;
diff --git a/incubator/src/org.apache.sis.geometry/main/module-info.java
b/incubator/src/org.apache.sis.geometry/main/module-info.java
index 2a2df363ce..518797235c 100644
--- a/incubator/src/org.apache.sis.geometry/main/module-info.java
+++ b/incubator/src/org.apache.sis.geometry/main/module-info.java
@@ -51,6 +51,8 @@ module org.apache.sis.geometry {
exports org.apache.sis.geometries.internal.shared to
org.apache.sis.referencing.dggs;
+ opens org.apache.sis.geometry.wrapper.sis to org.apache.sis.feature;
+
/*
* Allow JAXB to use reflection for marshalling and
* unmarshalling Apache SIS objects in XML documents.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/SIS.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometry/wrapper/sis/Factory.java
similarity index 98%
rename from
incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/SIS.java
rename to
incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometry/wrapper/sis/Factory.java
index 5d7800bed9..3f7099bbee 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/SIS.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometry/wrapper/sis/Factory.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.geometries.adapter;
+package org.apache.sis.geometry.wrapper.sis;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
@@ -31,6 +31,8 @@ import org.apache.sis.geometries.GeometryCollection;
import org.apache.sis.geometries.GeometryFactory;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.Surface;
+import org.apache.sis.geometries.adapter.WellKnownBinary;
+import org.apache.sis.geometries.adapter.WellKnownText;
import org.apache.sis.geometries.curve.Circle;
import org.apache.sis.geometries.curve.CircularString;
import org.apache.sis.geometries.curve.Clothoid;
@@ -65,9 +67,9 @@ import org.apache.sis.util.resources.Errors;
*
* @author Johann Sorel (Geomatys)
*/
-public final class SIS extends
org.apache.sis.geometry.wrapper.Geometries<Geometry> {
+public final class Factory extends
org.apache.sis.geometry.wrapper.Geometries<Geometry> {
- public static SIS INSTANCE = new SIS();
+ public static Factory INSTANCE = new Factory();
/**
* The geometry classes tested by {@link #getGeometryType(Class)}, in the
order they are tested.
@@ -126,7 +128,7 @@ public final class SIS extends
org.apache.sis.geometry.wrapper.Geometries<Geomet
GeometryType.GEOMETRY
};
- private SIS(){
+ private Factory(){
super(GeometryLibrary.SIS, Geometry.class, Point.class);
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/Wrapper.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometry/wrapper/sis/Wrapper.java
similarity index 99%
rename from
incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/Wrapper.java
rename to
incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometry/wrapper/sis/Wrapper.java
index e4612604a6..b1e1efcaac 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/Wrapper.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometry/wrapper/sis/Wrapper.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.geometries.adapter;
+package org.apache.sis.geometry.wrapper.sis;
import java.awt.Shape;
import java.util.ArrayList;
@@ -42,6 +42,8 @@ import org.apache.sis.geometries.GeometryCollection;
import org.apache.sis.geometries.GeometryFactory;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.Surface;
+import org.apache.sis.geometries.adapter.JTSAdapter;
+import org.apache.sis.geometries.adapter.ShapeAdapter;
import org.apache.sis.geometries.curve.LineString;
import org.apache.sis.geometries.curve.LinearRing;
import org.apache.sis.geometries.operation.GeometryProcessor;
@@ -52,6 +54,7 @@ import org.apache.sis.geometry.wrapper.Dimensions;
import org.apache.sis.geometry.wrapper.Geometries;
import org.apache.sis.geometry.wrapper.GeometryType;
import org.apache.sis.geometry.wrapper.GeometryWrapper;
+import org.apache.sis.geometry.wrapper.sis.Factory;
import org.apache.sis.maths.Array;
import org.apache.sis.maths.NDArrays;
import org.apache.sis.maths.SampleSystem;
@@ -142,7 +145,7 @@ public final class Wrapper extends GeometryWrapper {
*/
@Override
protected Geometries<Geometry> factory() {
- return SIS.INSTANCE;
+ return Factory.INSTANCE;
}
/**
diff --git
a/incubator/src/org.apache.sis.geometry/test/org/apache/sis/geometry/wrapper/sis/FactoryTest.java
b/incubator/src/org.apache.sis.geometry/test/org/apache/sis/geometry/wrapper/sis/FactoryTest.java
new file mode 100644
index 0000000000..e3b241659f
--- /dev/null
+++
b/incubator/src/org.apache.sis.geometry/test/org/apache/sis/geometry/wrapper/sis/FactoryTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.geometry.wrapper.sis;
+
+import org.apache.sis.geometries.Geometry;
+import org.apache.sis.setup.GeometryLibrary;
+import org.apache.sis.geometry.wrapper.Geometries;
+
+// Test dependencies
+import static org.junit.jupiter.api.Assertions.*;
+import org.junit.jupiter.api.Test;
+
+
+/**
+ * Tests {@link Factory}.
+ */
+public final class FactoryTest {
+ /**
+ * Creates a new test case.
+ */
+ public FactoryTest() {
+ }
+
+ /**
+ * Verifies that {@link Geometries} factory methods can find the {@link
Factory} implementation.
+ */
+ @Test
+ public void testFactory() {
+ assertTrue(Geometries.isKnownType(Geometry.class));
+ assertSame(Factory.INSTANCE, Geometries.factory(Geometry.class));
+ assertSame(Factory.INSTANCE, Geometries.factory(GeometryLibrary.SIS));
+ }
+}
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/module-info.java
b/incubator/src/org.apache.sis.referencing.dggs/main/module-info.java
index 5093857c59..d9774cbfde 100644
--- a/incubator/src/org.apache.sis.referencing.dggs/main/module-info.java
+++ b/incubator/src/org.apache.sis.referencing.dggs/main/module-info.java
@@ -34,6 +34,7 @@ module org.apache.sis.referencing.dggs {
exports org.apache.sis.storage.coverage;
exports org.apache.sis.storage.dggs;
exports org.apache.sis.storage.rs;
+ opens org.apache.sis.geometry.wrapper.s2 to org.apache.sis.feature;
uses
org.apache.sis.referencing.dggs.DiscreteGlobalGridReferenceSystemFactory;
provides
org.apache.sis.referencing.dggs.DiscreteGlobalGridReferenceSystemFactory
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/Factory.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/Factory.java
similarity index 98%
rename from
incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/Factory.java
rename to
incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/Factory.java
index 54c74c7c01..d159b05b62 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/Factory.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/Factory.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.storage.rs.internal.shared.s2;
+package org.apache.sis.geometry.wrapper.s2;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
@@ -58,8 +58,7 @@ public final class Factory extends Geometries<S2Region> {
* Creates the singleton instance.
*/
private Factory() {
- /** TODO this should be S2, not GEOAPI, need a sis update */
- super(GeometryLibrary.GEOAPI, S2Region.class, S2Point.class);
+ super(GeometryLibrary.S2, S2Region.class, S2Point.class);
}
/**
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/S2.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/S2.java
similarity index 99%
rename from
incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/S2.java
rename to
incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/S2.java
index 59bd4bfe1a..f3912171c9 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/S2.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/S2.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.storage.rs.internal.shared.s2;
+package org.apache.sis.geometry.wrapper.s2;
import java.util.ArrayList;
import java.util.List;
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/Wrapper.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/Wrapper.java
similarity index 97%
rename from
incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/Wrapper.java
rename to
incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/Wrapper.java
index e3c525ccd2..284825b5d3 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/internal/shared/s2/Wrapper.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/geometry/wrapper/s2/Wrapper.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.storage.rs.internal.shared.s2;
+package org.apache.sis.geometry.wrapper.s2;
import java.util.Iterator;
import com.google.common.geometry.S2Region;
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/DiscreteGlobalGrid.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/DiscreteGlobalGrid.java
index e5b963a18c..900ee19b03 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/DiscreteGlobalGrid.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/DiscreteGlobalGrid.java
@@ -27,7 +27,7 @@ import org.opengis.referencing.operation.TransformException;
import org.apache.sis.geometry.DirectPosition2D;
import org.apache.sis.geometry.Envelopes;
import org.apache.sis.referencing.CommonCRS;
-import org.apache.sis.storage.rs.internal.shared.s2.S2;
+import org.apache.sis.geometry.wrapper.s2.S2;
/**
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/s2/S2Zone.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/s2/S2Zone.java
index d663bcae11..f65ea37ba3 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/s2/S2Zone.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/referencing/dggs/s2/S2Zone.java
@@ -33,7 +33,7 @@ import org.apache.sis.referencing.CommonCRS;
import org.apache.sis.referencing.dggs.RefinementLevel;
import org.apache.sis.referencing.dggs.Zone;
import org.apache.sis.referencing.dggs.internal.shared.AbstractZone;
-import org.apache.sis.storage.rs.internal.shared.s2.S2;
+import org.apache.sis.geometry.wrapper.s2.S2;
/**
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridGeometry.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridGeometry.java
index 0893e4db2c..82ef0a583e 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridGeometry.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridGeometry.java
@@ -40,7 +40,7 @@ import
org.apache.sis.referencing.operation.transform.TransformFactoryException;
import org.apache.sis.storage.rs.CodeTransform;
import org.apache.sis.storage.rs.CodedGeometry;
import org.apache.sis.storage.rs.internal.shared.CodeTransforms;
-import org.apache.sis.storage.rs.internal.shared.s2.S2;
+import org.apache.sis.geometry.wrapper.s2.S2;
import org.apache.sis.util.Utilities;
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridSystems.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridSystems.java
index 56488e9042..e9975d8f8d 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridSystems.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/dggs/DiscreteGlobalGridSystems.java
@@ -64,8 +64,8 @@ import
org.apache.sis.storage.dggs.internal.shared.MemoryDiscreteGlobalGridResou
import org.apache.sis.storage.rs.CodedCoverage;
import org.apache.sis.storage.rs.CodedResource;
import org.apache.sis.storage.rs.internal.shared.CodedCoverageAsFeatureSet;
-import org.apache.sis.storage.rs.internal.shared.s2.Factory;
-import org.apache.sis.storage.rs.internal.shared.s2.S2;
+import org.apache.sis.geometry.wrapper.s2.Factory;
+import org.apache.sis.geometry.wrapper.s2.S2;
/**
diff --git
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/CodedDerivation.java
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/CodedDerivation.java
index db5de4a498..39f125fc86 100644
---
a/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/CodedDerivation.java
+++
b/incubator/src/org.apache.sis.referencing.dggs/main/org/apache/sis/storage/rs/CodedDerivation.java
@@ -49,7 +49,7 @@ import org.apache.sis.storage.dggs.DiscreteGlobalGridGeometry;
import org.apache.sis.storage.dggs.DiscreteGlobalGridSystems;
import
org.apache.sis.storage.dggs.internal.shared.GridAsDiscreteGlobalGridResource;
import org.apache.sis.storage.rs.internal.shared.CodeTransforms;
-import org.apache.sis.storage.rs.internal.shared.s2.S2;
+import org.apache.sis.geometry.wrapper.s2.S2;
import org.apache.sis.util.Utilities;