Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java @ 6234:02ea1c3fba8c
Fix export at river km's for issue1275
Rrenkert explained that the intention was to scale the
Waterlevels because they should be in centimeters at a gauge
and in meters otherwise.
This appears very strange to me and should be clarified.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 07 Jun 2013 17:09:26 +0200 |
parents | 715e010d40de |
children | 152e1ba8e5bd |
comparison
equal
deleted
inserted
replaced
6233:a8613826bcac | 6234:02ea1c3fba8c |
---|---|
158 String river, | 158 String river, |
159 double km, | 159 double km, |
160 String gName, | 160 String gName, |
161 BigDecimal datum, | 161 BigDecimal datum, |
162 Date date, | 162 Date date, |
163 double scale) | 163 boolean wOutUnitIsMeter) |
164 throws IOException | 164 throws IOException |
165 { | 165 { |
166 PrintWriter out = new PrintWriter(writer); | 166 PrintWriter out = new PrintWriter(writer); |
167 | 167 |
168 // A header is required, because the desktop version of FLYS will skip | 168 // A header is required, because the desktop version of FLYS will skip |
184 } | 184 } |
185 | 185 |
186 int col = 0; | 186 int col = 0; |
187 for (double w = startW; w <= maxW; w += 0.01) { | 187 for (double w = startW; w <= maxW; w += 0.01) { |
188 if (col == 0) { | 188 if (col == 0) { |
189 out.printf(Locale.US, "%8d", (int)Math.round(w * scale)); | 189 if (wOutUnitIsMeter) { |
190 // For some crazy reason W's at a gauge should be in the | |
191 // unit but W's exported elsewhere should be in Meter | |
192 out.printf(Locale.US, "%5.2f", w); | |
193 } else { | |
194 out.printf(Locale.US, "%8d", (int)Math.round(w * 100d)); | |
195 } | |
190 } | 196 } |
191 | 197 |
192 if (w < minW) { | 198 if (w < minW) { |
193 out.print(EMPTY); | 199 out.print(EMPTY); |
194 } | 200 } |