diff flys-aft/src/main/java/de/intevation/aft/River.java @ 4774:9dcc32fc5167

Moved check for calculation range intersection to SQL statement.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sat, 05 Jan 2013 13:46:27 +0100
parents f939e1e6cfa4
children d9f1202cef78
line wrap: on
line diff
--- a/flys-aft/src/main/java/de/intevation/aft/River.java	Sat Jan 05 13:30:57 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/aft/River.java	Sat Jan 05 13:46:27 2013 +0100
@@ -77,23 +77,15 @@
         ResultSet messstellenRs = aftStatements
             .getStatement("select.messstelle")
             .clearParameters()
-            .setInt("GEWAESSER_NR", id2).executeQuery();
+            .setInt("GEWAESSER_NR", id2)
+            .setDouble("START_KM", from)
+            .setDouble("END_KM", to)
+            .executeQuery();
 
         try {
             while (messstellenRs.next()) {
-                String name    = messstellenRs.getString("NAME");
-                String num     = messstellenRs.getString("MESSSTELLE_NR");
-                double station = messstellenRs.getDouble("STATIONIERUNG");
-
-                if (messstellenRs.wasNull()) {
-                    log.warn("AFT: STATION of MESSSTELLE '"+name+"' is NULL -> ignored.");
-                    continue;
-                }
-
-                if (!inside(station)) {
-                    log.warn("AFT: MESSSTELLE '"+name+"' out of calculation range -> ignored.");
-                    continue;
-                }
+                String name = messstellenRs.getString("NAME");
+                String num  = messstellenRs.getString("MESSSTELLE_NR");
 
                 Long number = SyncContext.numberToLong(num);
                 if (number == null) {

http://dive4elements.wald.intevation.org