diff flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentDensityParser.java @ 5441:7c1dd9c3f6bd

remove unit from sediment density and depths (always t/m3 respectively cm, otherwise a typo)
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 26 Mar 2013 19:29:39 +0100
parents 3694d8f48e16
children b3dd14fc13a6
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentDensityParser.java	Tue Mar 26 18:06:42 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentDensityParser.java	Tue Mar 26 19:29:39 2013 +0100
@@ -20,7 +20,6 @@
 import de.intevation.flys.importer.ImportDepth;
 import de.intevation.flys.importer.ImportSedimentDensity;
 import de.intevation.flys.importer.ImportSedimentDensityValue;
-import de.intevation.flys.importer.ImportUnit;
 import de.intevation.flys.utils.DateGuesser;
 
 
@@ -34,9 +33,6 @@
     public static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE);
 
 
-    public static final Pattern META_UNIT =
-        Pattern.compile("^Einheit: \\[(.*)\\].*");
-
     public static final Pattern META_DEPTH =
         Pattern.compile("^Tiefe: (\\w++)-(\\w++)( (\\w++))?.*");
 
@@ -86,10 +82,7 @@
 
 
     protected void handleMetaLine(String line) {
-        if (handleMetaUnit(line)) {
-            return;
-        }
-        else if (handleMetaDepth(line)) {
+        if (handleMetaDepth(line)) {
             return;
         }
         else if (handleMetaColumns(line)) {
@@ -113,36 +106,19 @@
     }
 
 
-    protected boolean handleMetaUnit(String line) {
-        Matcher m = META_UNIT.matcher(line);
-
-        if (m.matches()) {
-            String unit = m.group(1);
-
-            current.setUnit(new ImportUnit(unit));
-
-            return true;
-        }
-
-        return false;
-    }
-
-
     protected boolean handleMetaDepth(String line) {
         Matcher m = META_DEPTH.matcher(line);
 
         if (m.matches()) {
             String lo   = m.group(1);
             String up   = m.group(2);
-            String unit = m.group(4);
 
-            log.info("Found sediment density depth: " + lo + " - " + up + " " + unit);
+            log.info("Found sediment density depth: " + lo + " - " + up + " cm");
 
             try {
                 ImportDepth depth = new ImportDepth(
                     new BigDecimal(nf.parse(lo).doubleValue()),
-                    new BigDecimal(nf.parse(up).doubleValue()),
-                    new ImportUnit(unit)
+                    new BigDecimal(nf.parse(up).doubleValue())
                 );
 
                 current.setDepth(depth);

http://dive4elements.wald.intevation.org