[Schmitzm-commits] r2419 - trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 15 17:02:44 CET 2016


Author: mojays
Date: 2016-02-15 17:02:44 +0100 (Mon, 15 Feb 2016)
New Revision: 2419

Modified:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/RasterFilter.java
Log:
RasterFilter: BugFix to handle horizontal raster border area without exception

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/RasterFilter.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/RasterFilter.java	2016-01-15 19:05:02 UTC (rev 2418)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/RasterFilter.java	2016-02-15 16:02:44 UTC (rev 2419)
@@ -184,11 +184,13 @@
       if ( cellY >= minY && cellY <= maxY )
         for (int fx = 0; fx < sizeX; fx++) {
           cellX       = startX + fx; // Raster-Koordinate
-          cellValue   = raster.getRasterSampleAsDouble(cellX,cellY);
-          filterValue = filter[fx][fy];
-          if ( cellX >= minX && cellX <= maxX && filterValue != 0 && !Double.isNaN(cellValue) ) {
-            filterSum += filterValue;
-            cellSum   += filterValue * cellValue;
+          if ( cellX >= minX && cellX <= maxX )  {
+            cellValue   = raster.getRasterSampleAsDouble(cellX,cellY);
+            filterValue = filter[fx][fy];
+            if ( cellX >= minX && cellX <= maxX && filterValue != 0 && !Double.isNaN(cellValue) ) {
+              filterSum += filterValue;
+              cellSum   += filterValue * cellValue;
+            }
           }
         }
     }



More information about the Schmitzm-commits mailing list