changeset 6352:f1a3ea7fb3b6

Insert Double.NaN for missing values in bed height factory.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 17 Jun 2013 16:18:40 +0200 (2013-06-17)
parents 2c7a16d59f67
children 626af4af74a5
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java	Mon Jun 17 15:37:26 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java	Mon Jun 17 16:18:40 2013 +0200
@@ -154,12 +154,11 @@
             for (int i = 0; i < results.size(); i++) {
                 Object[] row = results.get(i);
                 log.debug("got station: " + (Double)row[1]);
-                height.add(
-                    (Double) row[0],
-                    (Double) row[1],
-                    (Double) row[2],
-                    (Double) row[3],
-                    (Integer) row[4]);
+                Double row0 = row[0] != null ? (Double)row[0] : Double.NaN;
+                Double row1 = row[1] != null ? (Double)row[1] : Double.NaN;
+                Double row2 = row[2] != null ? (Double)row[2] : Double.NaN;
+                Double row3 = row[3] != null ? (Double)row[3] : Double.NaN;
+                height.add(row0, row1, row2, row3, (Integer) row[4]);
             }
             return height;
         }

http://dive4elements.wald.intevation.org