changeset 7342:c9b9176b0530 double-precision

WST-Parser: check consistence of station ordering in file.
author Tom Gottfried <tom@intevation.de>
date Tue, 15 Oct 2013 19:19:45 +0200
parents 588b02a4078a
children d93bb557a94f
files backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java	Tue Oct 15 19:18:44 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java	Tue Oct 15 19:19:45 2013 +0200
@@ -338,6 +338,15 @@
                         continue;
                     }
 
+                    // check consistence of station ordering in file
+                    if (kmHist2 != null && 
+                        kmHist2.compareTo(kmHist1) != kmHist1.compareTo(kaem)) {
+                        throw new ParseException("Stations in " + file + 
+                            " near line " + in.getLineNumber() + 
+                            " not ordered. File rejected.");
+		    }
+
+                    // remember stations in two previous lines
                     kmHist2 = kmHist1;
                     kmHist1 = kaem;
 

http://dive4elements.wald.intevation.org