This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 0580fecf48a141c3fb41b330fe9e2717ae80f244 Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Fri Mar 15 16:43:10 2024 +0100 Remove a few methods that can be provided as default GeoAPI methods. --- .../coverage/grid/FractionalGridCoordinates.java | 17 ---------- .../sis/referencing/gazetteer/SimpleLocation.java | 4 ++- .../sis/geometry/AbstractDirectPosition.java | 34 +------------------- .../org/apache/sis/geometry/DirectPosition2D.java | 5 +-- .../apache/sis/math/CompoundDirectPositions.java | 37 ---------------------- geoapi/snapshot | 2 +- 6 files changed, 8 insertions(+), 91 deletions(-) diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java index 73e5bda9cf..a7e59a1e39 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java @@ -22,7 +22,6 @@ import org.opengis.geometry.DirectPosition; import org.opengis.geometry.MismatchedDimensionException; import org.opengis.referencing.operation.MathTransform; import org.opengis.referencing.operation.TransformException; -import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.datum.PixelInCell; import org.apache.sis.feature.internal.Resources; import org.apache.sis.util.StringBuilders; @@ -383,22 +382,6 @@ public class FractionalGridCoordinates implements GridCoordinates, Serializable super(other); } - /** - * Returns the direct position, which is this object itself. - */ - @Override - public DirectPosition getDirectPosition() { - return this; - } - - /** - * Grid coordinates have no coordinate reference system. - */ - @Override - public CoordinateReferenceSystem getCoordinateReferenceSystem() { - return null; - } - /** * Returns all coordinate values. */ diff --git a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/SimpleLocation.java b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/SimpleLocation.java index 8b30c58684..992c5b54dd 100644 --- a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/SimpleLocation.java +++ b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/SimpleLocation.java @@ -122,7 +122,9 @@ class SimpleLocation extends AbstractLocation implements DirectPosition, Envelop } /** - * Returns the direct position, which is itself. + * Returns this direct position. + * + * @return {@code this}. */ @Override public final DirectPosition getDirectPosition() { diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/AbstractDirectPosition.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/AbstractDirectPosition.java index 146a0c029e..b676c51bbb 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/AbstractDirectPosition.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/AbstractDirectPosition.java @@ -87,8 +87,7 @@ public abstract class AbstractDirectPosition extends FormattableObject implement } /** - * Returns always {@code this}, the direct position for this - * {@linkplain org.opengis.geometry.coordinate.Position position}. + * Returns this direct position. * * @return {@code this}. */ @@ -97,37 +96,6 @@ public abstract class AbstractDirectPosition extends FormattableObject implement return this; } - /** - * Returns the coordinate reference system in which the coordinate tuple is given. - * May be {@code null} if this particular {@code DirectPosition} is included in a larger object - * with such a reference to a {@linkplain CoordinateReferenceSystem coordinate reference system}. - * - * <p>The default implementation returns {@code null}. - * Subclasses should override this method if the CRS can be provided.</p> - * - * @return the coordinate reference system, or {@code null}. - */ - @Override - public CoordinateReferenceSystem getCoordinateReferenceSystem() { - return null; - } - - /** - * Returns a sequence of numbers that hold the coordinate of this position in its reference system. - * - * @return the coordinates. - * - * @since 1.5 - */ - @Override - public double[] getCoordinates() { - final double[] coordinates = new double[getDimension()]; - for (int i=0; i<coordinates.length; i++) { - coordinates[i] = getCoordinate(i); - } - return coordinates; - } - /** * Sets the coordinate value along the specified dimension. * diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/DirectPosition2D.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/DirectPosition2D.java index 413374bb47..bd1814dda1 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/DirectPosition2D.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/DirectPosition2D.java @@ -181,8 +181,9 @@ public class DirectPosition2D extends Point2D.Double implements DirectPosition, } /** - * Returns always {@code this}, the direct position for this - * {@linkplain org.opengis.geometry.coordinate.Position position}. + * Returns this direct position. + * + * @return {@code this}. */ @Override public final DirectPosition getDirectPosition() { diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/CompoundDirectPositions.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/CompoundDirectPositions.java index 0623a8c6ae..02a0cab9c9 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/CompoundDirectPositions.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/CompoundDirectPositions.java @@ -18,7 +18,6 @@ package org.apache.sis.math; import java.util.Iterator; import org.opengis.geometry.DirectPosition; -import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.apache.sis.util.resources.Errors; @@ -99,26 +98,6 @@ final class CompoundDirectPositions implements DirectPosition, Iterable<DirectPo return this; } - /** - * Returns {@code this} since this object is already a direct position. - * - * @return always {@code this}. - */ - @Override - public DirectPosition getDirectPosition() { - return this; - } - - /** - * Returns {@code null} since there is no CRS associated to this object. - * - * @return always {@code null}. - */ - @Override - public CoordinateReferenceSystem getCoordinateReferenceSystem() { - return null; - } - /** * Returns the number of dimensions. */ @@ -134,20 +113,4 @@ final class CompoundDirectPositions implements DirectPosition, Iterable<DirectPo public double getCoordinate(final int dimension) { return coordinates[dimension].doubleValue(index); } - - /** - * Not needed. - */ - @Override - public double[] getCoordinates() { - throw new UnsupportedOperationException(); - } - - /** - * Not needed. - */ - @Override - public void setCoordinate(int dimension, double value) { - throw new UnsupportedOperationException(); - } } diff --git a/geoapi/snapshot b/geoapi/snapshot index 7a09728de4..1162a09f9c 160000 --- a/geoapi/snapshot +++ b/geoapi/snapshot @@ -1 +1 @@ -Subproject commit 7a09728de4e428d185fee1979f70701418bd7aa9 +Subproject commit 1162a09f9ca0ca5afb29356de81d8e5b938a2dcf