Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
4773:f0b3ad10f67f | 4774:9dcc32fc5167 |
---|---|
75 Map<Long, DIPSGauge> aftDIPSGauges = new HashMap<Long, DIPSGauge>(); | 75 Map<Long, DIPSGauge> aftDIPSGauges = new HashMap<Long, DIPSGauge>(); |
76 | 76 |
77 ResultSet messstellenRs = aftStatements | 77 ResultSet messstellenRs = aftStatements |
78 .getStatement("select.messstelle") | 78 .getStatement("select.messstelle") |
79 .clearParameters() | 79 .clearParameters() |
80 .setInt("GEWAESSER_NR", id2).executeQuery(); | 80 .setInt("GEWAESSER_NR", id2) |
81 .setDouble("START_KM", from) | |
82 .setDouble("END_KM", to) | |
83 .executeQuery(); | |
81 | 84 |
82 try { | 85 try { |
83 while (messstellenRs.next()) { | 86 while (messstellenRs.next()) { |
84 String name = messstellenRs.getString("NAME"); | 87 String name = messstellenRs.getString("NAME"); |
85 String num = messstellenRs.getString("MESSSTELLE_NR"); | 88 String num = messstellenRs.getString("MESSSTELLE_NR"); |
86 double station = messstellenRs.getDouble("STATIONIERUNG"); | |
87 | |
88 if (messstellenRs.wasNull()) { | |
89 log.warn("AFT: STATION of MESSSTELLE '"+name+"' is NULL -> ignored."); | |
90 continue; | |
91 } | |
92 | |
93 if (!inside(station)) { | |
94 log.warn("AFT: MESSSTELLE '"+name+"' out of calculation range -> ignored."); | |
95 continue; | |
96 } | |
97 | 89 |
98 Long number = SyncContext.numberToLong(num); | 90 Long number = SyncContext.numberToLong(num); |
99 if (number == null) { | 91 if (number == null) { |
100 log.warn("AFT: Invalid MESSSTELLE_NR for MESSSTELLE '"+name+"'"); | 92 log.warn("AFT: Invalid MESSSTELLE_NR for MESSSTELLE '"+name+"'"); |
101 continue; | 93 continue; |