Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/HYKParser.java @ 1225:d859c4bc6ace
HYK Importer: Check if zone coordinates in HYKs are swapped and warn the user.
flys-backend/trunk@2356 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 18 Jul 2011 16:55:32 +0000 |
parents | ca7d461a53f1 |
children | c5c48f52dc7b |
comparison
equal
deleted
inserted
replaced
1224:ca7d461a53f1 | 1225:d859c4bc6ace |
---|---|
236 log.error("cannot parse number in line " + | 236 log.error("cannot parse number in line " + |
237 in.getLineNumber()); | 237 in.getLineNumber()); |
238 return false; | 238 return false; |
239 } | 239 } |
240 for (int i = 0; i < coords.length; ++i) { | 240 for (int i = 0; i < coords.length; ++i) { |
241 BigDecimal a = coords[i]; | |
242 BigDecimal b = coords[i == coords.length-1 ? i : i+1]; | |
243 if (a.compareTo(b) > 0) { | |
244 log.warn("zone coordinates swapped in line " + | |
245 in.getLineNumber()); | |
246 BigDecimal c = a; a = b; b = c; | |
247 } | |
241 ImportHYKFlowZone zone = new ImportHYKFlowZone( | 248 ImportHYKFlowZone zone = new ImportHYKFlowZone( |
242 formation, | 249 formation, fzts[i], a, b); |
243 fzts[i], | |
244 coords[i], | |
245 coords[i == coords.length-1 ? i : i+1]); | |
246 formation.addFlowZone(zone); | 250 formation.addFlowZone(zone); |
247 } | 251 } |
248 state = State.LINE_6; | 252 state = State.LINE_6; |
249 break; | 253 break; |
250 | 254 |