[PATCH 31 of 45] Accept more elevation system names (e.g. with hyphen)
Wald Commits
scm-commit at wald.intevation.org
Tue Mar 10 17:05:59 CET 2015
# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1424085132 -3600
# Node ID 2b3c8ea6cbee14fbaed6a81bbbcf3938d2d7fc25
# Parent 6fcf4717605fbc24a7d4b5b4004288e5ef555b88
Accept more elevation system names (e.g. with hyphen).
diff -r 6fcf4717605f -r 2b3c8ea6cbee backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java
--- 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)
));
More information about the Dive4Elements-commits
mailing list