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

commit c7586d2d8aa933ec28efc43c791300e39782d787
Author: jsorel <[email protected]>
AuthorDate: Mon Sep 7 16:22:39 2026 +0200

    feat(Geometry): replace knot object list by flat double[] array
---
 .../main/org/apache/sis/geometries/Curve.java      |  2 +-
 .../main/org/apache/sis/geometries/Knot.java       | 34 ----------------------
 .../main/org/apache/sis/geometries/Solid.java      |  2 +-
 .../main/org/apache/sis/geometries/Surface.java    |  2 +-
 .../apache/sis/geometries/curve/SplineCurve.java   |  4 +--
 .../internal/shared/DefaultPolyhedron.java         |  3 +-
 .../org/apache/sis/geometries/package-info.java    |  6 +++-
 .../org/apache/sis/geometries/solid/Sphere.java    |  3 +-
 .../sis/geometries/surface/BSplineSurface.java     |  4 +--
 .../geometries/surface/ParametricCurveSurface.java |  3 +-
 10 files changed, 13 insertions(+), 50 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 832a0a918f..0e5ab4885a 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
@@ -116,7 +116,7 @@ public interface Curve extends Orientable {
 
 
     @UML(identifier="knot", specification=ISO_19107) // section 6.4.18.4
-    default List<Knot> getKnots() {
+    default double[] getKnots() {
         //TODO
         throw new UnsupportedOperationException();
     }
diff --git 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Knot.java
 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Knot.java
deleted file mode 100644
index 4044b66a5f..0000000000
--- 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Knot.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.geometries;
-
-import static org.opengis.annotation.Specification.ISO_19107;
-import org.opengis.annotation.UML;
-
-
-/**
- *
- * @author Johann Sorel (Geomatys)
- */
-@UML(identifier="Knot", specification=ISO_19107) // section 6.4.17
-public class Knot {
-
-    @UML(identifier="value", specification=ISO_19107) // section 6.4.17.2
-    public double[] value;
-    @UML(identifier="multiplicity", specification=ISO_19107) // section 
6.4.17.3
-    public int[] multiplicity;
-}
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 2dddda6053..4b54cfdf00 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
@@ -70,7 +70,7 @@ public interface Solid extends Primitive {
     }
 
     @UML(identifier="knot", specification=ISO_19107) // section 6.4.28.8
-    default List<Knot> getKnots() {
+    default double[] getKnots() {
         throw new UnsupportedOperationException();
     }
 
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 74e501b7c2..eb50d39ed9 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
@@ -128,7 +128,7 @@ public interface Surface extends Orientable {
     }
 
     @UML(identifier="knot", specification=ISO_19107) // section 6.4.25.10
-    default List<Knot> getKnots() {
+    default double[] getKnots() {
         //TODO
         throw new UnsupportedOperationException();
     }
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 7704f533fa..77234f67f0 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
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.geometries.curve;
 
-import java.util.List;
-import org.apache.sis.geometries.Knot;
 import static org.opengis.annotation.Specification.ISO_19107;
 import org.opengis.annotation.UML;
 
@@ -34,7 +32,7 @@ public interface SplineCurve extends PolynomialCurve {
 
     @UML(identifier="knot", specification=ISO_19107) // section 7.13.4.3
     @Override
-    List<Knot> getKnots();
+    double[] getKnots();
 
     @UML(identifier="degree", specification=ISO_19107) // section 7.13.4.4
     @Override
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 19ffda3b23..a7a489cc91 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
@@ -22,7 +22,6 @@ import java.util.Objects;
 import javax.measure.quantity.Area;
 import javax.measure.quantity.Volume;
 import org.apache.sis.geometries.Geometry;
-import org.apache.sis.geometries.Knot;
 import org.apache.sis.geometries.SolidInterpolation;
 import org.apache.sis.geometries.solid.Polyhedron;
 import org.apache.sis.geometries.surface.MultiPolygon;
@@ -131,7 +130,7 @@ public class DefaultPolyhedron extends AbstractGeometry 
implements Polyhedron {
     }
 
     @Override
-    public List<Knot> getKnots() {
+    public double[] getKnots() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 }
diff --git 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/package-info.java
 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/package-info.java
index a280910e93..67cbe5c327 100644
--- 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/package-info.java
+++ 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/package-info.java
@@ -45,9 +45,13 @@
  *   <li>Encoding interface is fused in Geometry interface</li>
  *   <li>Encoding.asGML has been removed since it is a large task to implement 
and multiple versions
  *       exists. GML support should be located in a different module</li>
+ *   <li>Knot pdf sections 6.4.17.2 and 6.4.17.3 : two notations exist :
+ *     one using a repetition of values in a single knot list,
+ *     and a second using 2 lists, one for distinct values and one for 
multiplicity.
+ *     SIS makes use of the first one, which is the most used in online 
references.
+ *   </li>
  * </ul>
  *
- *
  * <h2>Remaining work to be done</h2>
  *
  * <h3>TODO : ISO 19107 CRS</h3>
diff --git 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Sphere.java
 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Sphere.java
index 2e00e0c927..cc9aa65f9f 100644
--- 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Sphere.java
+++ 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/solid/Sphere.java
@@ -22,7 +22,6 @@ import org.apache.sis.geometries.BBox;
 import org.apache.sis.geometries.Curve;
 import org.apache.sis.geometries.Geometries;
 import org.apache.sis.geometries.GeometryType;
-import org.apache.sis.geometries.Knot;
 import org.apache.sis.geometries.internal.shared.AbstractGeometry;
 import org.apache.sis.geometries.surface.ParametricCurveSurface;
 import org.apache.sis.maths.Tuple;
@@ -189,7 +188,7 @@ public final class Sphere extends AbstractGeometry 
implements ParametricCurveSur
     }
 
     @Override
-    public List<Knot> getKnots() {
+    public double[] getKnots() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
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 3af033f45c..c612ca8d62 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
@@ -16,9 +16,7 @@
  */
 package org.apache.sis.geometries.surface;
 
-import java.util.List;
 import org.apache.sis.geometries.GeometryType;
-import org.apache.sis.geometries.Knot;
 import org.apache.sis.geometries.curve.KnotType;
 import static org.opengis.annotation.Specification.ISO_19107;
 import org.opengis.annotation.UML;
@@ -36,7 +34,7 @@ public interface BSplineSurface extends 
ParametricCurveSurface {
 
     @UML(identifier="knot", specification=ISO_19107) // section 8.7.2.3
     @Override
-    public List<Knot> getKnots();
+    double[] getKnots();
 
     @UML(identifier="knotSpec", specification=ISO_19107) // section 8.7.2.5
     KnotType getKnotSpec();
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 0b1d8695e1..d4a6b4bd6e 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
@@ -19,7 +19,6 @@ package org.apache.sis.geometries.surface;
 import java.util.List;
 import org.apache.sis.geometries.Curve;
 import org.apache.sis.geometries.GeometryType;
-import org.apache.sis.geometries.Knot;
 import org.apache.sis.geometries.Surface;
 import static org.opengis.annotation.Specification.ISO_19107;
 import org.opengis.annotation.UML;
@@ -55,7 +54,7 @@ public interface ParametricCurveSurface extends Surface, 
ReferenceSystem {
     GeometryType getVerticalCurveType();
 
     @Override
-    List<Knot> getKnots();
+    double[] getKnots();
 
     @UML(identifier="horizontalCurve", specification=ISO_19107) // section 
8.3.2.9
     Curve getHorizontalCurve(double v);

Reply via email to