changeset 8561:2b3c8ea6cbee

Accept more elevation system names (e.g. with hyphen).
author "Tom Gottfried <tom@intevation.de>"
date Mon, 16 Feb 2015 12:12:12 +0100
parents 6fcf4717605f
children c62837ba37f3
files backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java backend/src/main/java/org/dive4elements/river/model/BedHeight.java backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Mon Feb 16 11:48:05 2015 +0100
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Mon Feb 16 12:12:12 2015 +0100
@@ -69,10 +69,10 @@
         Pattern.compile("^Lagesystem: (.*).*");
 
     public static final Pattern META_CUR_ELEVATION_SYSTEM =
-        Pattern.compile("^H.hensystem:\\s(\\w++) (.* )??\\[(.*)\\].*");
+        Pattern.compile("^H.hensystem:\\s(.*)?? \\[(.*)\\].*");
 
     public static final Pattern META_OLD_ELEVATION_SYSTEM =
-        Pattern.compile("^urspr.ngliches H.hensystem:\\s(\\w++) (.* )??\\[(.*)\\].*");
+        Pattern.compile("^urspr.ngliches H.hensystem:\\s(.*)?? \\[(.*)\\].*");
 
     public static final Pattern META_RANGE =
         Pattern.compile("^Strecke:\\D*(\\d++.?\\d*) ?- ?(\\d++.?\\d*).*");
@@ -348,11 +348,10 @@
 
         if (m.matches()) {
             String name = m.group(1);
-            String num  = m.group(2);
-            String unit = m.group(3);
+            String unit = m.group(2);
 
             obj.setCurElevationModel(new ImportElevationModel(
-                name + " " + num,
+                name,
                 new ImportUnit(unit)
             ));
 
@@ -371,11 +370,10 @@
 
         if (m.matches()) {
             String name = m.group(1);
-            String num  = m.group(2);
-            String unit = m.group(3);
+            String unit = m.group(2);
 
             obj.setOldElevationModel(new ImportElevationModel(
-                name + " " + num,
+                name,
                 new ImportUnit(unit)
             ));
 

http://dive4elements.wald.intevation.org