You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2022/06/20 15:12:38 UTC
[sis] branch geoapi-4.0 updated (549b647c88 -> b4543619f1)
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a change to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
from 549b647c88 More immediate feedback to user about the changes in source canvas that are replicated in the target canvas. The interim JavaFX transform is used without waiting for the background thread to complete the re-rendering.
new ae63253c7f Adjust cursor position in the target canvas when the map in source canvas moved without a change in mouse position.
new c99e4ca07d Add a margin when rendering the map.
new b4543619f1 Use the mouse position as the point where change in target canvas should be the same (in "real world" units) as the change in source canvas.
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/sis/gui/map/GestureFollower.java | 94 +++++++++++++++-------
.../java/org/apache/sis/gui/map/MapCanvas.java | 2 +-
.../java/org/apache/sis/gui/map/MapCanvasAWT.java | 11 ++-
.../org/apache/sis/portrayal/CanvasFollower.java | 40 +++++++--
.../apache/sis/portrayal/TransformChangeEvent.java | 2 +-
.../org/apache/sis/geometry/DirectPosition2D.java | 14 +++-
.../transform/ConcatenatedTransform2D.java | 2 +-
.../transform/PassThroughTransform2D.java | 2 +-
8 files changed, 121 insertions(+), 46 deletions(-)
[sis] 02/03: Add a margin when rendering the map.
Posted by de...@apache.org.
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 c99e4ca07d24e2eb260e4d3a4a0b4ccc3e61b72e
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Jun 20 11:04:34 2022 +0200
Add a margin when rendering the map.
---
.../src/main/java/org/apache/sis/gui/map/MapCanvas.java | 2 +-
.../src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvas.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvas.java
index 455062f2b4..e02938ca57 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvas.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvas.java
@@ -138,7 +138,7 @@ public abstract class MapCanvas extends PlanarCanvas {
* Size in pixels of a scroll or translation event. This value should be close to the
* {@linkplain ScrollEvent#getDeltaY() delta of a scroll event done with mouse wheel}.
*/
- private static final double SCROLL_EVENT_SIZE = 40;
+ static final double SCROLL_EVENT_SIZE = 40;
/**
* The zoom factor to apply on scroll event. A value of 0.1 means that a zoom of 10%
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java
index 5ad205d46c..926d4be804 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java
@@ -52,7 +52,7 @@ import org.apache.sis.internal.coverage.j2d.ColorModelFactory;
* controls by the user.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.2
+ * @version 1.3
* @since 1.1
* @module
*/
@@ -76,10 +76,15 @@ public abstract class MapCanvasAWT extends MapCanvas {
*/
private static final String WARNING_TEXT = "\u26A0";
+ /**
+ * Default value of {@link #imageMargin}.
+ */
+ private static final Insets DEFAULT_MARGIN = new Insets(SCROLL_EVENT_SIZE);
+
/**
* Number of additional pixels to paint on each sides of the image, outside the viewing area.
* Computing a larger image reduces the black borders that user sees during translations or
- * during zoom out before the new image is repainted. The default value is {@code null}.
+ * during zoom out before the new image is repainted.
*/
public final ObjectProperty<Insets> imageMargin;
@@ -148,7 +153,7 @@ public abstract class MapCanvasAWT extends MapCanvas {
*/
public MapCanvasAWT(final Locale locale) {
super(locale);
- imageMargin = new SimpleObjectProperty<>(this, "imageMargin");
+ imageMargin = new SimpleObjectProperty<>(this, "imageMargin", DEFAULT_MARGIN);
image = new ImageView();
image.setPreserveRatio(true);
floatingPane.getChildren().add(image);
[sis] 01/03: Adjust cursor position in the target canvas when the map in source canvas moved without a change in mouse position.
Posted by de...@apache.org.
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 ae63253c7fa86f311f8573d5c81708b070eab198
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Jun 20 11:03:14 2022 +0200
Adjust cursor position in the target canvas when the map in source canvas moved without a change in mouse position.
---
.../org/apache/sis/gui/map/GestureFollower.java | 57 +++++++++++-----------
.../org/apache/sis/portrayal/CanvasFollower.java | 2 +
.../apache/sis/portrayal/TransformChangeEvent.java | 2 +-
3 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java
index 6f4e97bd09..b5744dba25 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java
@@ -17,6 +17,8 @@
package org.apache.sis.gui.map;
import java.awt.geom.Point2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
import java.util.logging.Logger;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
@@ -191,16 +193,14 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
* of {@link #cursorSourcePosition}.
*/
private void updateCursorPosition() {
- if (cursor.isVisible()) {
- final MathTransform2D tr = getDisplayTransform().orElse(null);
- if (tr != null) try {
- final Point2D p = tr.transform(cursorSourcePosition, cursorTargetPosition);
- cursor.setTranslateX(p.getX());
- cursor.setTranslateY(p.getY());
- } catch (TransformException e) {
- Logging.recoverableException(Logger.getLogger(Modules.APPLICATION), GestureFollower.class, "handle", e);
- cursor.setVisible(false);
- }
+ final MathTransform2D tr = getDisplayTransform().orElse(null);
+ if (tr != null) try {
+ final Point2D p = tr.transform(cursorSourcePosition, cursorTargetPosition);
+ cursor.setTranslateX(p.getX());
+ cursor.setTranslateY(p.getY());
+ } catch (TransformException e) {
+ Logging.recoverableException(Logger.getLogger(Modules.APPLICATION), GestureFollower.class, "handle", e);
+ cursor.setVisible(false);
}
}
@@ -219,30 +219,31 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
/**
* Invoked after the source "objective to display" transform has been updated.
+ * This implementation adjusts the cursor position for compensating the relative change in mouse position.
*
- * @hidden
+ * <div class="note"><b>Details:</b>
+ * If the map moved in the {@linkplain #source source} canvas without a change of mouse cursor position
+ * (for example if the user navigates using the keyboard), then the mouse position changed relatively to
+ * the map, so the cursor position on the {@linkplain #target target} canvas needs to be updated accordingly.
+ * This is a temporary change applied until the next {@link MouseEvent} gives us new mouse coordinates relative
+ * to the map.</div>
*/
@Override
protected void transformedSource(final TransformChangeEvent event) {
super.transformedSource(event);
- if (event.getReason() != TransformChangeEvent.Reason.INTERIM) {
- event.getDisplayChange2D().ifPresent((change) -> {
+ if (cursor != null) {
+ final AffineTransform change = event.getDisplayChange2D().orElse(null);
+ if (change == null) {
+ cursor.setVisible(false);
+ } else if (event.getReason() != TransformChangeEvent.Reason.INTERIM) {
change.transform(cursorSourcePosition, cursorSourcePosition);
- });
- }
- }
-
- /**
- * Invoked after the target "objective to display" transform has been updated.
- * This method recomputes the cursor position.
- *
- * @hidden
- */
- @Override
- protected void transformedTarget(final TransformChangeEvent event) {
- super.transformedTarget(event);
- if (event.getReason() != TransformChangeEvent.Reason.INTERIM) {
- updateCursorPosition();
+ updateCursorPosition();
+ } else try {
+ change.inverseTransform(cursorSourcePosition, cursorSourcePosition);
+ updateCursorPosition();
+ } catch (NoninvertibleTransformException e) {
+ cursor.setVisible(false);
+ }
}
}
diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java
index a2161d7717..c8c0880d31 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java
@@ -422,6 +422,7 @@ public class CanvasFollower implements PropertyChangeListener, Disposable {
/**
* Invoked after the source "objective to display" transform has been updated.
+ * This method is invoked automatically by {@link #propertyChange(PropertyChangeEvent)}.
* The default implementation does nothing.
* Subclasses can override if they need to transform additional data.
*
@@ -432,6 +433,7 @@ public class CanvasFollower implements PropertyChangeListener, Disposable {
/**
* Invoked after the target "objective to display" transform has been updated.
+ * This method is invoked automatically by {@link #propertyChange(PropertyChangeEvent)}.
* The default implementation does nothing.
* Subclasses can override if they need to transform additional data.
*
diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/TransformChangeEvent.java b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/TransformChangeEvent.java
index 30aacbcf00..9c058e681d 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/TransformChangeEvent.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/TransformChangeEvent.java
@@ -116,7 +116,7 @@ public class TransformChangeEvent extends PropertyChangeEvent {
* in viewing area, without change in the data themselves or in the map projection.
*/
final boolean isNavigation() {
- return ordinal() >= ASSIGNMENT.ordinal();
+ return ordinal() >= ASSIGNMENT.ordinal() && ordinal() < INTERIM.ordinal();
}
}
[sis] 03/03: Use the mouse position as the point where change in target canvas should be the same (in "real world" units) as the change in source canvas.
Posted by de...@apache.org.
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 b4543619f15551bb5b6921caa6271b1015af47b5
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Jun 20 12:08:27 2022 +0200
Use the mouse position as the point where change in target canvas should be the same (in "real world" units) as the change in source canvas.
---
.../org/apache/sis/gui/map/GestureFollower.java | 41 +++++++++++++++++++---
.../org/apache/sis/portrayal/CanvasFollower.java | 38 +++++++++++++++-----
.../org/apache/sis/geometry/DirectPosition2D.java | 14 +++++++-
.../transform/ConcatenatedTransform2D.java | 2 +-
.../transform/PassThroughTransform2D.java | 2 +-
5 files changed, 82 insertions(+), 15 deletions(-)
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java
index b5744dba25..ea294276ef 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/GestureFollower.java
@@ -19,6 +19,7 @@ package org.apache.sis.gui.map;
import java.awt.geom.Point2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
+import java.util.Optional;
import java.util.logging.Logger;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
@@ -98,6 +99,12 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
*/
public final BooleanProperty cursorEnabled;
+ /**
+ * Whether the {@link #cursorSourcePosition} is valid.
+ * If {@code true}, then {@link #cursor} shall be non-null and should be visible.
+ */
+ private boolean cursorSourceValid;
+
/**
* Cursor position of the mouse over source canvas, expressed in coordinates of the source and target canvas.
*/
@@ -125,8 +132,8 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
public GestureFollower(final MapCanvas source, final MapCanvas target) {
super(source, target);
super.setDisabled(true);
- cursorSourcePosition = new Point2D.Double(Double.NaN, Double.NaN);
- cursorTargetPosition = new Point2D.Double(Double.NaN, Double.NaN);
+ cursorSourcePosition = new Point2D.Double();
+ cursorTargetPosition = new Point2D.Double();
transformEnabled = new SimpleBooleanProperty(this, "transformEnabled");
cursorEnabled = new SimpleBooleanProperty(this, "cursorEnabled");
transformEnabled.addListener((p,o,n) -> setDisabled(!n));
@@ -156,7 +163,9 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
pane.addEventHandler(MouseEvent.MOUSE_EXITED, this);
pane.addEventHandler(MouseEvent.MOUSE_MOVED, this);
pane.addEventHandler(MouseEvent.MOUSE_DRAGGED, this);
+ cursorSourceValid = true;
} else {
+ cursorSourceValid = false;
pane.removeEventHandler(MouseEvent.MOUSE_ENTERED, this);
pane.removeEventHandler(MouseEvent.MOUSE_EXITED, this);
pane.removeEventHandler(MouseEvent.MOUSE_MOVED, this);
@@ -167,6 +176,26 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
}
}
+ /**
+ * Returns the position for the mouse cursor in the source canvas if that position is known.
+ * This information is used when the source and target canvases do not use the same CRS.
+ * {@code GestureFollower} tries to transform the canvas views in such a way that the
+ * "real world" change is the same for both canvas at that location.
+ *
+ * <p>The returned value is "live"; it may change with mouse and gesture events.
+ * Callers should not modify that value, and copy it if they need to keep it.</p>
+ *
+ * @return mouse position in source canvas where displacements, zooms and rotations
+ * applied on the source canvas should be mirrored exactly on the target canvas.
+ */
+ @Override
+ public Optional<Point2D> getSourceDisplayPOI() {
+ if (cursorSourceValid) {
+ return Optional.of(cursorSourcePosition);
+ }
+ return super.getSourceDisplayPOI();
+ }
+
/**
* Invoked when the mouse position changed. This method should be invoked only if
* {@link #cursorEnabled} is {@code true} (this is not verified by this method).
@@ -177,6 +206,7 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
public void handle(final MouseEvent event) {
cursorSourcePosition.x = event.getX();
cursorSourcePosition.y = event.getY();
+ cursorSourceValid = true;
final EventType<? extends MouseEvent> type = event.getEventType();
if (type == MouseEvent.MOUSE_MOVED) {
updateCursorPosition();
@@ -199,8 +229,9 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
cursor.setTranslateX(p.getX());
cursor.setTranslateY(p.getY());
} catch (TransformException e) {
- Logging.recoverableException(Logger.getLogger(Modules.APPLICATION), GestureFollower.class, "handle", e);
+ cursorSourceValid = false;
cursor.setVisible(false);
+ Logging.recoverableException(Logger.getLogger(Modules.APPLICATION), GestureFollower.class, "handle", e);
}
}
@@ -231,9 +262,10 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
@Override
protected void transformedSource(final TransformChangeEvent event) {
super.transformedSource(event);
- if (cursor != null) {
+ if (cursorSourceValid) {
final AffineTransform change = event.getDisplayChange2D().orElse(null);
if (change == null) {
+ cursorSourceValid = false;
cursor.setVisible(false);
} else if (event.getReason() != TransformChangeEvent.Reason.INTERIM) {
change.transform(cursorSourcePosition, cursorSourcePosition);
@@ -242,6 +274,7 @@ public class GestureFollower extends CanvasFollower implements EventHandler<Mous
change.inverseTransform(cursorSourcePosition, cursorSourcePosition);
updateCursorPosition();
} catch (NoninvertibleTransformException e) {
+ cursorSourceValid = false;
cursor.setVisible(false);
}
}
diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java
index c8c0880d31..ffae15f06c 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasFollower.java
@@ -18,6 +18,7 @@ package org.apache.sis.portrayal;
import java.util.Optional;
import java.util.logging.Logger;
+import java.awt.geom.Point2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.beans.PropertyChangeEvent;
@@ -34,6 +35,7 @@ import org.apache.sis.util.Disposable;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.NullArgumentException;
import org.apache.sis.util.logging.Logging;
+import org.apache.sis.geometry.DirectPosition2D;
import org.apache.sis.internal.system.Modules;
import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
import org.apache.sis.referencing.operation.matrix.AffineTransforms2D;
@@ -246,15 +248,12 @@ public class CanvasFollower implements PropertyChangeListener, Disposable {
* at that location only. At all other locations, the "real world" coordinate changes
* may differ because of map projection deformations.
*
- * <p>The default implementation is as below. Subclasses can override this method for
- * using a different point of interest, for example at the location of mouse cursor.</p>
+ * <p>The default implementation computes the value from {@link #getSourceDisplayPOI()}
+ * if present, or fallback on {@code source.getPointOfInterest(true)} otherwise.
+ * Subclasses can override this method for using a different point of interest.</p>
*
- * {@preformat java
- * return source.getPointOfInterest(true);
- * }
- *
- * The CRS associated to the position shall be {@link PlanarCanvas#getObjectiveCRS()}.
- * For performance reason, this is not verified by this {@code CanvasFollower} class.
+ * <p>The CRS associated to the position shall be {@link PlanarCanvas#getObjectiveCRS()}.
+ * For performance reason, this is not verified by this {@code CanvasFollower} class.</p>
*
* @return objective coordinates in source canvas where displacements, zooms and rotations
* applied on the source canvas should be mirrored exactly on the target canvas.
@@ -262,9 +261,32 @@ public class CanvasFollower implements PropertyChangeListener, Disposable {
* @see PlanarCanvas#getPointOfInterest(boolean)
*/
public DirectPosition getSourceObjectivePOI() {
+ final Point2D p = getSourceDisplayPOI().orElse(null);
+ if (p != null) try {
+ final DirectPosition2D poi = new DirectPosition2D(p);
+ source.objectiveToDisplay.inverseTransform(poi, poi);
+ return poi;
+ } catch (NoninvertibleTransformException e) {
+ canNotCompute("getSourceObjectivePOI", e);
+ }
return source.getPointOfInterest(true);
}
+ /**
+ * Returns the display coordinates of the Point Of Interest (POI) in source canvas.
+ * This method provides the same information than {@link #getSourceObjectivePOI()},
+ * but in units that are more convenient for expressing the location of mouse cursor
+ * for example.
+ *
+ * <p>The default implementation returns an empty value.</p>
+ *
+ * @return display coordinates in source canvas where displacements, zooms and rotations
+ * applied on the source canvas should be mirrored exactly on the target canvas.
+ */
+ public Optional<Point2D> getSourceDisplayPOI() {
+ return Optional.empty();
+ }
+
/**
* Returns the transform from source display coordinates to target display coordinates.
* This transform may change every time that a zoom; translation or rotation is applied
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java b/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
index f07f7951dc..2e488f5c05 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
@@ -59,7 +59,7 @@ import static org.apache.sis.util.ArgumentChecks.ensureDimensionMatches;
* Collections that do not rely on hash codes, like {@code ArrayList}, are safe in all cases.</p>
*
* @author Martin Desruisseaux (IRD, Geomatys)
- * @version 0.3
+ * @version 1.3
*
* @see DirectPosition1D
* @see GeneralDirectPosition
@@ -96,6 +96,18 @@ public class DirectPosition2D extends Point2D.Double implements DirectPosition,
this.crs = crs;
}
+ /**
+ * Constructs a 2D position from the coordinates of the specified point.
+ * The CRS is initialized to {@code null}.
+ *
+ * @param p the point from which to copy the coordinate values.
+ *
+ * @since 1.3
+ */
+ public DirectPosition2D(final Point2D p) {
+ super(p.getX(), p.getY());
+ }
+
/**
* Constructs a 2D position from the specified coordinates. Despite their names,
* the (<var>x</var>,<var>y</var>) coordinates don't need to be oriented toward
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform2D.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform2D.java
index 61207e1347..f7710f05de 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform2D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform2D.java
@@ -100,7 +100,7 @@ final class ConcatenatedTransform2D extends ConcatenatedTransform implements Mat
@Override
public Matrix derivative(final Point2D point) throws TransformException {
return super.derivative(point instanceof DirectPosition ?
- (DirectPosition) point : new DirectPosition2D(point.getX(), point.getY()));
+ (DirectPosition) point : new DirectPosition2D(point));
}
/**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java
index 4915513f4d..cbec22f28b 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java
@@ -89,7 +89,7 @@ final class PassThroughTransform2D extends PassThroughTransform implements MathT
@Override
public Matrix derivative(final Point2D point) throws TransformException {
return super.derivative(point instanceof DirectPosition ?
- (DirectPosition) point : new DirectPosition2D(point.getX(), point.getY()));
+ (DirectPosition) point : new DirectPosition2D(point));
}
/**