# HG changeset patch # User Sascha L. Teichmann # Date 1350302627 -7200 # Node ID ac93f397018def7bc55bd0fcce8f68cd94c88a08 # Parent 9c78264109ad93820add168769d72ee4466b4425 Importer: Ignore historical discharge tables. diff -r 9c78264109ad -r ac93f397018d flys-backend/ChangeLog --- a/flys-backend/ChangeLog Mon Oct 15 12:00:28 2012 +0200 +++ b/flys-backend/ChangeLog Mon Oct 15 14:03:47 2012 +0200 @@ -1,6 +1,18 @@ +2012-10-15 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/importer/Config.java: + Added new flag 'flys.backend.skip.historical.discharge.tables' + to ignore the historical discharge tables during gauge import. + + * src/main/java/de/intevation/flys/importer/ImportGauge.java: + Ignore the historical discharge tables if flag is set. + + * contrib/run_hydr_morph.sh: Adjusted shell script. + * doc/documentation/de/importer-hydr-morph.tex: Adjusted docu. + 2012-09-30 Sascha L. Teichmann - * .hgignore: First hgignore + * .hgignore: First hgignore 2012-09-28 Ingo Weinzierl diff -r 9c78264109ad -r ac93f397018d flys-backend/contrib/run_hydr_morph.sh --- a/flys-backend/contrib/run_hydr_morph.sh Mon Oct 15 12:00:28 2012 +0200 +++ b/flys-backend/contrib/run_hydr_morph.sh Mon Oct 15 14:03:47 2012 +0200 @@ -25,6 +25,7 @@ IMPORTER_ANNOTATION_TYPES="conf/annotation-types.xml" IMPORTER_SKIP_GAUGES=false +IMPORTER_SKIP_HISTORICAL_DISCHARGE_GAUGES=false IMPORTER_SKIP_ANNOTATIONS=false IMPORTER_SKIP_WST=false IMPORTER_SKIP_PRFS=false @@ -76,6 +77,7 @@ -Dflys.backend.main.value.types=$IMPORTER_MAINVALUE_TYPES \ -Dflys.backend.importer.annotation.types=$IMPORTER_ANNOTATION_TYPES \ -Dflys.backend.importer.dry.run=$IMPORTER_DRY_RUN \ + -Dflys.backend.importer.skip.historical.discharge.tables=$IMPORTER_SKIP_HISTORICAL_DISCHARGE_GAUGES \ -Dflys.backend.importer.skip.gauges=$IMPORTER_SKIP_GAUGES \ -Dflys.backend.importer.skip.annotations=$IMPORTER_SKIP_ANNOTATIONS \ -Dflys.backend.importer.skip.prfs=$IMPORTER_SKIP_PRFS \ diff -r 9c78264109ad -r ac93f397018d flys-backend/doc/documentation/de/importer-hydr-morph.tex --- a/flys-backend/doc/documentation/de/importer-hydr-morph.tex Mon Oct 15 12:00:28 2012 +0200 +++ b/flys-backend/doc/documentation/de/importer-hydr-morph.tex Mon Oct 15 14:03:47 2012 +0200 @@ -59,6 +59,12 @@ ausgelesen. Es werden nur *.sta-Datei von Pegeln geladen, die in der .glt-Datei vermerkt sind. +\subsubsection{Historische Abflusstafeln (*.at-Dateien)} +Der Import von historischen Abflusstafeln kann mit +\textbf{'-Dflys.backend.importer.skip.historical.discharge.tables=true'} +unterdrückt werden. Diese Flagge wird nur ausgewertet, wenn überhaupt +Pegel-Daten (siehe oben) importiert werden. + Mittels \textbf{-Dflys.backend.sta.parse.gauge.numbers=true'} wird versucht, die offiziellen Pegelnummern aus den Stammdaten zu extrahieren. \textbf{Dies ist mit Vorsicht zu behandeln, denn die meisten STA-Dateien diff -r 9c78264109ad -r ac93f397018d flys-backend/src/main/java/de/intevation/flys/importer/Config.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/Config.java Mon Oct 15 12:00:28 2012 +0200 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/Config.java Mon Oct 15 14:03:47 2012 +0200 @@ -17,6 +17,9 @@ public static final String SKIP_GAUGES = "flys.backend.importer.skip.gauges"; + public static final String SKIP_HISTORICAL_DISCHARGE_TABLES = + "flys.backend.importer.skip.historical.discharge.tables"; + public static final String SKIP_ANNOTATIONS = "flys.backend.importer.skip.annotations"; @@ -100,6 +103,10 @@ return getFlag(SKIP_GAUGES); } + public boolean skipHistoricalDischargeTables() { + return getFlag(SKIP_HISTORICAL_DISCHARGE_TABLES); + } + public boolean skipAnnotations() { return getFlag(SKIP_ANNOTATIONS); } diff -r 9c78264109ad -r ac93f397018d flys-backend/src/main/java/de/intevation/flys/importer/ImportGauge.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportGauge.java Mon Oct 15 12:00:28 2012 +0200 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportGauge.java Mon Oct 15 14:03:47 2012 +0200 @@ -162,6 +162,11 @@ } public void parseHistoricalDischargeTables() throws IOException { + if (Config.INSTANCE.skipHistoricalDischargeTables()) { + log.info("skip historical discharge tables"); + return; + } + log.info("parse historical discharge tables"); File riverDir = atFile.getParentFile().getParentFile();