comparison artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java @ 8593:a7eaf3e13bbe

Don't warn for defined behavior. Those functions have an option "skipNaN" so they should not warn about actually doing what they are supposed to do.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 19 Mar 2015 13:49:13 +0100
parents 7d0c4e508835
children 5dea205ea3e7
comparison
equal deleted inserted replaced
8592:36faef4f8acb 8593:a7eaf3e13bbe
65 double [] xPoints = points[0]; 65 double [] xPoints = points[0];
66 double [] yPoints = points[1]; 66 double [] yPoints = points[1];
67 for (int i = 0; i < xPoints.length; i++) { 67 for (int i = 0; i < xPoints.length; i++) {
68 if (skipNANs && 68 if (skipNANs &&
69 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) { 69 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) {
70 log.warn ("Skipping NaN in StyledSeriesBuilder.");
71 continue; 70 continue;
72 } 71 }
73 // Create gap if distance >= distance. 72 // Create gap if distance >= distance.
74 if (i != 0 && Math.abs(xPoints[i-1] - xPoints[i]) >= distance) { 73 if (i != 0 && Math.abs(xPoints[i-1] - xPoints[i]) >= distance) {
75 // Create at least a small segment for last point. 74 // Create at least a small segment for last point.
105 double [] xPoints = points[0]; 104 double [] xPoints = points[0];
106 double [] yPoints = points[1]; 105 double [] yPoints = points[1];
107 for (int i = 0; i < xPoints.length; i++) { 106 for (int i = 0; i < xPoints.length; i++) {
108 if (skipNANs && 107 if (skipNANs &&
109 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) { 108 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) {
110 log.warn ("Skipping NaN in StyledSeriesBuilder.");
111 continue; 109 continue;
112 } 110 }
113 // Create gap if distance >= distance. 111 // Create gap if distance >= distance.
114 if (i != 0 && Math.abs(xPoints[i-1] - xPoints[i]) >= distance) { 112 if (i != 0 && Math.abs(xPoints[i-1] - xPoints[i]) >= distance) {
115 // Create at least a small segment for last point. 113 // Create at least a small segment for last point.
147 double [] xPoints = points[0]; 145 double [] xPoints = points[0];
148 double [] yPoints = points[1]; 146 double [] yPoints = points[1];
149 for (int i = 0; i < xPoints.length; i++) { 147 for (int i = 0; i < xPoints.length; i++) {
150 if (skipNANs && 148 if (skipNANs &&
151 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) { 149 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) {
152 log.warn ("Skipping NaN in StyledSeriesBuilder.");
153 continue; 150 continue;
154 } 151 }
155 series.add(xPoints[i], factorY * (transY+yPoints[i]), false); 152 series.add(xPoints[i], factorY * (transY+yPoints[i]), false);
156 } 153 }
157 } 154 }
171 double [] xPoints = points[0]; 168 double [] xPoints = points[0];
172 double [] yPoints = points[1]; 169 double [] yPoints = points[1];
173 for (int i = 0; i < xPoints.length; i++) { 170 for (int i = 0; i < xPoints.length; i++) {
174 if (skipNANs && 171 if (skipNANs &&
175 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) { 172 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) {
176 log.warn ("Skipping NaN in StyledSeriesBuilder.");
177 continue; 173 continue;
178 } 174 }
179 series.add(xPoints[i], yPoints[i], false); 175 series.add(xPoints[i], yPoints[i], false);
180 } 176 }
181 } 177 }

http://dive4elements.wald.intevation.org