comparison artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java @ 8768:ef0ec2498dd0

issue1841 Only include loads where value != NaN in info service
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 20 Aug 2015 19:14:56 +0200
parents 69b0a71b4845
children 5e38e2924c07
comparison
equal deleted inserted replaced
8767:d0f2250b5521 8768:ef0ec2498dd0
83 river); 83 river);
84 84
85 log.debug("Requested type: " + type + " with sq_ti_id: " + sq_ti_id); 85 log.debug("Requested type: " + type + " with sq_ti_id: " + sq_ti_id);
86 Collection <Load> loads; 86 Collection <Load> loads;
87 if (type.equals("sq_time_intervals")) { 87 if (type.equals("sq_time_intervals")) {
88 loads = allLoadData.findDistinctSQTimeIntervalNonEpochLoads(fromD, toD); 88 loads = allLoadData.findDistinctSQTimeIntervalNonEpochLoadsWithValue(fromD, toD);
89 89
90 for (Iterator<Load> it = loads.iterator(); it.hasNext();) { 90 for (Iterator<Load> it = loads.iterator(); it.hasNext();) {
91 /* Skip loads without time interval for this info type. */ 91 /* Skip loads without time interval for this info type. */
92 Load cur = it.next(); 92 Load cur = it.next();
93 if (cur.getSQRelationTimeIntervalId() == null) { 93 if (cur.getSQRelationTimeIntervalId() == null) {
95 } 95 }
96 } 96 }
97 } else { 97 } else {
98 if (!sq_ti_id.isEmpty()) { 98 if (!sq_ti_id.isEmpty()) {
99 Integer id = Integer.parseInt(sq_ti_id); 99 Integer id = Integer.parseInt(sq_ti_id);
100 loads = allLoadData.findLoads(fromD, toD, id); 100 loads = allLoadData.findLoadsWithValue(fromD, toD, id);
101 } else { 101 } else {
102 loads = allLoadData.findLoads(fromD, toD); 102 loads = allLoadData.findLoadsWithValue(fromD, toD);
103 } 103 }
104 for (Iterator<Load> it = loads.iterator(); it.hasNext();) { 104 for (Iterator<Load> it = loads.iterator(); it.hasNext();) {
105 /* Skip epochs . */ 105 /* Skip epochs . */
106 if (it.next().isEpoch()) { 106 if (it.next().isEpoch()) {
107 it.remove(); 107 it.remove();

http://dive4elements.wald.intevation.org