sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/03: Recompute isolines if map projection changed.
Date Thu, 14 Jan 2021 16:35: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 0a252d77c10ad1e89c7868ee85469f52d32dc9d6
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Jan 14 11:53:30 2021 +0100

    Recompute isolines if map projection changed.
---
 .../java/org/apache/sis/gui/coverage/CoverageCanvas.java | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
index 527f1e7..6e44e14 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
@@ -372,6 +372,7 @@ public class CoverageCanvas extends MapCanvasAWT {
         } finally {
             LogHandler.loadingStop(id);
         }
+        clearIsolines();
     }
 
     /**
@@ -390,6 +391,7 @@ public class CoverageCanvas extends MapCanvasAWT {
         } finally {
             LogHandler.loadingStop(id);
         }
+        clearIsolines();
     }
 
     /**
@@ -460,9 +462,7 @@ public class CoverageCanvas extends MapCanvasAWT {
         if (TRACE) {
             trace("setRawImage(…): the new source of data is:%n\t%s", image);
         }
-        if (isolines != null) {
-            isolines.clear();
-        }
+        clearIsolines();
         resampledImage = null;
         derivedImages.clear();
         data.setImage(image, domain, ranges);
@@ -475,6 +475,16 @@ public class CoverageCanvas extends MapCanvasAWT {
     }
 
     /**
+     * Clears all information that are derived from the raw image projected to objective
CRS.
+     * In current version this is only isolines.
+     */
+    private void clearIsolines() {
+        if (isolines != null) {
+            isolines.clear();
+        }
+    }
+
+    /**
      * Invoked when a new interpolation has been specified.
      *
      * @see #setInterpolation(Interpolation)


Mime
View raw message