sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 03/03: Add a wraparound application which was missing when going from a geographic CRS to a projected CRS.
Date Wed, 07 Oct 2020 14:55:38 GMT
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 f6deb67a6dc31182792a2dae9b140680274e108b
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Oct 7 16:07:56 2020 +0200

    Add a wraparound application which was missing when going from a geographic CRS to a projected
CRS.
---
 core/sis-portrayal/src/main/java/org/apache/sis/portrayal/Canvas.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/Canvas.java b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/Canvas.java
index e16b1fe..a430d65 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/Canvas.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/Canvas.java
@@ -54,6 +54,7 @@ import org.apache.sis.referencing.operation.DefaultCoordinateOperationFactory;
 import org.apache.sis.internal.referencing.CoordinateOperations;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.referencing.DirectPositionView;
+import org.apache.sis.internal.referencing.WraparoundApplicator;
 import org.apache.sis.internal.util.DoubleDouble;
 import org.apache.sis.coverage.grid.IncompleteGridGeometryException;
 import org.apache.sis.coverage.grid.GridGeometry;
@@ -564,7 +565,8 @@ public class Canvas extends Observable implements Localized {
                      * in order to preserve pixel ratios (otherwise the map projection would
appear deformed).
                      */
                     oldObjectiveToDisplay = getObjectiveToDisplay();
-                    final MathTransform change = orthogonalTangent(newToOld, anchor.getCoordinate());
+                    final WraparoundApplicator wp = new WraparoundApplicator(null, objectivePOI,
oldValue.getCoordinateSystem());
+                    final MathTransform change = orthogonalTangent(wp.forDomainOfUse(newToOld),
anchor.getCoordinate());
                     final MathTransform result = MathTransforms.concatenate(change, oldObjectiveToDisplay);
                     /*
                      * The result is the new `objectiveToTransform` such as the display is
unchanged around POI.


Mime
View raw message