Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java @ 8678:b743ed33c65d
(issue1755) Add non empty measurement facets again
The add was in the wrong place (inside the loop) which breaks
when a non NaN is found and the loop only lopped over the first
two (the dimensions of data) values.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 10 Apr 2015 11:17:03 +0200 |
parents | 0c241f03ebcd |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8677:b44c76b6800c | 8678:b743ed33c65d |
---|---|
130 Object d = candidate.getData((Artifact)artifact, context); | 130 Object d = candidate.getData((Artifact)artifact, context); |
131 if (d != null) { | 131 if (d != null) { |
132 double [][] data = (double[][]) d; | 132 double [][] data = (double[][]) d; |
133 if (data.length > 0 && data[0].length > 0) { | 133 if (data.length > 0 && data[0].length > 0) { |
134 boolean onlyNaN = true; | 134 boolean onlyNaN = true; |
135 for (int i = 0; i < data.length; i++) { | 135 for (int i = 0; i < data[1].length; i++) { |
136 if (!Double.isNaN(data[1][i])) { | 136 if (!Double.isNaN(data[1][i])) { |
137 onlyNaN = false; | 137 onlyNaN = false; |
138 break; | 138 break; |
139 } | 139 } |
140 if (!onlyNaN) { | |
141 newFacets.add(candidate); | |
142 } | |
143 // else adding a problem would be nice | |
144 } | 140 } |
141 if (!onlyNaN) { | |
142 newFacets.add(candidate); | |
143 } else { | |
144 log.debug("Not adding measurement facet " + | |
145 "because it only contains NaN values"); | |
146 } | |
147 // else adding a problem would be nice | |
145 } | 148 } |
146 } | 149 } |
147 } | 150 } |
148 log.debug("Created " + newFacets.size() + " new Facets."); | 151 log.debug("Created " + newFacets.size() + " new Facets."); |
149 facets.addAll(newFacets); | 152 facets.addAll(newFacets); |