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 2f26b9aa3e refactor(Geometry): seal geometry interfaces
2f26b9aa3e is described below
commit 2f26b9aa3e19448aa29ce342d708aa3a0cf89a21
Author: jsorel <[email protected]>
AuthorDate: Tue Sep 8 12:23:17 2026 +0200
refactor(Geometry): seal geometry interfaces
---
.../main/org/apache/sis/geometries/Curve.java | 28 +-
.../main/org/apache/sis/geometries/Empty.java | 5 +-
.../main/org/apache/sis/geometries/Geometry.java | 13 +-
.../apache/sis/geometries/GeometryCollection.java | 17 +-
.../main/org/apache/sis/geometries/Orientable.java | 5 +-
.../apache/sis/geometries/OrientedGeometry.java | 7 +-
.../main/org/apache/sis/geometries/Point.java | 13 +-
.../main/org/apache/sis/geometries/Primitive.java | 6 +-
.../main/org/apache/sis/geometries/Prism.java | 2 +-
.../main/org/apache/sis/geometries/Solid.java | 7 +-
.../main/org/apache/sis/geometries/Surface.java | 13 +-
.../apache/sis/geometries/adapter/JTSAdapter.java | 59 +--
.../main/org/apache/sis/geometries/curve/Arc.java | 4 +-
.../apache/sis/geometries/curve/ArcByBulge.java | 5 +-
.../sis/geometries/curve/ArcByCenterPoint.java | 5 +-
.../apache/sis/geometries/curve/BSplineCurve.java | 5 +-
.../org/apache/sis/geometries/curve/Bezier.java | 2 +-
.../org/apache/sis/geometries/curve/Circle.java | 2 +-
.../sis/geometries/curve/CircularString.java | 5 +-
.../org/apache/sis/geometries/curve/Clothoid.java | 2 +-
.../apache/sis/geometries/curve/CompoundCurve.java | 5 +-
.../org/apache/sis/geometries/curve/Conic.java | 5 +-
.../apache/sis/geometries/curve/CubicSpline.java | 2 +-
.../apache/sis/geometries/curve/EllipticArc.java | 2 +-
.../apache/sis/geometries/curve/FunctionCurve.java | 4 +-
.../org/apache/sis/geometries/curve/Geodesic.java | 5 +-
.../apache/sis/geometries/curve/LineString.java | 11 +-
.../apache/sis/geometries/curve/LinearRing.java | 5 +-
.../apache/sis/geometries/curve/MultiCurve.java | 6 +-
.../sis/geometries/curve/MultiLineString.java | 7 +-
.../org/apache/sis/geometries/curve/NurbCurve.java | 5 +-
.../apache/sis/geometries/curve/OffsetCurve.java | 2 +-
.../sis/geometries/curve/PolynomialCurve.java | 4 +-
.../sis/geometries/curve/PolynomialSpline.java | 7 +-
.../apache/sis/geometries/curve/ProductCurve.java | 2 +-
.../org/apache/sis/geometries/curve/Rhumb.java | 5 +-
.../org/apache/sis/geometries/curve/Spiral.java | 4 +-
.../apache/sis/geometries/curve/SplineCurve.java | 5 +-
.../internal/shared/AbstractGeometry.java | 2 +-
.../internal/shared/AbstractOrientedGeometry.java | 2 +-
.../internal/shared/ArrayDataPoints.java | 2 +-
.../internal/shared/DefaultArcByBulge.java | 2 +-
.../internal/shared/DefaultArcByCenterPoint.java | 2 +-
.../internal/shared/DefaultCircularString.java | 2 +-
.../internal/shared/DefaultCompoundCurve.java | 2 +-
.../internal/shared/DefaultCurvePolygon.java | 2 +-
.../geometries/internal/shared/DefaultEmpty.java | 2 +-
.../internal/shared/DefaultGeodesic.java | 2 +-
.../internal/shared/DefaultGeometryCollection.java | 2 +-
.../internal/shared/DefaultLineString.java | 2 +-
.../internal/shared/DefaultLinearRing.java | 2 +-
.../internal/shared/DefaultMultiCurve.java | 2 +-
.../internal/shared/DefaultMultiLineString.java | 2 +-
.../internal/shared/DefaultMultiPoint.java | 2 +-
.../internal/shared/DefaultMultiPolygon.java | 2 +-
.../internal/shared/DefaultMultiPolyhedron.java | 2 +-
.../internal/shared/DefaultMultiSurface.java | 2 +-
.../internal/shared/DefaultNurbCurve.java | 2 +-
.../internal/shared/DefaultNurbSurface.java | 12 +-
.../geometries/internal/shared/DefaultPoint.java | 2 +-
.../geometries/internal/shared/DefaultPolygon.java | 2 +-
.../internal/shared/DefaultPolyhedralSurface.java | 2 +-
.../internal/shared/DefaultPolyhedron.java | 2 +-
.../internal/shared/DefaultRawMultiPoint.java | 2 +-
.../internal/shared/DefaultReversedCurve.java | 2 +-
.../internal/shared/DefaultReversedSurface.java | 2 +-
.../geometries/internal/shared/DefaultRhumb.java | 2 +-
.../internal/shared/DefaultTriangle.java | 2 +-
.../shared/DefaultTriangulatedSurface.java | 2 +-
.../{DefaultMultiPoint.java => IndexedPoint.java} | 52 ++-
.../apache/sis/geometries/mesh/MeshPrimitive.java | 30 +-
.../operation/simplify/greedyinsert/WTriangle.java | 42 +-
.../triangulate/delaunay/OrientedEdge.java | 2 +-
.../triangulate/delaunay/OrientedTriangle.java | 2 +-
.../apache/sis/geometries/point/MultiPoint.java | 9 +-
.../apache/sis/geometries/solid/BSolidSpline.java | 2 +-
.../sis/geometries/solid/MultiPolyhedron.java | 5 +-
.../sis/geometries/solid/ParametricCurveSolid.java | 4 +-
.../apache/sis/geometries/solid/Polyhedron.java | 7 +-
.../solid/polyhedron/AbstractPolyhedron.java | 10 +-
.../main/org/apache/sis/geometries/summary.adoc | 464 ++++++++++++++++++---
.../sis/geometries/surface/BSplineSurface.java | 4 +-
.../sis/geometries/surface/BilinearGrid.java | 2 +-
.../sis/geometries/surface/CurvePolygon.java | 5 +-
.../sis/geometries/surface/MultiPolygon.java | 5 +-
.../sis/geometries/surface/MultiSurface.java | 6 +-
.../apache/sis/geometries/surface/NurbSurface.java | 6 +-
.../geometries/surface/ParametricCurveSurface.java | 7 +-
.../org/apache/sis/geometries/surface/Polygon.java | 6 +-
.../sis/geometries/surface/PolyhedralSurface.java | 6 +-
.../apache/sis/geometries/surface/PreparedTIN.java | 5 +-
.../org/apache/sis/geometries/surface/TIN.java | 10 +-
.../apache/sis/geometries/surface/Triangle.java | 9 +-
.../geometries/surface/TriangulatedSurface.java | 4 +-
94 files changed, 787 insertions(+), 280 deletions(-)
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Curve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Curve.java
index 0e5ab4885a..d84852377f 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Curve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Curve.java
@@ -18,7 +18,19 @@ package org.apache.sis.geometries;
import java.util.List;
import javax.measure.quantity.Length;
+import org.apache.sis.geometries.curve.ArcByBulge;
+import org.apache.sis.geometries.curve.ArcByCenterPoint;
+import org.apache.sis.geometries.curve.CircularString;
+import org.apache.sis.geometries.curve.CompoundCurve;
+import org.apache.sis.geometries.curve.Conic;
+import org.apache.sis.geometries.curve.FunctionCurve;
+import org.apache.sis.geometries.curve.Geodesic;
import org.apache.sis.geometries.curve.LineString;
+import org.apache.sis.geometries.curve.OffsetCurve;
+import org.apache.sis.geometries.curve.ProductCurve;
+import org.apache.sis.geometries.curve.Rhumb;
+import org.apache.sis.geometries.curve.Spiral;
+import org.apache.sis.geometries.internal.shared.DefaultReversedCurve;
import org.apache.sis.maths.Array;
import org.apache.sis.maths.Vector;
import static org.opengis.annotation.Specification.ISO_19107;
@@ -34,7 +46,21 @@ import org.opengis.geometry.DirectPosition;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Curve", specification=ISO_19107) // section 6.4.18
-public interface Curve extends Orientable {
+public sealed interface Curve extends Orientable
+ permits ArcByBulge,
+ ArcByCenterPoint,
+ CircularString,
+ CompoundCurve,
+ Conic,
+ FunctionCurve,
+ Geodesic,
+ LineString,
+ OffsetCurve,
+ ProductCurve,
+ Rhumb,
+ Spiral,
+ DefaultReversedCurve
+{
/**
* Contains a list of points on the curve.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Empty.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Empty.java
index 997fdbf91d..e0d7fb9caf 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Empty.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Empty.java
@@ -16,6 +16,7 @@
*/
package org.apache.sis.geometries;
+import org.apache.sis.geometries.internal.shared.DefaultEmpty;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -25,7 +26,9 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Empty", specification=ISO_19107) // section 6.4.10
-public interface Empty extends Geometry{
+public sealed interface Empty extends Geometry
+ permits DefaultEmpty
+{
public static final String TYPE = "EMPTY";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Geometry.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Geometry.java
index b3d8804a8d..14318c0161 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Geometry.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Geometry.java
@@ -19,6 +19,8 @@ package org.apache.sis.geometries;
import java.util.List;
import java.util.Map;
import javax.measure.quantity.Length;
+import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.mesh.MeshPrimitive;
import org.apache.sis.geometries.operation.GeometryProcessor;
import org.apache.sis.geometries.operation.OperationException;
import static org.opengis.annotation.Specification.ISO_19107;
@@ -50,7 +52,16 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Geometry", specification=ISO_19107) // section 6.4.4
-public interface Geometry {
+public sealed interface Geometry
+ permits Primitive,
+ GeometryCollection,
+ OrientedGeometry,
+ Empty,
+ Prism,
+ MeshPrimitive,
+ AbstractGeometry,
+ BBox
+{
/**
* Get geometry coordinate system.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/GeometryCollection.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/GeometryCollection.java
index 8d985fcf66..996992fe75 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/GeometryCollection.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/GeometryCollection.java
@@ -17,6 +17,13 @@
package org.apache.sis.geometries;
import java.util.Set;
+import org.apache.sis.geometries.curve.MultiCurve;
+import org.apache.sis.geometries.curve.ProductCurve;
+import org.apache.sis.geometries.internal.shared.DefaultGeometryCollection;
+import org.apache.sis.geometries.mesh.MultiMeshPrimitive;
+import org.apache.sis.geometries.point.MultiPoint;
+import org.apache.sis.geometries.solid.MultiPolyhedron;
+import org.apache.sis.geometries.surface.MultiSurface;
import org.apache.sis.geometry.GeneralEnvelope;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -35,7 +42,15 @@ import org.opengis.geometry.Envelope;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Collection", specification=ISO_19107) // section 6.4.31
-public interface GeometryCollection<T extends Geometry> extends Geometry {
+public sealed interface GeometryCollection<T extends Geometry> extends Geometry
+ permits MultiPoint,
+ MultiCurve,
+ MultiSurface,
+ MultiPolyhedron,
+ ProductCurve,
+ DefaultGeometryCollection,
+ MultiMeshPrimitive
+{
public static final String TYPE = "GEOMETRYCOLLECTION";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Orientable.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Orientable.java
index feabb3c8e1..e962e2e954 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Orientable.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Orientable.java
@@ -25,7 +25,10 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Orientable", specification=ISO_19107) // section 6.4.15
-public interface Orientable extends Primitive {
+public sealed interface Orientable extends Primitive
+ permits Curve,
+ Surface
+{
public static enum Sign {
POSITIVE,
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
index 1515128428..5c04689bc0 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
@@ -16,8 +16,9 @@
*/
package org.apache.sis.geometries;
-import org.opengis.geometry.Envelope;
+import org.apache.sis.geometries.internal.shared.AbstractOrientedGeometry;
import org.apache.sis.maths.Similarity;
+import org.opengis.geometry.Envelope;
/**
@@ -39,7 +40,9 @@ import org.apache.sis.maths.Similarity;
*
* @author Johann Sorel
*/
-public interface OrientedGeometry extends Geometry {
+public sealed interface OrientedGeometry extends Geometry
+ permits AbstractOrientedGeometry
+{
/**
* Get geometry transform.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Point.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Point.java
index 9483df251f..118726ce0a 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Point.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Point.java
@@ -17,6 +17,11 @@
package org.apache.sis.geometries;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.ArrayDataPoints;
+import org.apache.sis.geometries.internal.shared.DefaultPoint;
+import org.apache.sis.geometries.internal.shared.IndexedPoint;
+import org.apache.sis.geometries.mesh.MeshPrimitive;
+import org.apache.sis.geometries.surface.Triangle;
import org.apache.sis.maths.Tuple;
import org.apache.sis.maths.Vector;
import static org.opengis.annotation.Specification.ISO_19107;
@@ -33,7 +38,13 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Point", specification=ISO_19107) // section 6.4.13
-public interface Point extends Primitive {
+public sealed interface Point extends Primitive
+ permits DefaultPoint,
+ IndexedPoint,
+ ArrayDataPoints.Indexed,
+ MeshPrimitive.Vertex,
+ Triangle.InterpolatedPoint
+{
public static final String TYPE = "POINT";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Primitive.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Primitive.java
index beae94729c..da00456808 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Primitive.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Primitive.java
@@ -26,7 +26,11 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Primitive", specification=ISO_19107) // section 6.4.11
-public interface Primitive extends Geometry {
+public sealed interface Primitive extends Geometry
+ permits Point,
+ Orientable,
+ Solid
+{
default List<Primitive> getSegments() {
//TODO
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Prism.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Prism.java
index 23ffa4eb7d..a8251953fc 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Prism.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Prism.java
@@ -26,7 +26,7 @@ import org.apache.sis.measure.NumberRange;
* @author Johann Sorel (Geomatys)
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#prism
*/
-public interface Prism extends Geometry {
+public non-sealed interface Prism extends Geometry {
public static final String TYPE = "PRISM";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Solid.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Solid.java
index 4b54cfdf00..3b9f2f0848 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Solid.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Solid.java
@@ -19,6 +19,8 @@ package org.apache.sis.geometries;
import java.util.List;
import javax.measure.quantity.Area;
import javax.measure.quantity.Volume;
+import org.apache.sis.geometries.solid.ParametricCurveSolid;
+import org.apache.sis.geometries.solid.Polyhedron;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
import org.opengis.geometry.DirectPosition;
@@ -29,7 +31,10 @@ import org.opengis.geometry.DirectPosition;
* @author Johann Sorel (Geomatys
*/
@UML(identifier="Solid", specification=ISO_19107) // section 6.4.28
-public interface Solid extends Primitive {
+public sealed interface Solid extends Primitive
+ permits ParametricCurveSolid,
+ Polyhedron
+{
/**
* Returns 3: a polyhedron bounds a volume.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Surface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Surface.java
index 3a4f306a2b..a5e6eaaa8e 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Surface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Surface.java
@@ -18,6 +18,11 @@ package org.apache.sis.geometries;
import java.util.List;
import javax.measure.quantity.Length;
+import org.apache.sis.geometries.internal.shared.DefaultReversedSurface;
+import org.apache.sis.geometries.surface.CurvePolygon;
+import org.apache.sis.geometries.surface.ParametricCurveSurface;
+import org.apache.sis.geometries.surface.Polygon;
+import org.apache.sis.geometries.surface.PolyhedralSurface;
import org.apache.sis.maths.Vector;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -49,7 +54,13 @@ import org.opengis.geometry.DirectPosition;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Surface", specification=ISO_19107) // section 6.4.25
-public interface Surface extends Orientable {
+public sealed interface Surface extends Orientable
+ permits CurvePolygon,
+ ParametricCurveSurface,
+ Polygon,
+ PolyhedralSurface,
+ DefaultReversedSurface
+{
/**
* The area of this Surface, as measured in the spatial reference system
of this Surface.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/JTSAdapter.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/JTSAdapter.java
index c273887fce..a26fc4b174 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/JTSAdapter.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/adapter/JTSAdapter.java
@@ -30,6 +30,7 @@ import org.apache.sis.geometries.curve.LineString;
import org.apache.sis.geometries.curve.LinearRing;
import org.apache.sis.geometries.curve.MultiLineString;
import org.apache.sis.geometries.internal.shared.ArrayDataPoints;
+import org.apache.sis.geometries.internal.shared.IndexedPoint;
import org.apache.sis.geometries.point.MultiPoint;
import org.apache.sis.geometries.surface.MultiPolygon;
import org.apache.sis.geometries.surface.Polygon;
@@ -263,7 +264,7 @@ public final class JTSAdapter {
@Override
public Point getPoint(int index) {
- return new JTSPoint(this, index);
+ return new IndexedPoint(this, index);
}
@Override
@@ -301,62 +302,6 @@ public final class JTSAdapter {
}
- /**
- * An indexed point in the jts sequence
- */
- private static class JTSPoint implements Point {
-
- private final JTSDataPoints parent;
- private final int index;
-
- public JTSPoint(JTSDataPoints geometry, int index) {
- this.parent = geometry;
- this.index = index;
- }
-
- @Override
- public boolean isEmpty() {
- return false;
- }
-
- @Override
- public Tuple getPosition() {
- return parent.getPosition(index);
- }
-
- /**
- * @return index in the parent.
- */
- public int getIndex() {
- return index;
- }
-
- @Override
- public Tuple getAttribute(String key) {
- return parent.getAttribute(index, key);
- }
-
- @Override
- public void setAttribute(String name, Tuple tuple) {
- parent.setAttribute(index, name, tuple);
- }
-
- @Override
- public CoordinateReferenceSystem getCoordinateReferenceSystem() {
- return parent.getCoordinateReferenceSystem();
- }
-
- @Override
- public void setCoordinateReferenceSystem(CoordinateReferenceSystem
crs) {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- @Override
- public AttributesType getAttributesType() {
- return parent.getAttributesType();
- }
- }
-
private static class SISSequence implements CoordinateSequence {
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Arc.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Arc.java
index c29f93f144..daa27645c2 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Arc.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Arc.java
@@ -29,7 +29,9 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Arc", specification=ISO_19107) // section 7.9.2
-public interface Arc extends Conic {
+public sealed interface Arc extends Conic
+ permits Circle
+{
@UML(identifier="numArc", specification=ISO_19107) // section 7.9.2.2
int getNumArc();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByBulge.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByBulge.java
index 238998b3cc..54402c1391 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByBulge.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByBulge.java
@@ -20,6 +20,7 @@ import org.apache.sis.geometries.AttributesType;
import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
+import org.apache.sis.geometries.internal.shared.DefaultArcByBulge;
import org.apache.sis.maths.Array;
import org.apache.sis.maths.Vector;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -39,7 +40,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
* @see GML ArcByBulge
*/
-public interface ArcByBulge extends Curve {
+public sealed interface ArcByBulge extends Curve
+ permits DefaultArcByBulge
+{
public static final String TYPE = "ARCBYBULGE";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByCenterPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByCenterPoint.java
index 0bbc9a163c..e6711cb7c4 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByCenterPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ArcByCenterPoint.java
@@ -22,6 +22,7 @@ import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
+import org.apache.sis.geometries.internal.shared.DefaultArcByCenterPoint;
import org.apache.sis.maths.Array;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -42,7 +43,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
* @see GML ArcByCenterPoint
*/
-public interface ArcByCenterPoint extends Curve {
+public sealed interface ArcByCenterPoint extends Curve
+ permits DefaultArcByCenterPoint
+{
public static final String TYPE = "ARCBYCENTERPOINT";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/BSplineCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/BSplineCurve.java
index 412a1f298c..913a353bf0 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/BSplineCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/BSplineCurve.java
@@ -24,6 +24,9 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="BSplineCurve", specification=ISO_19107) // section 7.13.8
-public interface BSplineCurve extends SplineCurve{
+public sealed interface BSplineCurve extends SplineCurve
+ permits Bezier,
+ NurbCurve
+{
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Bezier.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Bezier.java
index 8069be3419..8a83065fab 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Bezier.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Bezier.java
@@ -24,6 +24,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Bezier", specification=ISO_19107) // section 7.13.7
-public interface Bezier extends PolynomialSpline, BSplineCurve{
+public non-sealed interface Bezier extends PolynomialSpline, BSplineCurve {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Circle.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Circle.java
index cfef2debee..cd0268b4ef 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Circle.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Circle.java
@@ -25,6 +25,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Circle", specification=ISO_19107) // section 7.9.4
-public interface Circle extends Arc{
+public non-sealed interface Circle extends Arc {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CircularString.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CircularString.java
index 5c779bf439..8d1b55221e 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CircularString.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CircularString.java
@@ -21,6 +21,7 @@ import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
+import org.apache.sis.geometries.internal.shared.DefaultCircularString;
import org.apache.sis.maths.Array;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -35,7 +36,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#circular_string
* @see GML ArcString
*/
-public interface CircularString extends Curve {
+public sealed interface CircularString extends Curve
+ permits DefaultCircularString
+{
public static final String TYPE = "CIRCULARSTRING";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Clothoid.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Clothoid.java
index 59ff0a2841..96d7ebf457 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Clothoid.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Clothoid.java
@@ -25,6 +25,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Clothoid", specification=ISO_19107) // section 7.11.3
-public interface Clothoid extends Spiral {
+public non-sealed interface Clothoid extends Spiral {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CompoundCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CompoundCurve.java
index b2c7cdce25..8e740009aa 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CompoundCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CompoundCurve.java
@@ -21,6 +21,7 @@ import java.util.List;
import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.Point;
+import org.apache.sis.geometries.internal.shared.DefaultCompoundCurve;
/**
* A curve made of several curves joined end to end, each of which may use a
different
@@ -30,7 +31,9 @@ import org.apache.sis.geometries.Point;
* @author Johann Sorel (Geomatys
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#compound_curve
*/
-public interface CompoundCurve extends Curve {
+public sealed interface CompoundCurve extends Curve
+ permits DefaultCompoundCurve
+{
public static final String TYPE = "COMPOUNDCURVE";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Conic.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Conic.java
index c1ed8a642c..36d9fb0851 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Conic.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Conic.java
@@ -28,7 +28,10 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Conic", specification=ISO_19107) // section 7.9.5
-public interface Conic extends Curve {
+public sealed interface Conic extends Curve
+ permits Arc,
+ EllipticArc
+{
@UML(identifier="dataPoints", specification=ISO_19107) // section 7.9.5.2
@Override
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CubicSpline.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CubicSpline.java
index a76abc004b..16792e708f 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CubicSpline.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/CubicSpline.java
@@ -25,6 +25,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="CubicSpline", specification=ISO_19107) // section 7.13.6
-public interface CubicSpline extends PolynomialSpline {
+public non-sealed interface CubicSpline extends PolynomialSpline {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/EllipticArc.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/EllipticArc.java
index e274bc024e..356c30ff95 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/EllipticArc.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/EllipticArc.java
@@ -25,6 +25,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="EllipticArc", specification=ISO_19107) // section 7.9.6
-public interface EllipticArc extends Conic {
+public non-sealed interface EllipticArc extends Conic {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/FunctionCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/FunctionCurve.java
index 4512b1a6e6..0f8f0b8576 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/FunctionCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/FunctionCurve.java
@@ -26,7 +26,9 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="FunctionCurve", specification=ISO_19107) // section 7.7.5
-public interface FunctionCurve<T extends FunctionArc> extends Curve{
+public sealed interface FunctionCurve<T extends FunctionArc> extends Curve
+ permits PolynomialCurve
+{
@UML(identifier="numArc", specification=ISO_19107) // section 7.7.5.2
Integer getNumArc();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Geodesic.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Geodesic.java
index d336a91b32..0bd2b3a319 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Geodesic.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Geodesic.java
@@ -22,6 +22,7 @@ import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultGeodesic;
import org.apache.sis.maths.Array;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -34,7 +35,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Geodesic", specification=ISO_19107) // section 7.3.2
-public interface Geodesic extends Curve {
+public sealed interface Geodesic extends Curve
+ permits DefaultGeodesic
+{
public static final String TYPE = "GEODESIC";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LineString.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LineString.java
index a3d80f8d41..cd02fd3cad 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LineString.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LineString.java
@@ -23,6 +23,9 @@ import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultLineString;
+import org.apache.sis.geometries.mesh.MeshPrimitive;
+import org.apache.sis.geometries.operation.triangulate.delaunay.OrientedEdge;
import org.apache.sis.maths.Array;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -39,7 +42,13 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Line", specification=ISO_19107) // section 7.1.2
-public interface LineString extends Curve {
+public sealed interface LineString extends Curve
+ permits LinearRing,
+ DefaultLineString,
+ MeshPrimitive.LineLoop,
+ MeshPrimitive.LineStrip,
+ OrientedEdge
+{
public static final String TYPE = "LINESTRING";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LinearRing.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LinearRing.java
index ac1f72cf71..1d5b9e0f12 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LinearRing.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/LinearRing.java
@@ -18,6 +18,7 @@ package org.apache.sis.geometries.curve;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultLinearRing;
import org.apache.sis.maths.Tuple;
@@ -26,7 +27,9 @@ import org.apache.sis.maths.Tuple;
*
* @author Johann Sorel (Geomatys)
*/
-public interface LinearRing extends LineString {
+public sealed interface LinearRing extends LineString
+ permits DefaultLinearRing
+{
public static final String TYPE = "LINEARRING";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiCurve.java
index 0de7723f3c..5379fee61c 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiCurve.java
@@ -18,6 +18,7 @@ package org.apache.sis.geometries.curve;
import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.GeometryCollection;
+import org.apache.sis.geometries.internal.shared.DefaultMultiCurve;
/**
@@ -41,7 +42,10 @@ import org.apache.sis.geometries.GeometryCollection;
* @author Johann Sorel (Geomatys)
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#multi_curve
*/
-public interface MultiCurve<T extends Curve> extends GeometryCollection<T>{
+public sealed interface MultiCurve<T extends Curve> extends
GeometryCollection<T>
+ permits MultiLineString,
+ DefaultMultiCurve
+{
public static final String TYPE = "MULTICURVE";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiLineString.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiLineString.java
index 284b835870..7910a58539 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiLineString.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/MultiLineString.java
@@ -18,6 +18,8 @@ package org.apache.sis.geometries.curve;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultMultiLineString;
+import org.apache.sis.geometries.mesh.MeshPrimitive;
import org.apache.sis.maths.Tuple;
@@ -26,7 +28,10 @@ import org.apache.sis.maths.Tuple;
*
* @author Johann Sorel (Geomatys)
*/
-public interface MultiLineString extends MultiCurve<LineString> {
+public sealed interface MultiLineString extends MultiCurve<LineString>
+ permits DefaultMultiLineString,
+ MeshPrimitive.Lines
+{
public static final String TYPE = "MULTILINESTRING";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/NurbCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/NurbCurve.java
index 33004cd862..655ca0e168 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/NurbCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/NurbCurve.java
@@ -20,6 +20,7 @@ import org.apache.sis.geometries.AttributesType;
import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultNurbCurve;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -30,7 +31,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="NURB", specification=ISO_19107) // section 7.13.8
-public interface NurbCurve extends BSplineCurve {
+public sealed interface NurbCurve extends BSplineCurve
+ permits DefaultNurbCurve
+{
public static final String TYPE = "NURBS";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/OffsetCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/OffsetCurve.java
index 0e591ea70c..d96c39dcff 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/OffsetCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/OffsetCurve.java
@@ -28,7 +28,7 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="OffsetCurve", specification=ISO_19107) // section 6.4.20
-public interface OffsetCurve extends Curve{
+public non-sealed interface OffsetCurve extends Curve {
@UML(identifier="distance", specification=ISO_19107) // section 6.4.20.2
Length getDistance();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialCurve.java
index 2891965cb9..081a82fd11 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialCurve.java
@@ -25,7 +25,9 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="PolynomialCurve", specification=ISO_19107) // section 7.7.9
-public interface PolynomialCurve<PolynomialArc> extends FunctionCurve {
+public sealed interface PolynomialCurve<PolynomialArc> extends FunctionCurve
+ permits SplineCurve
+{
@UML(identifier="degree", specification=ISO_19107) // section 7.7.9.2
int getDegree();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialSpline.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialSpline.java
index 9d927a4306..8798384e5d 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialSpline.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/PolynomialSpline.java
@@ -16,9 +16,9 @@
*/
package org.apache.sis.geometries.curve;
+import org.apache.sis.maths.Vector;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
-import org.apache.sis.maths.Vector;
/**
@@ -26,7 +26,10 @@ import org.apache.sis.maths.Vector;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="PolynomialSpline", specification=ISO_19107) // section 7.13.5
-public interface PolynomialSpline extends SplineCurve {
+public sealed interface PolynomialSpline extends SplineCurve
+ permits CubicSpline,
+ Bezier
+{
@UML(identifier="derivativeAtStart", specification=ISO_19107) // section
7.13.5.2
Vector getDerivativeAtStart();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ProductCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ProductCurve.java
index 459987f3ab..a4aa44b1ef 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ProductCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/ProductCurve.java
@@ -30,7 +30,7 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="ProductCurve", specification=ISO_19107) // section 6.4.22
-public interface ProductCurve extends Curve, GeometryCollection<Curve> {
+public non-sealed interface ProductCurve extends Curve,
GeometryCollection<Curve> {
@UML(identifier="parameterRange", specification=ISO_19107) // section
6.4.22.2
Range<?> getParameterRange();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Rhumb.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Rhumb.java
index 48c88dba86..0591afabd9 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Rhumb.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Rhumb.java
@@ -23,6 +23,7 @@ import org.apache.sis.geometries.CurveInterpolation;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultRhumb;
import org.apache.sis.maths.Array;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -35,7 +36,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Rhumb", specification=ISO_19107) // section 7.5.1
-public interface Rhumb extends Curve {
+public sealed interface Rhumb extends Curve
+ permits DefaultRhumb
+{
public static final String TYPE = "RHUMB";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Spiral.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Spiral.java
index d5ccc7533f..6f0284d16c 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Spiral.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/Spiral.java
@@ -28,7 +28,9 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Spiral", specification=ISO_19107) // section 7.11.2
-public interface Spiral extends Curve {
+public sealed interface Spiral extends Curve
+ permits Clothoid
+{
@UML(identifier="curvature", specification=ISO_19107) // section 7.11.2.2
RealFunction getCurvature();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/SplineCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/SplineCurve.java
index 77234f67f0..7800f2ac31 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/SplineCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/curve/SplineCurve.java
@@ -25,7 +25,10 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="SplineCurve", specification=ISO_19107) // section 7.13.4
-public interface SplineCurve extends PolynomialCurve {
+public sealed interface SplineCurve extends PolynomialCurve
+ permits PolynomialSpline,
+ BSplineCurve
+{
@UML(identifier="curveForm", specification=ISO_19107) // section 7.13.4.2
SplineCurveForm getCurveForm();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractGeometry.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractGeometry.java
index 34333af122..c2be631961 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractGeometry.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractGeometry.java
@@ -32,7 +32,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public abstract class AbstractGeometry implements Geometry {
+public abstract non-sealed class AbstractGeometry implements Geometry {
private Map<String,Object> properties;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractOrientedGeometry.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractOrientedGeometry.java
index 0b63a35906..ade4bda276 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractOrientedGeometry.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/AbstractOrientedGeometry.java
@@ -27,7 +27,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public abstract class AbstractOrientedGeometry extends AbstractGeometry
implements OrientedGeometry{
+public abstract non-sealed class AbstractOrientedGeometry extends
AbstractGeometry implements OrientedGeometry {
protected final Similarity<?> transform;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/ArrayDataPoints.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/ArrayDataPoints.java
index eb51c4d586..627eb4b45d 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/ArrayDataPoints.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/ArrayDataPoints.java
@@ -164,7 +164,7 @@ public final class ArrayDataPoints implements DataPoints,
AttributesType {
/**
* An indexed point in the point sequence
*/
- public static class Indexed implements Point {
+ public static non-sealed class Indexed implements Point {
private final ArrayDataPoints parent;
private final int index;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByBulge.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByBulge.java
index 904f4ef54a..543edfa4bb 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByBulge.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByBulge.java
@@ -26,7 +26,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultArcByBulge extends AbstractGeometry implements ArcByBulge {
+public non-sealed class DefaultArcByBulge extends AbstractGeometry implements
ArcByBulge {
private final DataPoints points;
private final double bulge;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByCenterPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByCenterPoint.java
index f4cc3c85b8..a4f7d61106 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByCenterPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultArcByCenterPoint.java
@@ -26,7 +26,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultArcByCenterPoint extends AbstractGeometry implements
ArcByCenterPoint {
+public non-sealed class DefaultArcByCenterPoint extends AbstractGeometry
implements ArcByCenterPoint {
private final Point center;
private final double radius;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCircularString.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCircularString.java
index 3d9c38e343..298507c309 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCircularString.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCircularString.java
@@ -25,7 +25,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultCircularString extends AbstractGeometry implements
CircularString {
+public non-sealed class DefaultCircularString extends AbstractGeometry
implements CircularString {
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCompoundCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCompoundCurve.java
index 57f3991380..ea319daec8 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCompoundCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCompoundCurve.java
@@ -30,7 +30,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultCompoundCurve extends AbstractGeometry implements
CompoundCurve {
+public non-sealed class DefaultCompoundCurve extends AbstractGeometry
implements CompoundCurve {
private final Curve[] curves;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCurvePolygon.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCurvePolygon.java
index aae88b2abc..fc3c20fe44 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCurvePolygon.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultCurvePolygon.java
@@ -31,7 +31,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultCurvePolygon extends AbstractGeometry implements
CurvePolygon {
+public non-sealed class DefaultCurvePolygon extends AbstractGeometry
implements CurvePolygon {
protected final Curve exterior;
protected final List<Curve> interiors;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultEmpty.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultEmpty.java
index 5308308ba3..e108576fb8 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultEmpty.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultEmpty.java
@@ -26,7 +26,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultEmpty extends AbstractGeometry implements Empty {
+public non-sealed class DefaultEmpty extends AbstractGeometry implements Empty
{
private final AttributesType attType;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeodesic.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeodesic.java
index 5ac9b1a3cc..57778295ca 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeodesic.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeodesic.java
@@ -25,7 +25,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultGeodesic extends AbstractGeometry implements Geodesic {
+public non-sealed class DefaultGeodesic extends AbstractGeometry implements
Geodesic {
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeometryCollection.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeometryCollection.java
index a4fcb8774d..39459b0c69 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeometryCollection.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultGeometryCollection.java
@@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultGeometryCollection<T extends Geometry> extends
AbstractGeometry implements GeometryCollection<T> {
+public non-sealed class DefaultGeometryCollection<T extends Geometry> extends
AbstractGeometry implements GeometryCollection<T> {
private final T[] geometries;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLineString.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLineString.java
index 1dace6d4f7..026ba6a0dc 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLineString.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLineString.java
@@ -23,7 +23,7 @@ import org.apache.sis.geometries.curve.LineString;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultLineString extends AbstractGeometry implements LineString {
+public non-sealed class DefaultLineString extends AbstractGeometry implements
LineString {
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLinearRing.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLinearRing.java
index dab2846a36..93095e6f95 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLinearRing.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultLinearRing.java
@@ -24,7 +24,7 @@ import org.apache.sis.geometries.curve.LinearRing;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultLinearRing extends DefaultLineString implements LinearRing{
+public non-sealed class DefaultLinearRing extends DefaultLineString implements
LinearRing{
public DefaultLinearRing(DataPoints points) {
super(points);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiCurve.java
index cb9bb397a2..5c63ed658e 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiCurve.java
@@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultMultiCurve<T extends Curve> extends
DefaultGeometryCollection<T> implements MultiCurve<T> {
+public non-sealed class DefaultMultiCurve<T extends Curve> extends
DefaultGeometryCollection<T> implements MultiCurve<T> {
public DefaultMultiCurve(T[] geometries) {
this(null, geometries);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiLineString.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiLineString.java
index 55651990fd..a03c24ebea 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiLineString.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiLineString.java
@@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultMultiLineString extends DefaultMultiCurve<LineString>
implements MultiLineString {
+public non-sealed class DefaultMultiLineString extends
DefaultMultiCurve<LineString> implements MultiLineString {
public DefaultMultiLineString(LineString... geometries) {
super(geometries);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
index f19566cfb4..c7365af3ee 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
@@ -28,7 +28,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultMultiPoint extends AbstractGeometry implements
MultiPoint<Point> {
+public non-sealed class DefaultMultiPoint extends AbstractGeometry implements
MultiPoint<Point> {
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolygon.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolygon.java
index 2751a0d103..9ddb48f97e 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolygon.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolygon.java
@@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultMultiPolygon extends DefaultMultiSurface<Polygon>
implements MultiPolygon {
+public non-sealed class DefaultMultiPolygon extends
DefaultMultiSurface<Polygon> implements MultiPolygon {
public DefaultMultiPolygon(Polygon[] geometries) {
super(geometries);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolyhedron.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolyhedron.java
index f0b008a981..4f141070c8 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolyhedron.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPolyhedron.java
@@ -27,7 +27,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
* @see GML CompositeSolid, MultiSolid
*/
-public class DefaultMultiPolyhedron extends
DefaultGeometryCollection<Polyhedron> implements MultiPolyhedron {
+public non-sealed class DefaultMultiPolyhedron extends
DefaultGeometryCollection<Polyhedron> implements MultiPolyhedron {
public DefaultMultiPolyhedron(Polyhedron... solids) {
this(null, solids);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiSurface.java
index b9659c7936..7cf9c5c9be 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiSurface.java
@@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultMultiSurface<T extends Surface> extends
DefaultGeometryCollection<T> implements MultiSurface<T> {
+public non-sealed class DefaultMultiSurface<T extends Surface> extends
DefaultGeometryCollection<T> implements MultiSurface<T> {
public DefaultMultiSurface(T[] geometries) {
this(null, geometries);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbCurve.java
index 8267e1edb2..60eddad805 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbCurve.java
@@ -37,7 +37,7 @@ import org.apache.sis.maths.Vectors;
*
* @author Johann Sorel (Geomatys)
*/
-public final class DefaultNurbCurve extends AbstractGeometry implements
NurbCurve {
+public non-sealed class DefaultNurbCurve extends AbstractGeometry implements
NurbCurve {
final DataPoints points;
final Array controlPointsArray;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbSurface.java
index 253d1498fa..03caaed6f9 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultNurbSurface.java
@@ -37,13 +37,13 @@ import org.opengis.metadata.Identifier;
*
* @author Johann Sorel (Geomatys)
*/
-public final class DefaultNurbSurface extends AbstractGeometry implements
NurbSurface {
+public non-sealed class DefaultNurbSurface extends AbstractGeometry implements
NurbSurface {
- public final Vector<?>[][] controlPoints;
- public final double[][] weights;
- public final double[] knotsU;
- public final double[] knotsV;
- public final int degree;
+ final Vector<?>[][] controlPoints;
+ final double[][] weights;
+ final double[] knotsU;
+ final double[] knotsV;
+ final int degree;
public DefaultNurbSurface(final Vector<?>[][] controlPoints, final
double[][] weights,
final double[] knotsU, final double[] knotsV, final int degree) {
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPoint.java
index 4f2830f34a..cd4f548d35 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPoint.java
@@ -32,7 +32,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultPoint extends AbstractGeometry implements Point {
+public non-sealed class DefaultPoint extends AbstractGeometry implements Point
{
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolygon.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolygon.java
index f95c8dff6d..e491ac34cb 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolygon.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolygon.java
@@ -31,7 +31,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultPolygon extends AbstractGeometry implements Polygon {
+public non-sealed class DefaultPolygon extends AbstractGeometry implements
Polygon {
protected final LinearRing exterior;
protected final List<LinearRing> interiors;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedralSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedralSurface.java
index 083ff38ea7..d307336018 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedralSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedralSurface.java
@@ -29,7 +29,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
* @see GML Surface patches PolygonPatch CompositeSurface
*/
-public class DefaultPolyhedralSurface<T extends Polygon> extends
AbstractGeometry implements PolyhedralSurface<T> {
+public non-sealed class DefaultPolyhedralSurface<T extends Polygon> extends
AbstractGeometry implements PolyhedralSurface<T> {
private final T[] patches;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedron.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedron.java
index a7a489cc91..2eb69335a8 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedron.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultPolyhedron.java
@@ -35,7 +35,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultPolyhedron extends AbstractGeometry implements Polyhedron {
+public non-sealed class DefaultPolyhedron extends AbstractGeometry implements
Polyhedron {
private final MultiPolygon exterior;
private final List<MultiPolygon> interiors;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRawMultiPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRawMultiPoint.java
index 57b0d38616..18dcbebca0 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRawMultiPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRawMultiPoint.java
@@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultRawMultiPoint extends DefaultGeometryCollection<Point>
implements MultiPoint<Point> {
+public non-sealed class DefaultRawMultiPoint extends
DefaultGeometryCollection<Point> implements MultiPoint<Point> {
public DefaultRawMultiPoint(Point[] geometries) {
this(null, geometries);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedCurve.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedCurve.java
index bcf75c1e16..1506b89952 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedCurve.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedCurve.java
@@ -34,7 +34,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultReversedCurve extends AbstractGeometry implements Curve {
+public non-sealed class DefaultReversedCurve extends AbstractGeometry
implements Curve {
private final Curve base;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedSurface.java
index 6884f499db..6ad59cf4a2 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultReversedSurface.java
@@ -30,7 +30,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultReversedSurface extends AbstractGeometry implements
Surface {
+public non-sealed class DefaultReversedSurface extends AbstractGeometry
implements Surface {
private final Surface base;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRhumb.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRhumb.java
index b99ef01489..948ae7eb93 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRhumb.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultRhumb.java
@@ -26,7 +26,7 @@ import org.opengis.geometry.Envelope;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultRhumb extends AbstractGeometry implements Rhumb {
+public non-sealed class DefaultRhumb extends AbstractGeometry implements Rhumb
{
private final DataPoints points;
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangle.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangle.java
index c0be84017a..257544b97a 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangle.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangle.java
@@ -27,7 +27,7 @@ import org.apache.sis.geometries.surface.Triangle;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultTriangle extends DefaultPolygon implements Triangle {
+public non-sealed class DefaultTriangle extends DefaultPolygon implements
Triangle {
/**
* @param exterior exterior triangle ring
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangulatedSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangulatedSurface.java
index 99c05fdc42..4991032ff5 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangulatedSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultTriangulatedSurface.java
@@ -26,7 +26,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultTriangulatedSurface extends
DefaultPolyhedralSurface<Triangle> implements TIN {
+public non-sealed class DefaultTriangulatedSurface extends
DefaultPolyhedralSurface<Triangle> implements TIN {
public DefaultTriangulatedSurface(Triangle... patches) {
super(null, patches);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/IndexedPoint.java
similarity index 57%
copy from
incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
copy to
incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/IndexedPoint.java
index f19566cfb4..c0bb0773e1 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/DefaultMultiPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/internal/shared/IndexedPoint.java
@@ -19,56 +19,66 @@ package org.apache.sis.geometries.internal.shared;
import org.apache.sis.geometries.AttributesType;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
-import org.apache.sis.geometries.point.MultiPoint;
-import org.opengis.geometry.Envelope;
+import org.apache.sis.maths.Tuple;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
/**
+ * A point viewing a single index of a DataPoints.
+ * All operations are delegated to the parent DataPoints, this class holds no*
coordinate of its own.
+ * The coordinate reference system cannot be modified through this view.
*
* @author Johann Sorel (Geomatys)
*/
-public class DefaultMultiPoint extends AbstractGeometry implements
MultiPoint<Point> {
+public non-sealed class IndexedPoint implements Point {
- private final DataPoints points;
+ private final DataPoints parent;
+ private final int index;
- public DefaultMultiPoint(DataPoints points) {
- this.points = points;
+ public IndexedPoint(DataPoints parent, int index) {
+ this.parent = parent;
+ this.index = index;
}
- @Override
- public CoordinateReferenceSystem getCoordinateReferenceSystem() {
- return points.getCoordinateReferenceSystem();
+ /**
+ * @return index in the parent point sequence.
+ */
+ public int getIndex() {
+ return index;
}
@Override
- public void setCoordinateReferenceSystem(CoordinateReferenceSystem cs)
throws IllegalArgumentException {
- points.setCoordinateReferenceSystem(cs);
+ public boolean isEmpty() {
+ return false;
}
@Override
- public Envelope getEnvelope() {
- return points.getEnvelope();
+ public Tuple getPosition() {
+ return parent.getPosition(index);
}
@Override
- public int getNumGeometries() {
- return points.size();
+ public Tuple getAttribute(String name) {
+ return parent.getAttribute(index, name);
}
@Override
- public Point getGeometryN(int n) {
- return points.getPoint(n);
+ public void setAttribute(String name, Tuple tuple) {
+ parent.setAttribute(index, name, tuple);
}
@Override
- public AttributesType getAttributesType() {
- return points.getAttributesType();
+ public CoordinateReferenceSystem getCoordinateReferenceSystem() {
+ return parent.getCoordinateReferenceSystem();
}
@Override
- public DataPoints asDataPoints() {
- return points;
+ public void setCoordinateReferenceSystem(CoordinateReferenceSystem cs)
throws IllegalArgumentException {
+ throw new UnsupportedOperationException("Not supported.");
}
+ @Override
+ public AttributesType getAttributesType() {
+ return parent.getAttributesType();
+ }
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/mesh/MeshPrimitive.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/mesh/MeshPrimitive.java
index e1607ca28d..1778b8939e 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/mesh/MeshPrimitive.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/mesh/MeshPrimitive.java
@@ -72,7 +72,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public interface MeshPrimitive extends Geometry {
+public sealed interface MeshPrimitive extends Geometry
+ permits MeshPrimitive.Abs
+{
public static final Logger LOGGER =
Logger.getLogger("org.apache.sis.geometries");
@@ -277,7 +279,15 @@ public interface MeshPrimitive extends Geometry {
*/
void removeDuplicatesByPosition();
- public static abstract class Abs implements MeshPrimitive, AttributesType {
+ public static abstract sealed class Abs implements MeshPrimitive,
AttributesType
+ permits Points,
+ Lines,
+ LineLoop,
+ LineStrip,
+ Triangles,
+ TriangleFan,
+ TriangleStrip
+ {
/**
* Checks tuplearray change for position is in the same crs as the
geometry.
@@ -970,7 +980,7 @@ public interface MeshPrimitive extends Geometry {
/**
* A vertex is a indexed point in a geometry.
*/
- public static class Vertex implements Point {
+ public static final class Vertex implements Point {
private final Abs parent;
private long index;
@@ -1112,7 +1122,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class Points extends Abs implements MultiPoint<Point>{
+ public static final class Points extends Abs implements MultiPoint<Point>{
public Points() {
super(Type.POINTS);
}
@@ -1135,7 +1145,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class Lines extends Abs implements MultiLineString {
+ public static final class Lines extends Abs implements MultiLineString {
public Lines() {
super(Type.LINES);
}
@@ -1153,7 +1163,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class LineLoop extends Abs implements LineString {
+ public static final class LineLoop extends Abs implements LineString {
public LineLoop() {
super(Type.LINE_LOOP);
}
@@ -1175,7 +1185,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class LineStrip extends Abs implements LineString {
+ public static final class LineStrip extends Abs implements LineString {
public LineStrip() {
super(Type.LINE_STRIP);
}
@@ -1193,7 +1203,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class Triangles extends Abs implements TIN {
+ public static final class Triangles extends Abs implements TIN {
public Triangles() {
super(Type.TRIANGLES);
}
@@ -1219,7 +1229,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class TriangleFan extends Abs implements TIN {
+ public static final class TriangleFan extends Abs implements TIN {
public TriangleFan() {
super(Type.TRIANGLE_FAN);
}
@@ -1247,7 +1257,7 @@ public interface MeshPrimitive extends Geometry {
}
}
- public static class TriangleStrip extends Abs implements TIN {
+ public static final class TriangleStrip extends Abs implements TIN {
public TriangleStrip() {
super(Type.TRIANGLE_STRIP);
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/simplify/greedyinsert/WTriangle.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/simplify/greedyinsert/WTriangle.java
index d4ee2b81c2..47da8cc8f8 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/simplify/greedyinsert/WTriangle.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/simplify/greedyinsert/WTriangle.java
@@ -25,6 +25,7 @@ import org.apache.sis.geometries.GeometryFactory;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.curve.LinearRing;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.IndexedPoint;
import org.apache.sis.geometries.operation.OperationException;
import org.apache.sis.geometries.surface.Triangle;
import org.apache.sis.maths.Maths;
@@ -37,7 +38,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-final class WTriangle extends AbstractGeometry implements Triangle {
+public final class WTriangle extends AbstractGeometry implements Triangle {
private final LinearRing ring = GeometryFactory.createLinearRing(new
DataPoints() {
@Override
@@ -62,49 +63,12 @@ final class WTriangle extends AbstractGeometry implements
Triangle {
@Override
public Point getPoint(final int index) {
- final DataPoints ps = this;
switch (index) {
case 0 :
case 1 :
case 2 :
case 3 :
- return new Point() {
- @Override
- public Tuple getPosition() {
- return ps.getPosition(index);
- }
-
- @Override
- public Tuple getAttribute(String name) {
- return ps.getAttribute(index, name);
- }
-
- @Override
- public void setAttribute(String name, Tuple tuple) {
- ps.setAttribute(index, name, tuple);
- }
-
- @Override
- public CoordinateReferenceSystem
getCoordinateReferenceSystem() {
- return p0.getCoordinateReferenceSystem();
- }
-
- @Override
- public void
setCoordinateReferenceSystem(CoordinateReferenceSystem cs) throws
IllegalArgumentException {
- throw new UnsupportedOperationException("Not
supported.");
- }
-
- @Override
- public AttributesType getAttributesType() {
- return ps.getAttributesType();
- }
-
- @Override
- public boolean isEmpty() {
- return false;
- }
-
- };
+ return new IndexedPoint(this, index);
default : throw new ArrayIndexOutOfBoundsException();
}
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedEdge.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedEdge.java
index b20b67819e..ba0ea62517 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedEdge.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedEdge.java
@@ -35,7 +35,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-final class OrientedEdge extends AbstractGeometry implements LineString,
DataPoints {
+public final class OrientedEdge extends AbstractGeometry implements
LineString, DataPoints {
/**
* Structure is shared by the two opposite directional edges.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedTriangle.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedTriangle.java
index dd619b3252..c32ba7ea5c 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedTriangle.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/operation/triangulate/delaunay/OrientedTriangle.java
@@ -37,7 +37,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-final class OrientedTriangle extends AbstractGeometry implements Triangle,
DataPoints {
+public final class OrientedTriangle extends AbstractGeometry implements
Triangle, DataPoints {
private final LinearRing ring = GeometryFactory.createLinearRing(this);
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/point/MultiPoint.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/point/MultiPoint.java
index 661f8bcb42..0672976710 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/point/MultiPoint.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/point/MultiPoint.java
@@ -21,6 +21,9 @@ import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.GeometryCollection;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultMultiPoint;
+import org.apache.sis.geometries.internal.shared.DefaultRawMultiPoint;
+import org.apache.sis.geometries.mesh.MeshPrimitive;
import org.apache.sis.maths.Tuple;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -35,7 +38,11 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public interface MultiPoint<T extends Point> extends GeometryCollection<T>{
+public sealed interface MultiPoint<T extends Point> extends
GeometryCollection<T>
+ permits DefaultMultiPoint,
+ DefaultRawMultiPoint,
+ MeshPrimitive.Points
+{
public static final String TYPE = "MULTIPOINT";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/BSolidSpline.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/BSolidSpline.java
index c8f9ae6b00..0d0506d8d9 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/BSolidSpline.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/BSolidSpline.java
@@ -25,6 +25,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="BSolidSpline", specification=ISO_19107) // section 9.3.2
-public interface BSolidSpline extends ParametricCurveSolid {
+public non-sealed interface BSolidSpline extends ParametricCurveSolid {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/MultiPolyhedron.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/MultiPolyhedron.java
index 39bd819820..2b77a2ec7d 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/MultiPolyhedron.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/MultiPolyhedron.java
@@ -17,6 +17,7 @@
package org.apache.sis.geometries.solid;
import org.apache.sis.geometries.GeometryCollection;
+import org.apache.sis.geometries.internal.shared.DefaultMultiPolyhedron;
/**
@@ -27,7 +28,9 @@ import org.apache.sis.geometries.GeometryCollection;
* @author Johann Sorel (Geomatys)
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#multi_polyhedron
*/
-public interface MultiPolyhedron extends GeometryCollection<Polyhedron> {
+public sealed interface MultiPolyhedron extends GeometryCollection<Polyhedron>
+ permits DefaultMultiPolyhedron
+{
public static final String TYPE = "MULTIPOLYHEDRON";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/ParametricCurveSolid.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/ParametricCurveSolid.java
index c3ccc4af66..6440e45875 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/ParametricCurveSolid.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/ParametricCurveSolid.java
@@ -30,7 +30,9 @@ import org.opengis.geometry.DirectPosition;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="ParametricCurveSolid", specification=ISO_19107) // section
9.3.1
-public interface ParametricCurveSolid extends Solid {
+public sealed interface ParametricCurveSolid extends Solid
+ permits BSolidSpline
+{
@UML(identifier="horizontalCurveType", specification=ISO_19107) // section
9.3.1.2
GeometryType getHorizontalCurveType();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Polyhedron.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Polyhedron.java
index 83356cb580..12c5153c94 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Polyhedron.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Polyhedron.java
@@ -19,6 +19,8 @@ package org.apache.sis.geometries.solid;
import java.util.List;
import org.apache.sis.geometries.AttributesType;
import org.apache.sis.geometries.Solid;
+import org.apache.sis.geometries.internal.shared.DefaultPolyhedron;
+import org.apache.sis.geometries.solid.polyhedron.AbstractPolyhedron;
import org.apache.sis.geometries.surface.MultiPolygon;
@@ -36,7 +38,10 @@ import org.apache.sis.geometries.surface.MultiPolygon;
* @author Johann Sorel (Geomatys)
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#polyhedron
*/
-public interface Polyhedron extends Solid {
+public sealed interface Polyhedron extends Solid
+ permits AbstractPolyhedron,
+ DefaultPolyhedron
+{
public static final String TYPE = "POLYHEDRON";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/polyhedron/AbstractPolyhedron.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/polyhedron/AbstractPolyhedron.java
index 875616eda9..0ac8a35f27 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/polyhedron/AbstractPolyhedron.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/polyhedron/AbstractPolyhedron.java
@@ -37,7 +37,15 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*
* @author Johann Sorel (Geomatys)
*/
-public abstract class AbstractPolyhedron extends AbstractGeometry implements
Polyhedron{
+public abstract sealed class AbstractPolyhedron extends AbstractGeometry
implements Polyhedron
+ permits Dodecahedron,
+ Hexahedron,
+ Icosahedron,
+ Octahedron,
+ RhombicTriacontahedron,
+ Tetrahedron,
+ TruncatedIcosahedron
+{
/**
* Golden ratio, used to build the latitude constants of the icosahedral-
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/summary.adoc
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/summary.adoc
index d049590c9d..387feed3b6 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/summary.adoc
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/summary.adoc
@@ -3,6 +3,320 @@
Overview of the geometry types defined in the `org.apache.sis.geometry` module
(package `org.apache.sis.geometries` and its sub-packages).
+== Interface hierarchy
+
+The 56 interfaces of the `Geometry` hierarchy are shown below, split by theme.
+`Geometry` and most of its subtypes are `sealed`, so their permitted subtypes
are fixed
+at compile time and a `switch` over them can be exhaustive.
+Implementation classes are omitted; see the `internal.shared` package.
+
+Colours: white is a `sealed` type; *yellow* is `non-sealed`, still open for
extension
+because it has no implementation yet; *blue-grey* is a type detailed in
another diagram
+here, repeated only to anchor it; *grey* is a type declared outside this
module.
+
+=== Core types
+
+The spine of the hierarchy. `Geometry` splits into a single `Primitive`, a
`GeometryCollection` of geometries, an analytic `OrientedGeometry`, the `Empty`
set, an extruded `Prism` and a GPU-oriented `MeshPrimitive` batch. Each leaf
below is detailed in one of the following diagrams.
+
+[plantuml,geometry-core,svg]
+....
+@startuml
+hide empty members
+skinparam shadowing false
+skinparam interface {
+ BackgroundColor #FDFDFD
+ BorderColor #4A6785
+}
+skinparam interface<<open>> {
+ BackgroundColor #FFF6E0
+ BorderColor #C9A227
+}
+skinparam interface<<context>> {
+ BackgroundColor #EEF3F8
+ BorderColor #93A9C0
+}
+skinparam interface<<external>> {
+ BackgroundColor #F0F0F0
+ BorderColor #999999
+}
+
+interface Curve
+interface Empty
+interface Geometry
+interface "GeometryCollection<T extends Geometry>" as GeometryCollection
+interface MeshPrimitive
+interface Orientable
+interface OrientedGeometry
+interface Point
+interface Primitive
+interface Prism <<open>>
+interface Solid
+interface Surface
+
+Geometry <|-- Empty
+Geometry <|-- GeometryCollection
+Geometry <|-- MeshPrimitive
+Geometry <|-- OrientedGeometry
+Geometry <|-- Primitive
+Geometry <|-- Prism
+Orientable <|-- Curve
+Orientable <|-- Surface
+Primitive <|-- Orientable
+Primitive <|-- Point
+Primitive <|-- Solid
+@enduml
+....
+
+=== Curves
+
+Subtypes of `Curve` that interpolate a stored sequence of points, plus the
conic family.
+
+[plantuml,geometry-curves,svg]
+....
+@startuml
+hide empty members
+skinparam shadowing false
+skinparam interface {
+ BackgroundColor #FDFDFD
+ BorderColor #4A6785
+}
+skinparam interface<<open>> {
+ BackgroundColor #FFF6E0
+ BorderColor #C9A227
+}
+skinparam interface<<context>> {
+ BackgroundColor #EEF3F8
+ BorderColor #93A9C0
+}
+skinparam interface<<external>> {
+ BackgroundColor #F0F0F0
+ BorderColor #999999
+}
+
+interface Arc
+interface ArcByBulge
+interface ArcByCenterPoint
+interface Circle <<open>>
+interface CircularString
+interface Clothoid <<open>>
+interface CompoundCurve
+interface Conic
+interface Curve <<context>>
+interface EllipticArc <<open>>
+interface Geodesic
+interface LineString
+interface LinearRing
+interface OffsetCurve <<open>>
+interface Rhumb
+interface Spiral
+
+Arc <|-- Circle
+Conic <|-- Arc
+Conic <|-- EllipticArc
+Curve <|-- ArcByBulge
+Curve <|-- ArcByCenterPoint
+Curve <|-- CircularString
+Curve <|-- CompoundCurve
+Curve <|-- Conic
+Curve <|-- Geodesic
+Curve <|-- LineString
+Curve <|-- OffsetCurve
+Curve <|-- Rhumb
+Curve <|-- Spiral
+LineString <|-- LinearRing
+Spiral <|-- Clothoid
+@enduml
+....
+
+=== Spline and function curves
+
+Subtypes of `Curve` defined by a mathematical function rather than by
interpolation.
+
+[plantuml,geometry-splines,svg]
+....
+@startuml
+hide empty members
+skinparam shadowing false
+skinparam interface {
+ BackgroundColor #FDFDFD
+ BorderColor #4A6785
+}
+skinparam interface<<open>> {
+ BackgroundColor #FFF6E0
+ BorderColor #C9A227
+}
+skinparam interface<<context>> {
+ BackgroundColor #EEF3F8
+ BorderColor #93A9C0
+}
+skinparam interface<<external>> {
+ BackgroundColor #F0F0F0
+ BorderColor #999999
+}
+
+interface BSplineCurve
+interface Bezier <<open>>
+interface CubicSpline <<open>>
+interface Curve <<context>>
+interface "FunctionCurve<T extends FunctionArc>" as FunctionCurve
+interface NurbCurve
+interface "PolynomialCurve<PolynomialArc>" as PolynomialCurve
+interface PolynomialSpline
+interface SplineCurve
+
+BSplineCurve <|-- Bezier
+BSplineCurve <|-- NurbCurve
+Curve <|-- FunctionCurve
+FunctionCurve <|-- PolynomialCurve
+PolynomialCurve <|-- SplineCurve
+PolynomialSpline <|-- Bezier
+PolynomialSpline <|-- CubicSpline
+SplineCurve <|-- BSplineCurve
+SplineCurve <|-- PolynomialSpline
+@enduml
+....
+
+=== Surfaces
+
+Subtypes of `Surface`: polygonal, patch-based and parametric.
+
+[plantuml,geometry-surfaces,svg]
+....
+@startuml
+hide empty members
+skinparam shadowing false
+skinparam interface {
+ BackgroundColor #FDFDFD
+ BorderColor #4A6785
+}
+skinparam interface<<open>> {
+ BackgroundColor #FFF6E0
+ BorderColor #C9A227
+}
+skinparam interface<<context>> {
+ BackgroundColor #EEF3F8
+ BorderColor #93A9C0
+}
+skinparam interface<<external>> {
+ BackgroundColor #F0F0F0
+ BorderColor #999999
+}
+
+interface BSplineSurface
+interface BilinearGrid <<open>>
+interface CurvePolygon
+interface NurbSurface
+interface ParametricCurveSurface
+interface Polygon
+interface "PolyhedralSurface<T extends Polygon>" as PolyhedralSurface
+interface PreparedTIN
+interface Surface <<context>>
+interface TIN
+interface Triangle
+interface "TriangulatedSurface<T extends Polygon>" as TriangulatedSurface
+
+interface ReferenceSystem <<external>>
+
+BSplineSurface <|-- NurbSurface
+ParametricCurveSurface <|-- BSplineSurface
+ParametricCurveSurface <|-- BilinearGrid
+Polygon <|-- Triangle
+PolyhedralSurface <|-- TriangulatedSurface
+ReferenceSystem <|-- ParametricCurveSurface
+Surface <|-- CurvePolygon
+Surface <|-- ParametricCurveSurface
+Surface <|-- Polygon
+Surface <|-- PolyhedralSurface
+TIN <|-- PreparedTIN
+TriangulatedSurface <|-- TIN : Triangle
+@enduml
+....
+
+=== Solids
+
+Subtypes of `Solid`.
+
+[plantuml,geometry-solids,svg]
+....
+@startuml
+hide empty members
+skinparam shadowing false
+skinparam interface {
+ BackgroundColor #FDFDFD
+ BorderColor #4A6785
+}
+skinparam interface<<open>> {
+ BackgroundColor #FFF6E0
+ BorderColor #C9A227
+}
+skinparam interface<<context>> {
+ BackgroundColor #EEF3F8
+ BorderColor #93A9C0
+}
+skinparam interface<<external>> {
+ BackgroundColor #F0F0F0
+ BorderColor #999999
+}
+
+interface BSolidSpline <<open>>
+interface ParametricCurveSolid
+interface Polyhedron
+interface Solid <<context>>
+
+ParametricCurveSolid <|-- BSolidSpline
+Solid <|-- ParametricCurveSolid
+Solid <|-- Polyhedron
+@enduml
+....
+
+=== Collections
+
+Subtypes of `GeometryCollection`, each restricting its elements to one
geometry kind. `ProductCurve` appears here because it is both a collection and
a `Curve`.
+
+[plantuml,geometry-collections,svg]
+....
+@startuml
+hide empty members
+skinparam shadowing false
+skinparam interface {
+ BackgroundColor #FDFDFD
+ BorderColor #4A6785
+}
+skinparam interface<<open>> {
+ BackgroundColor #FFF6E0
+ BorderColor #C9A227
+}
+skinparam interface<<context>> {
+ BackgroundColor #EEF3F8
+ BorderColor #93A9C0
+}
+skinparam interface<<external>> {
+ BackgroundColor #F0F0F0
+ BorderColor #999999
+}
+
+interface Curve <<context>>
+interface "GeometryCollection<T extends Geometry>" as GeometryCollection
<<context>>
+interface "MultiCurve<T extends Curve>" as MultiCurve
+interface MultiLineString
+interface "MultiPoint<T extends Point>" as MultiPoint
+interface MultiPolygon
+interface MultiPolyhedron
+interface "MultiSurface<T extends Surface>" as MultiSurface
+interface ProductCurve <<open>>
+
+Curve <|-- ProductCurve
+GeometryCollection <|-- MultiCurve
+GeometryCollection <|-- MultiPoint
+GeometryCollection <|-- MultiPolyhedron : Polyhedron
+GeometryCollection <|-- MultiSurface
+GeometryCollection <|-- ProductCurve : Curve
+MultiCurve <|-- MultiLineString : LineString
+MultiSurface <|-- MultiPolygon : Polygon
+@enduml
+....
+== Format mapping
+
[cols="2,3,2,2,2,2,2,6", options="header"]
|===
|Type |Package |OGC-SimpleFeature |GeoJSON |OGC-JSON-FG |Khronos-glTF
|Khronos-ANARI |Description
@@ -84,7 +398,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Curves*
|LineString
-|—
+|`curve`
|LineString
|LineString
|LineString
@@ -93,7 +407,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Curve with linear interpolation between consecutive points.
|LinearRing
-|—
+|`curve`
|LinearRing
|—
|—
@@ -102,7 +416,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`LineString` that is both closed and simple.
|CompoundCurve
-|—
+|`curve`
|—
|—
|CompoundCurve
@@ -111,7 +425,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Curve made of several connected curve segments, possibly of different
subtypes.
|OffsetCurve
-|—
+|`curve`
|—
|—
|—
@@ -120,7 +434,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Curve derived from a base curve by applying a lateral offset distance.
|ProductCurve
-|—
+|`curve`
|—
|—
|—
@@ -138,7 +452,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Semi-infinite line defined by an origin point and a direction.
|Rhumb
-|—
+|`curve`
|—
|—
|—
@@ -156,7 +470,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|ISO 19107 bearing/direction primitive.
|Geodesic
-|`geodesics`
+|`curve`
|—
|—
|—
@@ -168,7 +482,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Surfaces*
|Polygon
-|—
+|`surface`
|Polygon
|Polygon
|Polygon
@@ -177,7 +491,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Planar surface defined by one exterior boundary and zero or more interior
boundaries (holes).
|CurvePolygon
-|—
+|`surface`
|—
|—
|CurvePolygon
@@ -186,7 +500,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Surface whose rings may be line strings, circular strings or compound curves.
|PolyhedralSurface
-|—
+|`surface`
|PolyhedralSurface
|—
|—
@@ -195,7 +509,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Contiguous collection of polygon patches sharing common boundary segments.
|TriangulatedSurface
-|—
+|`surface`
|—
|—
|—
@@ -204,7 +518,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`PolyhedralSurface` restricted to triangle patches.
|TIN
-|—
+|`surface`
|TIN
|—
|—
@@ -213,7 +527,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Triangulated Irregular Network, a `PolyhedralSurface` made only of `Triangle`
patches.
|PreparedTIN
-|—
+|`surface`
|—
|—
|—
@@ -222,7 +536,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`TIN` decorated with an optimized spatial index for fast queries.
|Triangle
-|—
+|`surface`
|Triangle
|—
|—
@@ -231,7 +545,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Polygon with exactly 3 distinct, non-collinear vertices and no interior
boundary.
|ParametricCurveSurface
-|—
+|`surface`
|—
|—
|—
@@ -240,7 +554,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Surface defined by a parametric function together with its own coordinate
system.
|BilinearGrid
-|—
+|`surface`
|—
|—
|—
@@ -261,7 +575,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Solids*
|Polyhedron
-|—
+|`solid`
|—
|—
|Polyhedron
@@ -270,7 +584,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Solid whose bounding shells are each expressed as a multi-polygon.
|ParametricCurveSolid
-|`griddedsolid`
+|`solid`
|—
|—
|—
@@ -279,7 +593,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Solid defined by a parametric function.
|BSolidSpline
-|`griddedsolid`
+|`solid`
|—
|—
|—
@@ -309,7 +623,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Base type for named analytic shapes carrying their own rotation and
translation.
|Cylinder
-|—
+|`solid`
|—
|—
|—
@@ -318,7 +632,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Oriented geometry describing a tube shape with a radius and a height.
|Sphere
-|—
+|`solid`
|—
|—
|—
@@ -327,7 +641,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Parametric surface made of the set of points equidistant from a center.
|Frustrum
-|—
+|`solid`
|—
|—
|—
@@ -336,7 +650,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Oriented geometry describing a cone or pyramid with its top cut off.
|Capsule
-|—
+|`solid`
|—
|—
|—
@@ -353,6 +667,15 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|quad
|Oriented geometry describing a flat surface.
+|HyperPlane
+|—
+|—
+|—
+|—
+|—
+|—
+|Oriented geometry dividing the coordinate space in two half-spaces.
+
|BBox
|—
|—
@@ -384,7 +707,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Collection of an arbitrary number of geometric objects sharing the same
spatial reference system.
|MultiPoint
-|—
+|`point`
|MultiPoint
|MultiPoint
|MultiPoint
@@ -393,7 +716,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|0-dimensional `GeometryCollection` whose elements are restricted to `Point`.
|MultiCurve
-|—
+|`curve`
|MultiCurve
|—
|MultiCurve
@@ -402,7 +725,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|1-dimensional `GeometryCollection` whose elements are `Curve`.
|MultiLineString
-|—
+|`curve`
|MultiLineString
|MultiLineString
|MultiLineString
@@ -411,7 +734,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`MultiCurve` whose elements are `LineString`.
|MultiSurface
-|—
+|`surface`
|MultiSurface
|—
|MultiSurface
@@ -420,7 +743,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|2-dimensional `GeometryCollection` whose elements are `Surface`.
|MultiPolygon
-|—
+|`surface`
|MultiPolygon
|MultiPolygon
|MultiPolygon
@@ -429,7 +752,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`MultiSurface` whose elements are `Polygon`.
|MultiPolyhedron
-|—
+|`solid`
|—
|—
|MultiPolyhedron
@@ -462,7 +785,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Regular polyhedra*
|Tetrahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -471,7 +794,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Platonic solid with 4 triangular faces.
|Hexahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -480,7 +803,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Platonic solid with 6 square faces (cube).
|Octahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -489,7 +812,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Platonic solid with 8 triangular faces.
|Dodecahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -498,7 +821,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Platonic solid with 12 pentagonal faces.
|Icosahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -507,7 +830,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Platonic solid with 20 triangular faces.
|RhombicTriacontahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -516,7 +839,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Catalan solid with 30 rhombic faces.
|TruncatedIcosahedron
-|`polyhedron`
+|`solid.polyhedron`
|—
|—
|—
@@ -528,7 +851,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Conics*
|Conic
-|`conics`
+|`curve`
|—
|—
|—
@@ -537,7 +860,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Curve defined by a conic section.
|Arc
-|`conics`
+|`curve`
|—
|—
|—
@@ -546,7 +869,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Arc segment of a `Conic`.
|Circle
-|`conics`
+|`curve`
|—
|—
|—
@@ -555,7 +878,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Circular arc, or full circle when start and end angles coincide.
|CircularString
-|`conics`
+|`curve`
|—
|—
|CircularString
@@ -563,8 +886,26 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|—
|Curve interpolated using a sequence of circular arcs.
+|ArcByBulge
+|`curve`
+|—
+|—
+|—
+|—
+|—
+|Single circular arc given by its two end points and how far it bulges away
from their chord.
+
+|ArcByCenterPoint
+|`curve`
+|—
+|—
+|—
+|—
+|—
+|Single circular arc given by the centre and radius of its circle and its
start/end bearings.
+
|ConicArc
-|`conics`
+|`curve`
|—
|—
|—
@@ -573,7 +914,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Arc segment of a general conic curve.
|Ellipse
-|`conics`
+|`curve`
|—
|—
|—
@@ -582,7 +923,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Elliptical conic curve.
|EllipticArc
-|`conics`
+|`curve`
|—
|—
|—
@@ -594,7 +935,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Splines*
|SplineCurve
-|`splines`
+|`curve`
|—
|—
|—
@@ -603,7 +944,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`PolynomialCurve` represented by a piecewise polynomial spline.
|PolynomialSpline
-|`splines`
+|`curve`
|—
|—
|—
@@ -612,7 +953,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`SplineCurve` whose arcs are plain polynomial segments.
|CubicSpline
-|`splines`
+|`curve`
|—
|—
|—
@@ -621,7 +962,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`PolynomialSpline` of degree 3.
|BSplineCurve
-|`splines`
+|`curve`
|—
|—
|—
@@ -629,8 +970,8 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|—
|`SplineCurve` represented by a basis-spline (B-spline).
-|NURB
-|`splines`
+|NurbCurve
+|`curve`
|—
|—
|—
@@ -639,7 +980,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Non-Uniform Rational B-Spline curve.
|Bezier
-|`splines`
+|`curve`
|—
|—
|—
@@ -648,7 +989,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Spline curve defined by Bezier control points.
|BSplineSurface
-|`splines`
+|`surface`
|—
|—
|—
@@ -656,11 +997,20 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|—
|`ParametricCurveSurface` represented by a basis-spline (B-spline).
+|NurbSurface
+|`surface`
+|—
+|—
+|—
+|—
+|—
+|Non-Uniform Rational B-Spline surface.
+
// --- Polynomial / function curves ---------------------------------------
8+| *Polynomial / function curves*
|FunctionArc
-|`polynomials`
+|`curve`
|—
|—
|—
@@ -669,7 +1019,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Arc segment defined by a mathematical function.
|FunctionCurve
-|`polynomials`
+|`curve`
|—
|—
|—
@@ -678,7 +1028,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Curve made of a sequence of `FunctionArc` segments.
|PolynomialArc
-|`polynomials`
+|`curve`
|—
|—
|—
@@ -687,7 +1037,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|`FunctionArc` whose function is a polynomial.
|PolynomialCurve
-|`polynomials`
+|`curve`
|—
|—
|—
@@ -699,7 +1049,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
8+| *Spirals*
|Spiral
-|`spirals`
+|`curve`
|—
|—
|—
@@ -708,7 +1058,7 @@ Overview of the geometry types defined in the
`org.apache.sis.geometry` module
|Curve whose curvature varies continuously along its length.
|Clothoid
-|`spirals`
+|`curve`
|—
|—
|—
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BSplineSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BSplineSurface.java
index bef96530e0..03a5569419 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BSplineSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BSplineSurface.java
@@ -29,7 +29,9 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="BSplineSurface", specification=ISO_19107) // section 8.7.2
-public interface BSplineSurface extends ParametricCurveSurface {
+public sealed interface BSplineSurface extends ParametricCurveSurface
+ permits NurbSurface
+{
@UML(identifier="degree", specification=ISO_19107) // section 8.7.2.2
int getDegree();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BilinearGrid.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BilinearGrid.java
index 0df805cbbf..ab7a17301f 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BilinearGrid.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/BilinearGrid.java
@@ -25,6 +25,6 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="BilinearGrid", specification=ISO_19107) // section 8.3.4
-public interface BilinearGrid extends ParametricCurveSurface{
+public non-sealed interface BilinearGrid extends ParametricCurveSurface {
}
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/CurvePolygon.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/CurvePolygon.java
index bc3e2eac2c..b58289be0c 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/CurvePolygon.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/CurvePolygon.java
@@ -21,6 +21,7 @@ import org.apache.sis.geometries.AttributesType;
import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.Surface;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultCurvePolygon;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
import org.opengis.geometry.coordinate.GriddedSurface;
@@ -39,7 +40,9 @@ import org.opengis.geometry.coordinate.GriddedSurface;
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#curve_polygon
*/
@UML(identifier="Polygon", specification=ISO_19107) // section 8.1.2
-public interface CurvePolygon extends Surface {
+public sealed interface CurvePolygon extends Surface
+ permits DefaultCurvePolygon
+{
public static final String TYPE = "CURVEPOLYGON";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiPolygon.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiPolygon.java
index e690fb410b..7133f767ca 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiPolygon.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiPolygon.java
@@ -17,6 +17,7 @@
package org.apache.sis.geometries.surface;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultMultiPolygon;
/**
@@ -34,7 +35,9 @@ import
org.apache.sis.geometries.internal.shared.AbstractGeometry;
*
* @author Johann Sorel (Geomatys)
*/
-public interface MultiPolygon extends MultiSurface<Polygon> {
+public sealed interface MultiPolygon extends MultiSurface<Polygon>
+ permits DefaultMultiPolygon
+{
public static final String TYPE = "MULTIPOLYGON";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiSurface.java
index dbcc60ba12..11b4dbcec9 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/MultiSurface.java
@@ -19,6 +19,7 @@ package org.apache.sis.geometries.surface;
import org.apache.sis.geometries.GeometryCollection;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.Surface;
+import org.apache.sis.geometries.internal.shared.DefaultMultiSurface;
/**
@@ -38,7 +39,10 @@ import org.apache.sis.geometries.Surface;
* @author Johann Sorel (Geomatys)
* @see https://docs.ogc.org/DRAFTS/21-045r1.html#multi_surface
*/
-public interface MultiSurface<T extends Surface> extends GeometryCollection<T>{
+public sealed interface MultiSurface<T extends Surface> extends
GeometryCollection<T>
+ permits MultiPolygon,
+ DefaultMultiSurface
+{
public static final String TYPE = "MULTISURFACE";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/NurbSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/NurbSurface.java
index ab439e94ba..cb9c681ff9 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/NurbSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/NurbSurface.java
@@ -16,13 +16,17 @@
*/
package org.apache.sis.geometries.surface;
+import org.apache.sis.geometries.internal.shared.DefaultNurbSurface;
+
/**
* TODO : missing in ISO:19107 ? need to recheck this one.
*
*
* @author Johann Sorel (Geomatys)
*/
-public interface NurbSurface extends BSplineSurface {
+public sealed interface NurbSurface extends BSplineSurface
+ permits DefaultNurbSurface
+{
public static final String TYPE = "NURBSSURFACE";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/ParametricCurveSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/ParametricCurveSurface.java
index 2afecf0ed3..ec48f336a2 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/ParametricCurveSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/ParametricCurveSurface.java
@@ -21,6 +21,7 @@ import org.apache.sis.geometries.Curve;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.GeometryType;
import org.apache.sis.geometries.Surface;
+import org.apache.sis.geometries.solid.Sphere;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
import org.opengis.geometry.DirectPosition;
@@ -32,7 +33,11 @@ import org.opengis.referencing.ReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="ParametricCurveSurface", specification=ISO_19107) // section
8.3.2
-public interface ParametricCurveSurface extends Surface, ReferenceSystem {
+public sealed interface ParametricCurveSurface extends Surface, ReferenceSystem
+ permits BilinearGrid,
+ BSplineSurface,
+ Sphere
+{
@UML(identifier="rows", specification=ISO_19107) // section 8.3.2.3
int getRows();
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Polygon.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Polygon.java
index 98cf9d21dc..d45b3bd653 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Polygon.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Polygon.java
@@ -21,6 +21,7 @@ import org.apache.sis.geometries.AttributesType;
import org.apache.sis.geometries.Surface;
import org.apache.sis.geometries.curve.LinearRing;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultPolygon;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -46,7 +47,10 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Polygon", specification=ISO_19107) // section 8.1.2
-public interface Polygon extends Surface {
+public sealed interface Polygon extends Surface
+ permits Triangle,
+ DefaultPolygon
+{
public static final String TYPE = "POLYGON";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PolyhedralSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PolyhedralSurface.java
index 1e6e8313b0..68b8b262d6 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PolyhedralSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PolyhedralSurface.java
@@ -20,6 +20,7 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.apache.sis.geometries.Surface;
+import org.apache.sis.geometries.internal.shared.DefaultPolyhedralSurface;
import static org.opengis.annotation.Specification.ISO_19107;
import org.opengis.annotation.UML;
@@ -47,7 +48,10 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="PolyhedralSurface", specification=ISO_19107) // section 8.1.4
TODO extends geometry collection is ISO 19107
-public interface PolyhedralSurface<T extends Polygon> extends
/*GeometryCollection<org.apache.sis.geometries.Polygon>,*/ Surface {
+public sealed interface PolyhedralSurface<T extends Polygon> extends
/*GeometryCollection<org.apache.sis.geometries.Polygon>,*/ Surface
+ permits TriangulatedSurface,
+ DefaultPolyhedralSurface
+{
public static final String TYPE = "POLYHEDRALSURFACE";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PreparedTIN.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PreparedTIN.java
index 2cd7ffcfe5..208a0fc361 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PreparedTIN.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/PreparedTIN.java
@@ -48,7 +48,10 @@ import org.opengis.util.FactoryException;
*
* @author Johann Sorel (Geomatys)
*/
-public interface PreparedTIN extends TIN {
+public sealed interface PreparedTIN extends TIN
+ permits PreparedTIN.Single,
+ PreparedTIN.Multi
+{
/**
* Triangles intersecting given area.
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TIN.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TIN.java
index 739d067b99..d45eeba935 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TIN.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TIN.java
@@ -18,6 +18,8 @@ package org.apache.sis.geometries.surface;
import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultTriangulatedSurface;
+import org.apache.sis.geometries.mesh.MeshPrimitive;
import org.apache.sis.maths.Tuple;
@@ -26,7 +28,13 @@ import org.apache.sis.maths.Tuple;
*
* @author Johann Sorel (Geomatys)
*/
-public interface TIN extends TriangulatedSurface<Triangle> {
+public sealed interface TIN extends TriangulatedSurface<Triangle>
+ permits PreparedTIN,
+ DefaultTriangulatedSurface,
+ MeshPrimitive.Triangles,
+ MeshPrimitive.TriangleFan,
+ MeshPrimitive.TriangleStrip
+{
public static final String TYPE = "TIN";
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Triangle.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Triangle.java
index 5935e83e44..5716a45f3d 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Triangle.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/Triangle.java
@@ -24,6 +24,9 @@ import org.apache.sis.geometries.DataPoints;
import org.apache.sis.geometries.Point;
import org.apache.sis.geometries.curve.LinearRing;
import org.apache.sis.geometries.internal.shared.AbstractGeometry;
+import org.apache.sis.geometries.internal.shared.DefaultTriangle;
+import org.apache.sis.geometries.operation.simplify.greedyinsert.WTriangle;
+import
org.apache.sis.geometries.operation.triangulate.delaunay.OrientedTriangle;
import org.apache.sis.maths.Maths;
import org.apache.sis.maths.Tuple;
import org.apache.sis.maths.Vector;
@@ -44,7 +47,11 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="Triangle", specification=ISO_19107) // section 8.1.6
-public interface Triangle extends Polygon {
+public sealed interface Triangle extends Polygon
+ permits DefaultTriangle,
+ WTriangle,
+ OrientedTriangle
+{
@Override
default String getGeometryType() {
diff --git
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TriangulatedSurface.java
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TriangulatedSurface.java
index 0deb733747..06385e0a1f 100644
---
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TriangulatedSurface.java
+++
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/surface/TriangulatedSurface.java
@@ -25,6 +25,8 @@ import org.opengis.annotation.UML;
* @author Johann Sorel (Geomatys)
*/
@UML(identifier="TriangulatedSurface", specification=ISO_19107) // section
8.1.8
-public interface TriangulatedSurface<T extends Polygon> extends
PolyhedralSurface<T> {
+public sealed interface TriangulatedSurface<T extends Polygon> extends
PolyhedralSurface<T>
+ permits TIN
+{
}