changeset 5810:dba9e1fa233e

ImportRiver: Trigger w80csv-parsing.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 24 Apr 2013 12:07:03 +0200
parents 53fcc0d5a03e
children 67e07c29dd29
files flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java
diffstat 1 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Wed Apr 24 12:04:25 2013 +0200
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Wed Apr 24 12:07:03 2013 +0200
@@ -22,6 +22,7 @@
 import de.intevation.flys.importer.parsers.SedimentDensityParser;
 import de.intevation.flys.importer.parsers.SedimentYieldParser;
 import de.intevation.flys.importer.parsers.W80Parser;
+import de.intevation.flys.importer.parsers.W80CSVParser;
 import de.intevation.flys.importer.parsers.WaterlevelDifferencesParser;
 import de.intevation.flys.importer.parsers.WaterlevelParser;
 import de.intevation.flys.importer.parsers.WstParser;
@@ -288,6 +289,7 @@
         parseDA66s();
         parseDA50s();
         parseW80s();
+        parseW80CSVs();
         parseHYKs();
         parseWst();
         parseExtraWsts();
@@ -1005,6 +1007,29 @@
         parser.parseW80s(riverDir, w80Callback);
     }
 
+    /** Create a W80 Parser and parse w80 files found. */
+    public void parseW80CSVs() {
+        if (Config.INSTANCE.skipW80CSVs()) {
+            log.info("skip parsing W80 csvs");
+            return;
+        }
+        W80CSVParser parser = new W80CSVParser();
+        File riverDir = wstFile
+            .getParentFile()  // Basisdaten
+            .getParentFile()  // Hydrologie
+            .getParentFile(); // <river>
+
+        // Construct the Cross-Section-Data path.
+        File csDir = new File(riverDir.getPath()
+            + File.separator + "Geodaesie"
+            + File.separator + "Querprofile"
+            + File.separator + "QP-Daten");
+
+        ImportRiverCrossSectionParserCallback w80CSVCallback =
+            new ImportRiverCrossSectionParserCallback("w80-csv");
+        parser.parseW80CSVs(csDir, w80CSVCallback);
+    }
+
 
     /**
      * Create and use a DA50Parser, parse the files found, add the
@@ -1118,7 +1143,11 @@
     }
 
     public void storeCrossSections() {
-        if (!Config.INSTANCE.skipPRFs() || !Config.INSTANCE.skipDA66s() || !Config.INSTANCE.skipDA50s() || !Config.INSTANCE.skipW80s()) {
+        if (!Config.INSTANCE.skipPRFs()
+            || !Config.INSTANCE.skipDA66s()
+            || !Config.INSTANCE.skipDA50s()
+            || !Config.INSTANCE.skipW80s()
+            || !Config.INSTANCE.skipW80CSVs()) {
             log.info("store cross sections");
             getPeer();
             for (ImportCrossSection crossSection: crossSections) {

http://dive4elements.wald.intevation.org