# HG changeset patch # User Sascha L. Teichmann # Date 1304588713 0 # Node ID e960098b139894a052f64c5ffe6986b01c199115 # Parent b316d2106598bcbb79b57e862d3390893ea14f12 Importer: Ignore lines that contain km positions which were found before in the same WST file. flys-backend/trunk@1833 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r b316d2106598 -r e960098b1398 flys-backend/ChangeLog --- a/flys-backend/ChangeLog Thu May 05 06:04:57 2011 +0000 +++ b/flys-backend/ChangeLog Thu May 05 09:45:13 2011 +0000 @@ -1,3 +1,9 @@ +2011-05-05 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/importer/WstParser.java: + Ignore lines that contain km positions which were found + before in the same file. + 2011-05-05 Ingo Weinzierl * src/main/java/de/intevation/flys/model/River.java: Added a method that diff -r b316d2106598 -r e960098b1398 flys-backend/src/main/java/de/intevation/flys/importer/WstParser.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/WstParser.java Thu May 05 06:04:57 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/WstParser.java Thu May 05 09:45:13 2011 +0000 @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.io.File; import java.io.IOException; @@ -90,7 +91,7 @@ String einheit = "Wasserstand [NN + m]"; - //HashMap oldEscapeLine = null; + HashSet kms = new HashSet(); while ((input = in.readLine()) != null) { String line = input; @@ -231,6 +232,14 @@ BigDecimal kaem = data[0]; + if (!kms.add(kaem)) { + log.warn( + "km " + kaem + + " (line " + in.getLineNumber() + + ") found more than once. -> ignored"); + continue; + } + if (kaem.compareTo(minKm) < 0) { minKm = kaem; }