Revision: 4482
          http://sourceforge.net/p/jump-pilot/code/4482
Author:   bertazza
Date:     2015-06-08 10:00:24 +0000 (Mon, 08 Jun 2015)
Log Message:
-----------
Sextante raster layers: fixed bug in nodata color handling when using symbology.

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/src/org/openjump/core/rasterimage/RasterImageLayer.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2015-06-08 06:29:09 UTC (rev 4481)
+++ core/trunk/ChangeLog        2015-06-08 10:00:24 UTC (rev 4482)
@@ -1,5 +1,8 @@
 # for display continuity sake please use 2 spaces instead of tabs
 
+2015-06-08 bertaz
+  * Sextante raster layers: fixed bug in nodata color handling when using 
symbology.
+
 2015-06-04 Giuseppe Aruta <giuseppe_ar...@yahoo.it>
   * Add WMS Legend plugin to WMS layer context menu
 

Modified: core/trunk/src/org/openjump/core/rasterimage/RasterImageLayer.java
===================================================================
--- core/trunk/src/org/openjump/core/rasterimage/RasterImageLayer.java  
2015-06-08 06:29:09 UTC (rev 4481)
+++ core/trunk/src/org/openjump/core/rasterimage/RasterImageLayer.java  
2015-06-08 10:00:24 UTC (rev 4482)
@@ -543,7 +543,8 @@
      * use this to assign the raster data again
      * the method is called from  getRasterData();
      */
-    public void reLoadImageButKeepImageForDisplay() throws IOException, 
NoninvertibleTransformException, FileNotFoundException, 
TiffTags.TiffReadingException, Exception{
+    public void reLoadImageButKeepImageForDisplay() throws IOException,
+            NoninvertibleTransformException, FileNotFoundException, 
TiffTags.TiffReadingException, Exception{
        WorkbenchContext context = getWorkbenchContext();
        BufferedImage pi = getImageForDisplay();
        //[sstein 24.Sept.2010] commented out:
@@ -609,12 +610,13 @@
                 } else {
                     double value = actualRasterData.getSampleDouble(col, row, 
0);
                     
-                    if(Double.isNaN(value) || Double.isInfinite(value) || 
value == noDataValue) {
+                    Color color = symbology.getColor(value);
+                    if((Double.isNaN(value) || Double.isInfinite(value) || 
value == noDataValue)
+                            && color == null) {
                         newImage.setRGB(col, row, Color.TRANSLUCENT);
                         continue;
                     }
-                    
-                    Color color = symbology.getColor(value);
+
                     newImage.setRGB(col, row, color.getRGB());
                 }
                     


------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to