annotate backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 8971:50416a0df385

Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
author mschaefer
date Tue, 03 Apr 2018 10:18:30 +0200
parents 5e38e2924c07
children ae76f618d990
rev   line source
5844
4dd33b86dc61 Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4dd33b86dc61 Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4dd33b86dc61 Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5992
4c3ccf2b0304 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5844
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5844
4dd33b86dc61 Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5992
4c3ccf2b0304 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5844
diff changeset
6 * documentation coming with Dive4Elements River for details.
5844
4dd33b86dc61 Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4dd33b86dc61 Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
9 package org.dive4elements.river.importer;
5446
3bd786772798 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5427
diff changeset
10
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
11 import java.io.File;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
12 import java.io.FilenameFilter;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
13 import java.io.IOException;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
14 import java.util.ArrayList;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
15 import java.util.Calendar;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
16 import java.util.Date;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
17 import java.util.HashSet;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
18 import java.util.Iterator;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
19 import java.util.List;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
20 import java.util.Map;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
21 import java.util.Set;
5446
3bd786772798 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5427
diff changeset
22
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
23 import org.apache.log4j.Logger;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
24 import org.dive4elements.artifacts.common.utils.FileTools;
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
25 import org.dive4elements.artifacts.common.utils.FileTools.HashedFile;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
26 import org.dive4elements.river.backend.utils.DouglasPeuker;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
27 import org.dive4elements.river.importer.parsers.AbstractSedimentLoadParser;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
28 import org.dive4elements.river.importer.parsers.AnnotationClassifier;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
29 import org.dive4elements.river.importer.parsers.AnnotationsParser;
8557
29ab66ce06aa Abstract parser for bed heights is obsolete.
"Tom Gottfried <tom@intevation.de>"
parents: 8556
diff changeset
30 import org.dive4elements.river.importer.parsers.BedHeightParser;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
31 import org.dive4elements.river.importer.parsers.CrossSectionParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
32 import org.dive4elements.river.importer.parsers.DA50Parser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
33 import org.dive4elements.river.importer.parsers.DA66Parser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
34 import org.dive4elements.river.importer.parsers.FlowVelocityMeasurementParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
35 import org.dive4elements.river.importer.parsers.FlowVelocityModelParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
36 import org.dive4elements.river.importer.parsers.HYKParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
37 import org.dive4elements.river.importer.parsers.MeasurementStationsParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
38 import org.dive4elements.river.importer.parsers.MorphologicalWidthParser;
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
39 import org.dive4elements.river.importer.parsers.OfficialLinesConfigParser;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
40 import org.dive4elements.river.importer.parsers.PRFParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
41 import org.dive4elements.river.importer.parsers.PegelGltParser;
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
42 import org.dive4elements.river.importer.parsers.PorosityParser;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
43 import org.dive4elements.river.importer.parsers.SQRelationParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
44 import org.dive4elements.river.importer.parsers.SedimentDensityParser;
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7918
diff changeset
45 import org.dive4elements.river.importer.parsers.SedimentLoadLSParser;
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
46 import org.dive4elements.river.importer.parsers.SedimentLoadParser;
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
47 import org.dive4elements.river.importer.parsers.W80CSVParser;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
48 import org.dive4elements.river.importer.parsers.W80Parser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
49 import org.dive4elements.river.importer.parsers.WaterlevelDifferencesParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
50 import org.dive4elements.river.importer.parsers.WaterlevelParser;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
51 import org.dive4elements.river.importer.parsers.WstParser;
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
52 import org.dive4elements.river.importer.sinfo.SInfoImporter;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
53 import org.dive4elements.river.importer.uinfo.UInfoImporter;
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
54 import org.dive4elements.river.model.River;
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
55 import org.dive4elements.river.model.Unit;
5446
3bd786772798 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5427
diff changeset
56 import org.hibernate.Query;
3bd786772798 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5427
diff changeset
57 import org.hibernate.Session;
3bd786772798 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5427
diff changeset
58
4706
e7b238247c4e Documentation added.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4678
diff changeset
59 /** Import all river-related data (files) that can be found. */
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
60 public class ImportRiver
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
61 {
8200
9d2e69f971f5 sed -i src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8187
diff changeset
62 /** Private log. */
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
63 private static Logger log = Logger.getLogger(ImportRiver.class);
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
64
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
65 public static final String PEGEL_GLT = "PEGEL.GLT";
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
66
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
67 public static final String FIXATIONS = "Fixierungen";
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
68
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
69 public static final String EXTRA_LONGITUDINALS =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
70 "Zus.Laengsschnitte";
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
71
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
72 public static final String [] OFFICIAL_LINES_FOLDERS = {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
73 "Basisdaten",
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
74 "Fixierungen" };
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
75
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
76 public static final String OFFICIAL_LINES =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
77 "Amtl_Linien.wst";
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
78
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
79 public static final String OFFICIAL_LINES_CONFIG =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
80 "Amtl_Linien.config";
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
81
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
82 public static final String FLOOD_WATER = "HW-Marken";
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
83
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
84 public static final String FLOOD_PROTECTION =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
85 "HW-Schutzanlagen";
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
86
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
87 public static final String MINFO_DIR = "Morphologie";
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
88
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
89 public static final String BED_HEIGHT_DIR = "Sohlhoehen";
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
90
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
91 public static final String BED_HEIGHT_SINGLE_DIR = "Einzeljahre";
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
92
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
93 public static final String SEDIMENT_DENSITY_DIR = "Sedimentdichte";
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
94
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
95 public static final String POROSITY_DIR = "Porositaet";
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
96
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
97 public static final String MORPHOLOGICAL_WIDTH_DIR =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
98 "morphologische_Breite";
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
99
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
100 public static final String FLOW_VELOCITY_DIR =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
101 "Geschwindigkeit_Schubspannung";
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
102
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
103 public static final String FLOW_VELOCITY_MODEL = "Modellrechnungen";
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
104
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
105 public static final String FLOW_VELOCITY_MEASUREMENTS = "v-Messungen";
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
106
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
107 public static final String SEDIMENT_LOAD_DIR = "Fracht";
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
108
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
109 public static final String SEDIMENT_LOAD_LS_DIR = "Laengsschnitte";
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
110
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
111 public static final String SEDIMENT_LOAD_MS_DIR = "Messstellen";
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
112
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
113 public static final String SEDIMENT_LOAD_SINGLE_DIR = "Einzeljahre";
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
114
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
115 public static final String SEDIMENT_LOAD_EPOCH_DIR = "Epochen";
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
116
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
117 public static final String SEDIMENT_LOAD_OFF_EPOCH_DIR =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
118 "amtliche Epochen";
6724
0baf7abffcc6 issue1393/ImportRiver: Import official epochs from directory, minor refac.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6347
diff changeset
119
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
120 public static final String MINFO_FIXATIONS_DIR = "Fixierungsanalyse";
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
121
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
122 public static final String MINFO_WATERLEVELS_DIR = "Wasserspiegellagen";
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
123
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
124 public static final String MINFO_WATERLEVEL_DIFF_DIR =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
125 "Wasserspiegeldifferenzen";
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
126
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
127 public static final String MINFO_BASE_DIR = "Basisdaten";
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
128
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
129 public static final String MINFO_CORE_DATA_FILE =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
130 "Stammdaten_Messstellen.csv";
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
131
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
132 public static final String MINFO_SQ_DIR =
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
133 "Feststofftransport-Abfluss-Beziehung";
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
134
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135 protected String name;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136
7751
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
137 protected String modelUuid;
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
138
5020
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
139 protected Long officialNumber;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
141 /**
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
142 * Path of the river/Hydrologie/Basisdaten/river.wst file from which all other file paths are derived
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
143 */
5020
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
144 protected File wstFile;
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
145
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
146 protected File bbInfoFile;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
147
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
148 protected List<ImportGauge> gauges;
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
149
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
150 protected List<ImportAnnotation> annotations;
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
151
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
152 protected List<ImportHYK> hyks;
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
153
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
154 protected List<ImportCrossSection> crossSections;
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
155
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
156 protected List<ImportWst> extraWsts;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
157
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
158 protected List<ImportWst> fixations;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
159
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
160 protected List<ImportWst> officialLines;
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
161
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
162 protected List<ImportWst> floodWater;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
163
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
164 protected List<ImportWst> floodProtection;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
165
5261
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
166 /** Wst-structures from waterlevel-csv files. */
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
167 protected List<ImportWst> waterlevels;
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
168
5227
a981222b6260 ImportRiver: Preparing wst-based waterleveldifferences.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5149
diff changeset
169 /** Wst-structures from waterlevel-difference-csv files. */
a981222b6260 ImportRiver: Preparing wst-based waterleveldifferences.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5149
diff changeset
170 protected List<ImportWst> waterlevelDifferences;
a981222b6260 ImportRiver: Preparing wst-based waterleveldifferences.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5149
diff changeset
171
8559
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
172 protected List<ImportBedHeight> bedHeights;
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
173
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
174 protected List<ImportSedimentDensity> sedimentDensities;
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
175
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
176 protected List<ImportPorosity> porosities;
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
177
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
178 protected List<ImportMorphWidth> morphologicalWidths;
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
179
2827
85b25e74594f Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2826
diff changeset
180 protected List<ImportFlowVelocityModel> flowVelocityModels;
85b25e74594f Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2826
diff changeset
181
2832
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
182 protected List<ImportFlowVelocityMeasurement> flowVelocityMeasurements;
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
183
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
184 protected List<ImportSedimentLoadLS> sedimentLoadLSs;
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
185
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
186 protected List<ImportSedimentLoad> sedimentLoads;
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
187
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
188 protected List<ImportMeasurementStation> measurementStations;
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
189
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
190 protected List<ImportSQRelation> sqRelations;
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
191
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
192 protected ImportWst wst;
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
193
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
194 protected ImportUnit wstUnit;
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
195
765
763c4137d6e1 Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 503
diff changeset
196 protected AnnotationClassifier annotationClassifier;
763c4137d6e1 Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 503
diff changeset
197
5017
51a353887871 Tiny doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5016
diff changeset
198 /** Database-mapped River instance. */
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
199 protected River peer;
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
200
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
201 /**
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
202 * Importer for a river's S-INFO files.
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
203 */
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
204 private final SInfoImporter sinfoImporter;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
205
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
206 /**
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
207 * Importer for a river's U-INFO files.
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
208 */
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
209 private final UInfoImporter uinfoImporter;
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
210
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
211 /** Callback-implementation for CrossSectionParsers. */
5083
7bbee0cfc171 Added experimental Douglas Peuker simplification of cross sections.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4808
diff changeset
212 private class ImportRiverCrossSectionParserCallback
7bbee0cfc171 Added experimental Douglas Peuker simplification of cross sections.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4808
diff changeset
213 implements CrossSectionParser.Callback {
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
214
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
215 private final Set<HashedFile> files = new HashSet<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
216 private final String type;
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
217
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
218 /**
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
219 * Create new Callback, given type which is used for logging
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
220 * purposes only.
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
221 */
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
222 public ImportRiverCrossSectionParserCallback(final String type) {
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
223 this.type = type;
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
224 }
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
225
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
226
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
227 /** Accept file if not duplicate. */
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
228 @Override
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
229 public boolean accept(final File file) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
230 final HashedFile hf = new HashedFile(file);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
231 final boolean success = this.files.add(hf);
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
232 if (!success) {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
233 log.warn(this.type + " file '" + file
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
234 + "' seems to be a duplicate.");
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
235 }
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
236 return success;
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
237 }
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
238
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
239
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
240 /** Add crosssection. */
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
241 @Override
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
242 public void parsed(final CrossSectionParser parser) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
243 log.debug("callback from " + this.type + " parser");
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
244
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
245 final String description = parser.getDescription();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
246 final Integer year = parser.getYear();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
247 final ImportTimeInterval ti = year != null
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
248 ? new ImportTimeInterval(yearToDate(year))
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
249 : null;
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
250
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
251 final Map<Double, List<XY>> data = parser.getData();
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
252
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
253 final List<ImportCrossSectionLine> lines =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
254 new ArrayList<>(data.size());
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
255
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
256 final Double simplificationEpsilon =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
257 Config.INSTANCE.getCrossSectionSimplificationEpsilon();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
258
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
259 long numReadPoints = 0L;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
260 long numRemainingPoints = 0L;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
261
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
262 for (final Map.Entry<Double, List<XY>> entry: data.entrySet()) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
263 final Double km = entry.getKey();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
264 List<XY> points = entry.getValue();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
265 numReadPoints += points.size();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
266 if (simplificationEpsilon != null) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
267 points = DouglasPeuker.simplify(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
268 points, simplificationEpsilon);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
269 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
270 numRemainingPoints += points.size();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
271 lines.add(new ImportCrossSectionLine(km, points));
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
272 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
273
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
274 ImportRiver.this.addCrossSections(description, ti, lines);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
275
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
276 if (simplificationEpsilon != null) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
277 final double percent = numReadPoints > 0L
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
278 ? ((double)numRemainingPoints/numReadPoints)*100d
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
279 : 0d;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
280
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
281 log.info(String.format(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
282 "Number of points in cross section: %d / %d (%.2f%%)",
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
283 numReadPoints, numRemainingPoints, percent));
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
284 }
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
285 }
5149
3b58bb0c55e3 Removed trailing white space
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5080
diff changeset
286 } // ImportRiverCrossSectionParserCallback
4778
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
287
a70de5298248 ImportRiver: Add helper implementation of a CrossSectionParserCallback.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4767
diff changeset
288
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
289 private void addCrossSections(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
290 final String description,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
291 final ImportTimeInterval ti,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
292 final List<ImportCrossSectionLine> lines
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
293 ) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
294 this.crossSections.add(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
295 new ImportCrossSection(this, description, ti, lines));
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
296 }
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
297
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
298
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
299 public ImportRiver() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
300 this.hyks = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
301 this.crossSections = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
302 this.extraWsts = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
303 this.fixations = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
304 this.officialLines = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
305 this.floodWater = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
306 this.waterlevels = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
307 this.waterlevelDifferences = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
308 this.floodProtection = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
309 this.sedimentDensities = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
310 this.porosities = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
311 this.morphologicalWidths = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
312 this.flowVelocityModels = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
313 this.flowVelocityMeasurements =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
314 new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
315 this.sedimentLoadLSs = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
316 this.sedimentLoads = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
317 this.measurementStations = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
318 this.sqRelations = new ArrayList<>();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
319 this.sinfoImporter = new SInfoImporter();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
320 this.uinfoImporter = new UInfoImporter();
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
321 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
322
766
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
323 public ImportRiver(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
324 final String name,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
325 final String modelUuid,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
326 final File wstFile,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
327 final File bbInfoFile,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
328 final AnnotationClassifier annotationClassifier
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
329 ) {
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
330 this();
766
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
331 this.name = name;
7751
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
332 this.modelUuid = modelUuid;
766
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
333 this.wstFile = wstFile;
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
334 this.bbInfoFile = bbInfoFile;
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
335 this.annotationClassifier = annotationClassifier;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
336 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
337
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
338 public String getName() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
339 return this.name;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
340 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
341
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
342 public void setName(final String name) {
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
343 this.name = name;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
344 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
345
7751
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
346 public String getModelUuid() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
347 return this.modelUuid;
7751
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
348 }
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
349
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
350 public void setModelUuid(final String modelUuid) {
7751
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
351 this.modelUuid = modelUuid;
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
352 }
24408bce2fdb Parse and import model_uuid for rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 7735
diff changeset
353
5020
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
354 public Long getOfficialNumber() {
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
355 return this.officialNumber;
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
356 }
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
357
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
358 public void setOfficialNumber(final Long officialNumber) {
5020
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
359 this.officialNumber = officialNumber;
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
360 }
443c173f043a ImportRiver: Added officialNumber field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5017
diff changeset
361
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
362 public File getWstFile() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
363 return this.wstFile;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
364 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
365
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
366 public void setWstFile(final File wstFile) {
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
367 this.wstFile = wstFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
368 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
369
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
370 public File getBBInfo() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
371 return this.bbInfoFile;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
372 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
373
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
374 public void setBBInfo(final File bbInfoFile) {
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
375 this.bbInfoFile = bbInfoFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
376 }
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
377
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
378 public ImportWst getWst() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
379 return this.wst;
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
380 }
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
381
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
382 public void setWst(final ImportWst wst) {
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
383 this.wst = wst;
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
384 }
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
385
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
386 private File getMinfoDir() {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
387 return new File(getRiverDir(), MINFO_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
388 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
389
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
390 private File getRiverDir() {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
391 return this.wstFile.getParentFile().getParentFile().getParentFile();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
392 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
393
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
394 public void parseDependencies() throws IOException {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
395 log.info("Root dir is '" + getRiverDir() + "'");
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
396 parseGauges();
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
397 parseAnnotations();
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
398 parsePRFs();
4712
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
399 parseDA66s();
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
400 parseDA50s();
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
401 parseW80s();
5810
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
402 parseW80CSVs();
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
403 parseHYKs();
197
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
404 parseWst();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
405 parseExtraWsts();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
406 parseFixations();
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
407 parseOfficialLines();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
408 parseFloodWater();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
409 parseFloodProtection();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
410 parseMeasurementStations();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
411 parseBedHeight();
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
412 parseSedimentDensity();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
413 parsePorosity();
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
414 parseMorphologicalWidth();
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
415 parseFlowVelocity();
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
416 parseSedimentLoadLS();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
417 parseSedimentLoad();
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
418 parseWaterlevels();
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
419 parseWaterlevelDifferences();
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
420 parseSQRelation();
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
421 this.sinfoImporter.setup(getRiverDir(), this);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
422 this.sinfoImporter.parse();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
423 this.uinfoImporter.setup(getRiverDir(), this);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
424 this.uinfoImporter.parse();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
425 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
426
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
427 public void parseFloodProtection() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
428 if (Config.INSTANCE.skipFloodProtection()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
429 log.info("skip parsing flood protection");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
430 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
431 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
432
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
433 log.info("Parse flood protection wst file");
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
434
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
435 final File riverDir = this.wstFile.getParentFile().getParentFile();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
436
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
437 final File dir = FileTools.repair(new File(riverDir, FLOOD_PROTECTION));
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
438
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
439 if (!dir.isDirectory() || !dir.canRead()) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
440 log.info("no directory '" + dir + "' found");
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
441 return;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
442 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
443
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
444 final File [] files = dir.listFiles();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
445
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
446 if (files == null) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
447 log.warn("cannot read '" + dir + "'");
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
448 return;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
449 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
450
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
451 for (final File file: files) {
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
452 if (!file.isFile() || !file.canRead()) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
453 continue;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
454 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
455 final String name = file.getName().toLowerCase();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
456 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
457 continue;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
458 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
459 log.info("found file '" + file.getName() + "'");
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
460 try {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
461 final WstParser wstParser = new WstParser();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
462 wstParser.parse(file);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
463 final ImportWst iw = wstParser.getWst();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
464 iw.setKind(5);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
465 iw.setDescription(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
466 FLOOD_PROTECTION + "/" + iw.getDescription());
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
467 this.floodProtection.add(iw);
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
468 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
469 catch (final WstParser.ParseException e) {
7343
d93bb557a94f Do not log trace of WST-Parser parse exception and document it.
Tom Gottfried <tom@intevation.de>
parents: 7340
diff changeset
470 log.error(e.getMessage());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
471 }
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
472 }
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
473 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
474
5027
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
475 public void storeOfficialNumber() {
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
476 if (Config.INSTANCE.skipBWASTR()) {
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
477 log.info("skip storing official number.");
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
478 return;
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
479 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
480 getPeer().setOfficialNumber(this.officialNumber);
5027
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
481 }
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
482
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
483 public void parseBedHeight() throws IOException {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
484 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
485 final File bedHeightDir = new File(minfoDir, BED_HEIGHT_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
486 final File singlesDir = new File(bedHeightDir, BED_HEIGHT_SINGLE_DIR);
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
487
8559
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
488 if (Config.INSTANCE.skipBedHeight()) {
8762
86da84a95fac Clean up a few debug messages.
Tom Gottfried <tom@intevation.de>
parents: 8641
diff changeset
489 log.info("skip parsing bed heights.");
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
490 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
491 else {
8762
86da84a95fac Clean up a few debug messages.
Tom Gottfried <tom@intevation.de>
parents: 8641
diff changeset
492 log.info("Parse bed heights.");
8559
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
493 parseBedHeights(singlesDir);
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
494 }
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
495 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
496
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
497
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
498 protected void parseSedimentDensity() throws IOException {
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
499 if (Config.INSTANCE.skipSedimentDensity()) {
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
500 log.info("skip parsing sediment density.");
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
501 return;
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
502 }
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
503
3327
bf8d9a4f4cd4 Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3320
diff changeset
504 log.debug("Parse sediment density");
bf8d9a4f4cd4 Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3320
diff changeset
505
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
506 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
507 final File sediment = new File(minfoDir, SEDIMENT_DENSITY_DIR);
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
508
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
509 final File[] files = sediment.listFiles();
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
510
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
511 if (files == null) {
3660
976ead36192d backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3659
diff changeset
512 log.warn("Cannot read directory '" + sediment + "'");
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
513 return;
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
514 }
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
515
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
516 final SedimentDensityParser parser = new SedimentDensityParser();
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
517
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
518 for (final File file: files) {
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
519 parser.parse(file);
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
520 }
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
521
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
522 this.sedimentDensities = parser.getSedimentDensities();
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
523
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
524 log.info("Parsed " + this.sedimentDensities.size()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
525 + " sediment densities.");
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
526 }
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
527
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
528 protected void parsePorosity() throws IOException {
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
529 if (Config.INSTANCE.skipPorosity()) {
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
530 log.info("skip parsing porosity.");
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
531 return;
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
532 }
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
533
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
534 log.debug("Parse porosity");
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
535
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
536 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
537 final File porosity = new File(minfoDir, POROSITY_DIR);
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
538
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
539 final File[] files = porosity.listFiles();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
540
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
541 if (files == null) {
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
542 log.warn("Cannot read directory '" + porosity + "'");
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
543 return;
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
544 }
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
545
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
546 final PorosityParser parser = new PorosityParser();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
547
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
548 for (final File file: files) {
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
549 parser.parse(file);
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
550 }
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
551
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
552 this.porosities = parser.getPorosities();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
553
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
554 log.info("Parsed " + this.porosities.size() + " porosities.");
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
555 }
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
556
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
557 protected void parseMorphologicalWidth() throws IOException {
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
558 if (Config.INSTANCE.skipMorphologicalWidth()) {
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
559 log.info("skip parsing morphological width.");
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
560 return;
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
561 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
562
3327
bf8d9a4f4cd4 Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3320
diff changeset
563 log.debug("Parse morphological width");
bf8d9a4f4cd4 Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3320
diff changeset
564
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
565 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
566 final File morphDir = new File(minfoDir, MORPHOLOGICAL_WIDTH_DIR);
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
567
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
568 final File[] files = morphDir.listFiles();
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
569
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
570 if (files == null) {
3660
976ead36192d backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3659
diff changeset
571 log.warn("Cannot read directory '" + morphDir + "'");
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
572 return;
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
573 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
574
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
575 final MorphologicalWidthParser parser = new MorphologicalWidthParser();
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
576
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
577 for (final File file: files) {
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
578 parser.parse(file);
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
579 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
580
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
581 this.morphologicalWidths = parser.getMorphologicalWidths();
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
582
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
583 log.info("Parsed " + this.morphologicalWidths.size()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
584 + " morph. widths files.");
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
585 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
586
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
587
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
588 protected void parseFlowVelocity() throws IOException {
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
589 if (Config.INSTANCE.skipFlowVelocity()) {
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
590 log.info("skip parsing flow velocity");
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
591 return;
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
592 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
593
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
594 log.debug("Parse flow velocity");
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
595
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
596 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
597 final File flowDir = new File(minfoDir, FLOW_VELOCITY_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
598 final File modelDir = new File(flowDir, FLOW_VELOCITY_MODEL);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
599 final File measureDir = new File(flowDir, FLOW_VELOCITY_MEASUREMENTS);
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
600
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
601 final File[] modelFiles = modelDir.listFiles();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
602 final File[] measureFiles = measureDir.listFiles();
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
603
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
604 if (modelFiles == null) {
3660
976ead36192d backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3659
diff changeset
605 log.warn("Cannot read directory '" + modelDir + "'");
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
606 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
607 else {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
608 final FlowVelocityModelParser parser = new FlowVelocityModelParser();
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2827
diff changeset
609
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
610 for (final File model: modelFiles) {
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
611 log.debug("Parse file '" + model + "'");
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2827
diff changeset
612 parser.parse(model);
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
613 }
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2827
diff changeset
614
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
615 this.flowVelocityModels = parser.getModels();
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
616 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
617
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
618 if (measureFiles == null) {
3660
976ead36192d backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3659
diff changeset
619 log.warn("Cannot read directory '" + measureDir + "'");
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
620 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
621 else {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
622 final FlowVelocityMeasurementParser parser =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
623 new FlowVelocityMeasurementParser();
2832
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
624
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
625 for (final File measurement: measureFiles) {
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
626 log.debug("Parse file '" + measurement + "'");
2832
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
627 parser.parse(measurement);
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
628 }
2832
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
629
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
630 this.flowVelocityMeasurements = parser.getMeasurements();
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
631 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
632 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
633
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
634
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
635 private void parseSedimentLoadFiles(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
636 final File[] files,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
637 final AbstractSedimentLoadParser parser
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
638 ) throws IOException {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
639 for (final File file: files) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
640 if (file.isDirectory()) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
641 for (final File child: file.listFiles()) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
642 parser.parse(child);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
643 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
644 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
645 else {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
646 parser.parse(file);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
647 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
648 }
6724
0baf7abffcc6 issue1393/ImportRiver: Import official epochs from directory, minor refac.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6347
diff changeset
649 }
0baf7abffcc6 issue1393/ImportRiver: Import official epochs from directory, minor refac.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6347
diff changeset
650
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
651
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
652 private void parseSedimentLoadDir(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
653 final File sedimentLoadDir,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
654 final AbstractSedimentLoadParser parser
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
655 ) throws IOException {
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
656
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
657 final File[] sedimentLoadSubDirs = {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
658 new File(sedimentLoadDir,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
659 SEDIMENT_LOAD_SINGLE_DIR),
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
660 new File(sedimentLoadDir,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
661 SEDIMENT_LOAD_EPOCH_DIR),
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
662 new File(sedimentLoadDir,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
663 SEDIMENT_LOAD_OFF_EPOCH_DIR),
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
664 };
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
665
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
666 for (final File subDir : sedimentLoadSubDirs) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
667 final File[] files = subDir.listFiles();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
668
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
669 if (files == null || files.length == 0) {
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
670 log.warn("Cannot read directory '" + subDir + "'");
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
671 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
672 else {
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
673 parseSedimentLoadFiles(files, parser);
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
674 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
675 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
676 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
677
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
678
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
679 protected void parseSedimentLoadLS() throws IOException {
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
680 if (Config.INSTANCE.skipSedimentLoadLS()) {
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
681 log.info("skip parsing sediment load longitudinal section data");
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
682 return;
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
683 }
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
684
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
685 log.debug("Parse sediment load longitudinal section data");
3327
bf8d9a4f4cd4 Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3320
diff changeset
686
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
687 final SedimentLoadLSParser parser = new SedimentLoadLSParser();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
688
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
689 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
690 final File sedimentLoadDir = new File(minfoDir, SEDIMENT_LOAD_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
691 final File sedimentLoadLSDir = new File(sedimentLoadDir,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
692 SEDIMENT_LOAD_LS_DIR);
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
693
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
694 parseSedimentLoadDir(sedimentLoadLSDir, parser);
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
695
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
696 this.sedimentLoadLSs = parser.getSedimentLoadLSs();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
697 }
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
698
2840
71175502d868 Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2839
diff changeset
699
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
700 protected void parseSedimentLoad() throws IOException {
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
701 if (Config.INSTANCE.skipSedimentLoad()) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
702 log.info(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
703 "skip parsing sediment load data at measurement stations");
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
704 return;
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
705 }
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
706
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
707 log.debug("Parse sediment load data at measurement stations");
6724
0baf7abffcc6 issue1393/ImportRiver: Import official epochs from directory, minor refac.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6347
diff changeset
708
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
709 final SedimentLoadParser parser = new SedimentLoadParser(getPeer());
2840
71175502d868 Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2839
diff changeset
710
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
711 final File minfoDir = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
712 final File sedimentLoadDir = new File(minfoDir, SEDIMENT_LOAD_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
713 final File sedimentLoadMSDir = new File(sedimentLoadDir,
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
714 SEDIMENT_LOAD_MS_DIR);
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
715
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
716 parseSedimentLoadDir(sedimentLoadMSDir, parser);
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
717
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
718 this.sedimentLoads = parser.getSedimentLoads();
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
719 }
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
720
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
721
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
722 protected void parseWaterlevels() throws IOException {
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
723 if (Config.INSTANCE.skipWaterlevels()) {
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
724 log.info("skip parsing waterlevels");
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
725 return;
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
726 }
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
727
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
728 log.info("Parse waterlevels");
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
729
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
730 final File minfo = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
731 final File fixDir = new File(minfo, MINFO_FIXATIONS_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
732 final File wspDir = new File(fixDir, MINFO_WATERLEVELS_DIR);
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
733
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
734 final File[] files = wspDir.listFiles();
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
735
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
736 if (files == null) {
5262
0d9ad1c432b8 ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5261
diff changeset
737 log.warn("Cannot read directory for wl '" + wspDir + "'");
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
738 return;
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
739 }
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
740
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
741 final WaterlevelParser parser = new WaterlevelParser();
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
742
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
743 for (final File file: files) {
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
744 parser.parse(file);
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
745 }
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
746
5050
e6dc908297e8 ImportRiver: Make waterlevels become fixation-wsts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5027
diff changeset
747 // The parsed ImportWaterlevels are converted to
e6dc908297e8 ImportRiver: Make waterlevels become fixation-wsts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5027
diff changeset
748 // 'fixation'-wsts now.
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
749 for(final ImportWst iw: parser.getWaterlevels()) {
5227
a981222b6260 ImportRiver: Preparing wst-based waterleveldifferences.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5149
diff changeset
750 iw.setDescription("CSV/" + iw.getDescription());
6283
e81e9dcc81b4 Switch wst_kinds of Waterleve/-Differences (6/7).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5992
diff changeset
751 iw.setKind(7);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
752 this.waterlevels.add(iw);
5050
e6dc908297e8 ImportRiver: Make waterlevels become fixation-wsts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5027
diff changeset
753 }
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
754 }
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
755
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
756 protected void parseMeasurementStations() throws IOException {
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
757 if (Config.INSTANCE.skipMeasurementStations()) {
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
758 log.info("skip parsing measurement stations");
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
759 return;
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
760 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
761
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
762 log.info("Parse measurement stations");
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
763
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
764 final File minfo = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
765 final File minfoBaseDir = new File(minfo, MINFO_BASE_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
766 final File coredataFile = new File(minfoBaseDir, MINFO_CORE_DATA_FILE);
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
767
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
768 if (coredataFile == null || !coredataFile.exists()) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
769 log.warn("No core data file '"
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
770 + coredataFile.getAbsolutePath() + "' found");
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
771 return;
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
772 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
773
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
774 final MeasurementStationsParser parser = new MeasurementStationsParser();
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
775 try {
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
776 parser.parse(coredataFile);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
777 this.measurementStations = parser.getMeasurementStations();
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
778
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
779 log.info("Successfully parsed " + this.measurementStations.size()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
780 + " measurement stations.");
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
781 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
782 catch (final IOException ioe) {
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
783 log.error("unable to parse file '" + coredataFile.getName() +
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
784 ": " + ioe.getMessage());
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
785 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
786 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
787
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
788
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
789 protected void parseWaterlevelDifferences() throws IOException {
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
790 if (Config.INSTANCE.skipWaterlevelDifferences()) {
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
791 log.info("skip parsing waterlevel differences");
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
792 return;
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
793 }
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
794
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
795 log.info("Parse waterlevel differences");
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
796
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
797 final File minfo = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
798 final File fixDir = new File(minfo, MINFO_FIXATIONS_DIR);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
799 final File diffDir = new File(fixDir, MINFO_WATERLEVEL_DIFF_DIR);
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
800
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
801 final File[] files = diffDir.listFiles();
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
802
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
803 if (files == null) {
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
804 log.warn("Cannot read directory '" + diffDir + "'");
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
805 return;
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
806 }
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
807
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
808 final WaterlevelDifferencesParser parser = new WaterlevelDifferencesParser();
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
809
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
810 for (final File file: files) {
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
811 parser.parse(file);
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
812 }
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
813
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
814 // WaterlevelDifferences become Wsts now.
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
815 for(final ImportWst iw: parser.getDifferences()) {
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
816 iw.setDescription("CSV/" + iw.getDescription());
6283
e81e9dcc81b4 Switch wst_kinds of Waterleve/-Differences (6/7).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5992
diff changeset
817 iw.setKind(6);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
818 this.waterlevelDifferences.add(iw);
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
819 }
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
820 }
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
821
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
822
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
823 protected void parseSQRelation() throws IOException {
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
824 if (Config.INSTANCE.skipSQRelation()) {
3329
cc8fc6b29649 Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3328
diff changeset
825 log.info("skip parsing sq relation");
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
826 return;
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
827 }
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
828
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
829 log.info("Parse sq relations");
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
830
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
831 final File minfo = getMinfoDir();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
832 final File sqDir = new File(minfo, MINFO_SQ_DIR);
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
833
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
834 final File[] files = sqDir.listFiles();
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
835
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
836 if (files == null) {
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
837 log.warn("Cannot read directory '" + sqDir + "'");
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
838 return;
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
839 }
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
840
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
841 final SQRelationParser parser = new SQRelationParser(getPeer());
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
842
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
843 for (final File file: files) {
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
844 parser.parse(file);
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
845 }
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
846
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
847 this.sqRelations = parser.getSQRelations();
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
848
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
849 log.debug("Parsed " + this.sqRelations.size() + " SQ relations.");
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
850 }
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
851
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
852
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
853 protected void parseBedHeights(final File dir) throws IOException {
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
854 log.debug("Parse bed height singles");
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
855
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
856 final File[] files = dir.listFiles(new FilenameFilter() {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
857 @Override
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
858 public boolean accept(final File dir, final String name) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
859 return name.toLowerCase().endsWith(".csv");
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
860 }
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
861 });
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
862
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
863 if (files == null) {
3660
976ead36192d backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3659
diff changeset
864 log.warn("Cannot read directory '" + dir + "'");
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
865 return;
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
866 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
867
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
868 final BedHeightParser parser = new BedHeightParser();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
869
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
870 for (final File file: files) {
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
871 parser.parse(file);
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
872 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
873
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
874 this.bedHeights = parser.getBedHeights();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
875 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
876
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
877 public void parseFloodWater() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
878 if (Config.INSTANCE.skipFloodWater()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
879 log.info("skip parsing flod water");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
880 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
881 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
882
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
883 log.info("Parse flood water wst file");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
884
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
885 final File riverDir = this.wstFile.getParentFile().getParentFile();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
886
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
887 final File dir = FileTools.repair(new File(riverDir, FLOOD_WATER));
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
888
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
889 if (!dir.isDirectory() || !dir.canRead()) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
890 log.info("no directory '" + dir + "' found");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
891 return;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
892 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
893
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
894 final File [] files = dir.listFiles();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
895
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
896 if (files == null) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
897 log.warn("cannot read '" + dir + "'");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
898 return;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
899 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
900
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
901 for (final File file: files) {
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
902 if (!file.isFile() || !file.canRead()) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
903 continue;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
904 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
905 final String name = file.getName().toLowerCase();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
906 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
907 continue;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
908 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
909 log.info("found file '" + file.getName() + "'");
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
910 try {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
911 final WstParser wstParser = new WstParser();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
912 wstParser.parse(file);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
913 final ImportWst iw = wstParser.getWst();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
914 iw.setKind(4);
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
915 iw.setDescription(FLOOD_WATER + "/" + iw.getDescription());
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
916 this.floodWater.add(iw);
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
917 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
918 catch (final WstParser.ParseException e) {
7343
d93bb557a94f Do not log trace of WST-Parser parse exception and document it.
Tom Gottfried <tom@intevation.de>
parents: 7340
diff changeset
919 log.error(e.getMessage());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
920 }
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
921 }
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
922 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
923
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
924 public void parseOfficialLines() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
925 if (Config.INSTANCE.skipOfficialLines()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
926 log.info("skip parsing official lines");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
927 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
928 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
929
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
930 log.info("Parse official wst files");
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
931
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
932 final File riverDir = this.wstFile.getParentFile().getParentFile();
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
933
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
934 for (final String folder: OFFICIAL_LINES_FOLDERS) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
935 final File dir = FileTools.repair(new File(riverDir, folder));
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
936
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
937 if (!dir.isDirectory() || !dir.canRead()) {
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
938 log.info("no directory '" + folder + "' found");
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
939 continue;
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
940 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
941
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
942 final File file = FileTools.repair(new File(dir, OFFICIAL_LINES));
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
943 if (!file.isFile() || !file.canRead()) {
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
944 log.warn("no official lines wst file found");
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
945 continue;
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
946 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
947 log.debug("Found WST file: " + file);
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
948
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
949 final ImportWst iw = new ImportWst(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
950 ImportOfficialWstColumn.COLUMN_FACTORY);
6337
224d7c4b5291 Backend: Create ImportWsts for official lines expicitly. They are going to be somewhat special. Removed some cruft from the WstParser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6335
diff changeset
951
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
952 final WstParser wstParser = new WstParser(iw);
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
953 try {
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
954 wstParser.parse(file);
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
955 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
956 catch (final WstParser.ParseException e) {
7343
d93bb557a94f Do not log trace of WST-Parser parse exception and document it.
Tom Gottfried <tom@intevation.de>
parents: 7340
diff changeset
957 log.error(e.getMessage());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
958 continue;
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
959 }
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
960
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
961 iw.setKind(3);
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
962 iw.setDescription(folder + "/" + iw.getDescription());
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
963
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
964 final File configFile = FileTools.repair(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
965 new File(dir, OFFICIAL_LINES_CONFIG));
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
966 if (!configFile.isFile() || !configFile.canRead()) {
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
967 log.warn("no config file for official lines found");
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
968 }
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
969 else {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
970 final OfficialLinesConfigParser olcp =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
971 new OfficialLinesConfigParser();
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
972 try {
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
973 olcp.parse(configFile);
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
974 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
975 catch (final IOException ioe) {
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
976 log.warn("Error reading offical lines config", ioe);
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
977 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
978 final List<String> mainValueNames = olcp.getMainValueNames();
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
979 if (mainValueNames.isEmpty()) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
980 log.warn(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
981 "config file for offical lines contains no entries");
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
982 }
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
983 else {
6345
0f7e9a4f1c5a Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6339
diff changeset
984 // Join as much as possible.
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
985 final Iterator<ImportWstColumn> wi = iw.getColumns().iterator();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
986 final Iterator<String> si = olcp.getMainValueNames().iterator();
6345
0f7e9a4f1c5a Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6339
diff changeset
987 while (wi.hasNext() && si.hasNext()) {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
988 final ImportOfficialWstColumn wc =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
989 (ImportOfficialWstColumn)wi.next();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
990 final String name = si.next();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
991 final ImportOfficialLine iol =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
992 new ImportOfficialLine(name, wc);
6345
0f7e9a4f1c5a Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6339
diff changeset
993 wc.setOfficialLine(iol);
0f7e9a4f1c5a Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6339
diff changeset
994 }
6335
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
995 }
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
996 }
b2a470c148a7 Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6283
diff changeset
997
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
998 this.officialLines.add(iw);
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
999 } // for all folders
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
1000
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1001 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1002
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1003 public void parseFixations() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1004 if (Config.INSTANCE.skipFixations()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1005 log.info("skip parsing fixations");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1006 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1007 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1008
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1009 log.info("Parse fixation wst files");
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1010
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1011 final File riverDir = this.wstFile.getParentFile().getParentFile();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1012
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1013 final File fixDir = FileTools.repair(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1014 new File(riverDir, FIXATIONS));
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1015
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1016 if (!fixDir.isDirectory() || !fixDir.canRead()) {
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1017 log.info("no fixation wst file directory found");
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1018 return;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1019 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1020
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1021 final File [] files = fixDir.listFiles();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1022
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1023 if (files == null) {
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1024 log.warn("cannot read fixations wst file directory");
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1025 return;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1026 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1027
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1028 for (final File file: files) {
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1029 if (!file.isFile() || !file.canRead()) {
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1030 continue;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1031 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1032 final String name = file.getName().toLowerCase();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1033 if (!name.endsWith(".wst")) {
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1034 continue;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1035 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1036 log.debug("Found WST file: " + file);
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1037
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1038 try {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1039 final WstParser wstParser = new WstParser();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1040 wstParser.parse(file);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1041 final ImportWst iw = wstParser.getWst();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1042 iw.setKind(2);
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1043 iw.setDescription(FIXATIONS+ "/" + iw.getDescription());
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1044 this.fixations.add(iw);
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1045 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1046 catch (final WstParser.ParseException e) {
7343
d93bb557a94f Do not log trace of WST-Parser parse exception and document it.
Tom Gottfried <tom@intevation.de>
parents: 7340
diff changeset
1047 log.error(e.getMessage());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1048 }
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1049 }
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1050 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1051
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1052 public void parseExtraWsts() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1053 if (Config.INSTANCE.skipExtraWsts()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1054 log.info("skip parsing extra WST files");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1055 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1056 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1057
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1058 log.info("Parse extra longitudinal wst files");
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1059
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1060 final File riverDir = this.wstFile.getParentFile().getParentFile();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1061
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1062 final File extraDir = FileTools.repair(
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1063 new File(riverDir, EXTRA_LONGITUDINALS));
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1064
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1065 if (!extraDir.isDirectory() || !extraDir.canRead()) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1066 log.info("no extra longitudinal wst file directory found");
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1067 return;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1068 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1069
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1070 final File [] files = extraDir.listFiles();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1071
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1072 if (files == null) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1073 log.warn("cannot read extra longitudinal wst file directory");
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1074 return;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1075 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1076
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1077 for (final File file: files) {
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1078 if (!file.isFile() || !file.canRead()) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1079 continue;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1080 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1081 final String name = file.getName().toLowerCase();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1082 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1083 continue;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1084 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1085 log.debug("Found WST file: " + file);
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1086
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1087 try {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1088 final WstParser wstParser = new WstParser();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1089 wstParser.parse(file);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1090 final ImportWst iw = wstParser.getWst();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1091 iw.setKind(1);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1092 iw.setDescription(
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1093 EXTRA_LONGITUDINALS + "/" + iw.getDescription());
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1094 this.extraWsts.add(iw);
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1095 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1096 catch (final WstParser.ParseException e) {
7343
d93bb557a94f Do not log trace of WST-Parser parse exception and document it.
Tom Gottfried <tom@intevation.de>
parents: 7340
diff changeset
1097 log.error(e.getMessage());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1098 }
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1099 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1100
197
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
1101 }
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
1102
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
1103 public void parseWst() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1104 if (Config.INSTANCE.skipWst()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1105 log.info("skip parsing WST file");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1106 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1107 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1108
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1109 final WstParser wstParser = new WstParser();
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1110 try {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1111 wstParser.parse(this.wstFile);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1112 this.wst = wstParser.getWst();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1113 this.wst.setKmUp(this.wst.guessWaterLevelIncreasing());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1114 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1115 catch (final WstParser.ParseException e) {
7343
d93bb557a94f Do not log trace of WST-Parser parse exception and document it.
Tom Gottfried <tom@intevation.de>
parents: 7340
diff changeset
1116 log.error(e.getMessage());
7339
40e5ad76103c WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7252
diff changeset
1117 }
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1118 }
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1119
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1120 public void parseGauges() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1121 if (Config.INSTANCE.skipGauges()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1122 log.info("skip parsing gauges");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1123 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1124 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1125
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1126 File gltFile = new File(this.wstFile.getParentFile(), PEGEL_GLT);
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1127 gltFile = FileTools.repair(gltFile);
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1128
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1129 if (!gltFile.isFile() || !gltFile.canRead()) {
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1130 log.warn("cannot read gauges from '" + gltFile + "'");
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1131 return;
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1132 }
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1133
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1134 final PegelGltParser pgltp = new PegelGltParser();
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1135 pgltp.parse(gltFile);
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1136
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1137 this.gauges = pgltp.getGauges();
189
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
1138
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1139 for (final ImportGauge gauge: this.gauges) {
189
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
1140 gauge.parseDependencies();
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
1141 }
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
1142 }
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1143
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1144 public void parseAnnotations() throws IOException {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1145 if (Config.INSTANCE.skipAnnotations()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1146 log.info("skip parsing annotations");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1147 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1148 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1149
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1150 final File riverDir = this.wstFile.getParentFile().getParentFile();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1151 final AnnotationsParser aparser =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1152 new AnnotationsParser(this.annotationClassifier);
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1153 aparser.parse(riverDir);
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1154
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1155 this.annotations = aparser.getAnnotations();
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
1156 }
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1157
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1158 public void parseHYKs() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1159 if (Config.INSTANCE.skipHYKs()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1160 log.info("skip parsing HYK files");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1161 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1162 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1163
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1164 log.info("looking for HYK files");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1165 final HYKParser parser = new HYKParser();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1166 final File riverDir = this.wstFile
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1167 .getParentFile() // Basisdaten
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1168 .getParentFile() // Hydrologie
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1169 .getParentFile(); // <river>
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1170
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1171 parser.parseHYKs(riverDir, new HYKParser.Callback() {
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1172
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1173 Set<HashedFile> hfs = new HashSet<>();
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1174
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1175 @Override
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1176 public boolean hykAccept(final File file) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1177 final HashedFile hf = new HashedFile(file);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1178 final boolean success = this.hfs.add(hf);
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1179 if (!success) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1180 log.warn("HYK file '" + file
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1181 + "' seems to be a duplicate.");
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1182 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1183 return success;
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1184 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1185
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1186 @Override
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1187 public void hykParsed(final HYKParser parser) {
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1188 log.debug("callback from HYK parser");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1189 final ImportHYK hyk = parser.getHYK();
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1190 hyk.setRiver(ImportRiver.this);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1191 ImportRiver.this.hyks.add(hyk);
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1192 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1193 });
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1194 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
1195
4712
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1196
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1197 /** Create a W80 Parser and parse w80 files found. */
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1198 public void parseW80s() {
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1199 if (Config.INSTANCE.skipW80s()) {
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1200 log.info("skip parsing W80s");
4781
e77b461fa360 ImportRiver: Bail out if skip* parameters were given.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4779
diff changeset
1201 return;
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1202 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1203 final W80Parser parser = new W80Parser();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1204 final File riverDir = this.wstFile
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1205 .getParentFile() // Basisdaten
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1206 .getParentFile() // Hydrologie
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1207 .getParentFile(); // <river>
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1208
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1209 final ImportRiverCrossSectionParserCallback w80Callback =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1210 new ImportRiverCrossSectionParserCallback("w80");
4779
18908a3cbb3a ImportRiver: Use callback (refactoring), resolving TODOs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4778
diff changeset
1211 parser.parseW80s(riverDir, w80Callback);
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1212 }
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1213
5810
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1214 /** Create a W80 Parser and parse w80 files found. */
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1215 public void parseW80CSVs() {
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1216 if (Config.INSTANCE.skipW80CSVs()) {
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1217 log.info("skip parsing W80 csvs");
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1218 return;
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1219 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1220 final W80CSVParser parser = new W80CSVParser();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1221 final File riverDir = this.wstFile
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1222 .getParentFile() // Basisdaten
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1223 .getParentFile() // Hydrologie
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1224 .getParentFile(); // <river>
5810
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1225
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1226 // Construct the Cross-Section-Data path.
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1227 final File csDir = new File(riverDir.getPath()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1228 + File.separator + "Geodaesie"
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1229 + File.separator + "Querprofile"
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1230 + File.separator + "QP-Daten");
5810
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1231
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1232 final ImportRiverCrossSectionParserCallback w80CSVCallback =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1233 new ImportRiverCrossSectionParserCallback("w80-csv");
5810
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1234 parser.parseW80CSVs(csDir, w80CSVCallback);
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1235 }
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1236
4782
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1237
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1238 /**
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1239 * Create and use a DA50Parser, parse the files found, add the
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1240 * ross-sections found.
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1241 */
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1242 public void parseDA50s() {
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1243 if (Config.INSTANCE.skipDA50s()) {
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1244 log.info("skip parsing DA50s");
4781
e77b461fa360 ImportRiver: Bail out if skip* parameters were given.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4779
diff changeset
1245 return;
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1246 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1247 final DA50Parser parser = new DA50Parser();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1248 final File riverDir = this.wstFile
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1249 .getParentFile() // Basisdaten
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1250 .getParentFile() // Hydrologie
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1251 .getParentFile(); // <river>
4782
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1252
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1253 final ImportRiverCrossSectionParserCallback da50Callback =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1254 new ImportRiverCrossSectionParserCallback("da50");
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
1255
4782
696285cef182 ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4781
diff changeset
1256 parser.parseDA50s(riverDir, da50Callback);
4767
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1257 }
03246a8b3869 ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4735
diff changeset
1258
4724
c30152f77f77 ImportRiver: Refactoring, use description and year of da66parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4716
diff changeset
1259
4712
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1260 /** Create a DA66 Parser and parse the da66 files found. */
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1261 // TODO this is a copy of parsePRFs, extract interfaces
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1262 //(e.g. CrossSectionParser).
4712
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1263 public void parseDA66s() {
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1264 if (Config.INSTANCE.skipDA66s()) {
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1265 log.info("skip parsing DA66s");
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1266 return;
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1267 }
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1268
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1269 log.info("looking for DA66 files");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1270 final DA66Parser parser = new DA66Parser();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1271 final File riverDir = this.wstFile
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1272 .getParentFile() // Basisdaten
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1273 .getParentFile() // Hydrologie
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1274 .getParentFile(); // <river>
4712
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1275
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1276 final ImportRiverCrossSectionParserCallback da66Callback =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1277 new ImportRiverCrossSectionParserCallback("da66");
5084
ca45dd039b54 Log the number of points of cross sections to see the effect of the simplification.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5083
diff changeset
1278
4779
18908a3cbb3a ImportRiver: Use callback (refactoring), resolving TODOs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4778
diff changeset
1279 parser.parseDA66s(riverDir, da66Callback);
4712
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1280 }
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1281
70842db72ee4 Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4706
diff changeset
1282 /** Create a PRFParser and let it parse the prf files found. */
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1283 public void parsePRFs() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1284 if (Config.INSTANCE.skipPRFs()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1285 log.info("skip parsing PRFs");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1286 return;
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1287 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1288
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1289 log.info("looking for PRF files");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1290 final PRFParser parser = new PRFParser();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1291 final File riverDir = this.wstFile
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1292 .getParentFile() // Basisdaten
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1293 .getParentFile() // Hydrologie
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1294 .getParentFile(); // <river>
1206
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
1295
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1296 final ImportRiverCrossSectionParserCallback prfCallback =
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1297 new ImportRiverCrossSectionParserCallback("prf");
4779
18908a3cbb3a ImportRiver: Use callback (refactoring), resolving TODOs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4778
diff changeset
1298 parser.parsePRFs(riverDir, prfCallback);
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1299 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1300
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1301 public static Date yearToDate(final int year) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1302 final Calendar cal = Calendar.getInstance();
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1303 cal.set(year, 5, 15, 12, 0, 0);
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1304 final long ms = cal.getTimeInMillis();
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1305 cal.setTimeInMillis(ms - ms%1000);
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1306 return cal.getTime();
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1307 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1308
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
1309 public void storeDependencies() {
6823
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1310 /* test whether river is already in database.
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1311 * Otherwise it makes no sense to skip waterlevel model WST-file
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1312 * because the altitude reference is taken from there. */
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1313 final Session session = ImporterSession.getInstance().getDatabaseSession();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1314 final Query query = session.createQuery("from River where name=:name");
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1315 query.setString("name", this.name);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1316 final List<River> rivers = query.list();
6823
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1317 if (rivers.isEmpty() && Config.INSTANCE.skipWst()){
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1318 log.error("River not yet in database. "
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1319 + "You cannot skip importing waterlevel model.");
6823
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1320 return;
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1321 }
827da1952ce2 Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents: 6724
diff changeset
1322
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1323 storeWstUnit();
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
1324 storeAnnotations();
1221
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
1325 storeHYKs();
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1326 storeCrossSections();
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
1327 storeGauges();
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
1328 storeWst();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1329 storeExtraWsts();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1330 storeFixations();
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
1331 storeOfficialLines();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
1332 storeFloodWater();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
1333 storeFloodProtection();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1334 storeMeasurementStations();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
1335 storeBedHeight();
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1336 storeSedimentDensity();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1337 storePorosity();
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1338 storeMorphologicalWidth();
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1339 storeFlowVelocity();
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
1340 storeSedimentLoadLS();
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1341 storeSedimentLoad();
5261
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1342 storeWaterlevels();
2851
acb8d08f59a2 Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2845
diff changeset
1343 storeWaterlevelDifferences();
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1344 storeSQRelations();
5080
b87e504f916e Importer/River: Move storeOfficialNumber from parse* to store*, do not store explicitely.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5051
diff changeset
1345 storeOfficialNumber();
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1346 this.sinfoImporter.store();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1347 this.uinfoImporter.store();
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
1348 }
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
1349
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1350 public void storeWstUnit() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1351 if (this.wst == null) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1352 log.warn("No unit given. "
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1353 + "Waterlevel-model WST-file has to be imported already.");
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1354 }
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1355 else {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1356 this.wstUnit = this.wst.getUnit();
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1357 }
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1358 }
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1359
1221
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
1360 public void storeHYKs() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1361 if (!Config.INSTANCE.skipHYKs()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1362 log.info("store HYKs");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1363 getPeer();
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1364 for (final ImportHYK hyk: this.hyks) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1365 hyk.storeDependencies();
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1366 }
1221
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
1367 }
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
1368 }
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
1369
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1370 public void storeCrossSections() {
5810
dba9e1fa233e ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5806
diff changeset
1371 if (!Config.INSTANCE.skipPRFs()
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1372 || !Config.INSTANCE.skipDA66s()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1373 || !Config.INSTANCE.skipDA50s()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1374 || !Config.INSTANCE.skipW80s()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1375 || !Config.INSTANCE.skipW80CSVs()) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1376 log.info("store cross sections");
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1377 getPeer();
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1378 for (final ImportCrossSection crossSection: this.crossSections) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1379 crossSection.storeDependencies();
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1380 }
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1381 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1382 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
1383
201
3169b559ca3c Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 197
diff changeset
1384 public void storeWst() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1385 if (this.wst != null && !Config.INSTANCE.skipWst()) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1386 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1387 this.wst.storeDependencies(river);
7183
0fe00824bd96 flys/issue1500: The main wst file determines km_up now.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6724
diff changeset
1388
0fe00824bd96 flys/issue1500: The main wst file determines km_up now.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6724
diff changeset
1389 // The flow direction of the main wst and the corresponding
0fe00824bd96 flys/issue1500: The main wst file determines km_up now.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6724
diff changeset
1390 // waterlevels determine if the river is 'km_up'.
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1391 final Session session = ImporterSession.getInstance()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1392 .getDatabaseSession();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1393 river.setKmUp(this.wst.getKmUp());
7183
0fe00824bd96 flys/issue1500: The main wst file determines km_up now.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6724
diff changeset
1394 session.save(river);
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1395 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1396 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
1397
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1398 public void storeFixations() {
5262
0d9ad1c432b8 ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5261
diff changeset
1399 if (!Config.INSTANCE.skipFixations()) {
0d9ad1c432b8 ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5261
diff changeset
1400 log.info("store fixation wsts");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1401 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1402 for (final ImportWst fWst: this.fixations) {
5261
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1403 log.debug("Fixation name: " + fWst.getDescription());
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1404 fWst.storeDependencies(river);
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1405 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1406 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1407 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1408
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1409
5261
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1410 /** Store wsts from waterlevel-csv files. */
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1411 public void storeWaterlevels() {
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1412 if (!Config.INSTANCE.skipWaterlevels())
5262
0d9ad1c432b8 ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5261
diff changeset
1413
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1414 log.info("store waterlevel wsts from csv");
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1415 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1416 for (final ImportWst wWst: this.waterlevels) {
5261
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1417 log.debug("Waterlevel name: " + wWst.getDescription());
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1418 wWst.storeDependencies(river);
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1419 }
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1420 }
5262
0d9ad1c432b8 ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5261
diff changeset
1421
5261
1e403a0efc21 ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5248
diff changeset
1422
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1423 /** Store wsts from waterleveldifference-csv files. */
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1424 public void storeWaterlevelDifferences() {
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1425 if (!Config.INSTANCE.skipWaterlevelDifferences())
5280
dba703edfff1 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5262
diff changeset
1426
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1427 log.info("store waterleveldifferences wsts from csv");
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1428 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1429 for (final ImportWst dWst: this.waterlevelDifferences) {
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1430 log.debug("water.diff.: name " + dWst.getDescription());
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1431 dWst.storeDependencies(river);
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1432 }
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1433 }
5280
dba703edfff1 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5262
diff changeset
1434
5232
11b2a0c55318 ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5227
diff changeset
1435
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1436 public void storeExtraWsts() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1437 if (!Config.INSTANCE.skipExtraWsts()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1438 log.info("store extra wsts");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1439 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1440 for (final ImportWst wst: this.extraWsts) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1441 log.debug("name: " + wst.getDescription());
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1442 wst.storeDependencies(river);
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1443 }
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1444 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1445 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
1446
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
1447 public void storeOfficialLines() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1448 if (Config.INSTANCE.skipOfficialLines() || this.officialLines.isEmpty()) {
6347
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1449 return;
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1450 }
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1451
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1452 log.info("store official lines wsts");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1453 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1454 for (final ImportWst wst: this.officialLines) {
6347
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1455 log.debug("name: " + wst.getDescription());
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1456 wst.storeDependencies(river);
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1457
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1458 // Store the official lines after the columns are store.
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1459 for (final ImportWstColumn wc: wst.getColumns()) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1460 final ImportOfficialWstColumn owc = (ImportOfficialWstColumn)wc;
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1461 final ImportOfficialLine ioc = owc.getOfficialLine();
6347
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1462 if (ioc != null) {
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1463 if (ioc.getPeer(river) == null) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8811
diff changeset
1464 log.warn("Cannot store official line: "
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1465 + ioc.getName());
6347
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1466 }
75c483450c96 Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6345
diff changeset
1467 }
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1468 }
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
1469 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
1470 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
1471
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
1472 public void storeFloodWater() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1473 if (!Config.INSTANCE.skipFloodWater()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1474 log.info("store flood water wsts");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1475 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1476 for (final ImportWst wst: this.floodWater) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1477 log.debug("name: " + wst.getDescription());
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1478 wst.storeDependencies(river);
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1479 }
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
1480 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
1481 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
1482
5262
0d9ad1c432b8 ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5261
diff changeset
1483
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
1484 public void storeFloodProtection() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1485 if (!Config.INSTANCE.skipFloodProtection()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1486 log.info("store flood protection wsts");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1487 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1488 for (final ImportWst wst: this.floodProtection) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1489 log.debug("name: " + wst.getDescription());
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1490 wst.storeDependencies(river);
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1491 }
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
1492 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
1493 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
1494
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
1495
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
1496 public void storeBedHeight() {
8559
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1497 if (!Config.INSTANCE.skipBedHeight()) {
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1498 log.info("store bed heights");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1499 final River river = getPeer();
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
1500
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1501 if (this.bedHeights != null) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1502 for (final ImportBedHeight tmp: this.bedHeights) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1503 final ImportBedHeight single = tmp;
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
1504
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1505 final String desc = single.getDescription();
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
1506
8559
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1507 log.debug("name: " + desc);
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1508
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1509 single.storeDependencies(river);
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1510 }
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
1511 }
8559
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1512 else {
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1513 log.info("No bed heights to store.");
6d8d7425a6b5 Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents: 8557
diff changeset
1514 }
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
1515 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
1516 }
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
1517
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
1518
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1519 public void storeSedimentDensity() {
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1520 if (!Config.INSTANCE.skipSedimentDensity()) {
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1521 log.info("store sediment density");
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1522
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1523 final River river = getPeer();
2817
8979f2294af9 Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2815
diff changeset
1524
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1525 for (final ImportSedimentDensity density: this.sedimentDensities) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1526 final String desc = density.getDescription();
2817
8979f2294af9 Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2815
diff changeset
1527
8979f2294af9 Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2815
diff changeset
1528 log.debug("name: " + desc);
8979f2294af9 Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2815
diff changeset
1529
7252
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1530 density.storeDependencies(river);
2817
8979f2294af9 Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2815
diff changeset
1531 }
2815
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1532 }
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1533 }
3febaed762b8 Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2811
diff changeset
1534
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1535 public void storePorosity() {
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1536 if (!Config.INSTANCE.skipPorosity()) {
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1537 log.info("store porosity");
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1538
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1539 final River river = getPeer();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1540
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1541 for (final ImportPorosity porosity: this.porosities) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1542 final String desc = porosity.getDescription();
7841
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1543
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1544 log.debug("name: " + desc);
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1545
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1546 porosity.storeDependencies(river);
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1547 }
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1548 }
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1549 }
8036688f24e1 Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents: 7767
diff changeset
1550
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1551 public void storeMorphologicalWidth() {
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1552 if (!Config.INSTANCE.skipMorphologicalWidth()) {
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1553 log.info("store morphological width");
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1554
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1555 final River river = getPeer();
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1556
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1557 for (final ImportMorphWidth width: this.morphologicalWidths) {
7252
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1558 width.storeDependencies(river);
2821
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1559 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1560 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1561 }
0a536eb5d668 Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2817
diff changeset
1562
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1563 public void storeFlowVelocity() {
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1564 if (!Config.INSTANCE.skipFlowVelocity()) {
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1565 log.info("store flow velocity");
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1566
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1567 final River river = getPeer();
2827
85b25e74594f Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2826
diff changeset
1568
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1569 for (final ImportFlowVelocityModel flowVelocityModel: this.flowVelocityModels
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1570 ) {
7252
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1571 flowVelocityModel.storeDependencies(river);
2827
85b25e74594f Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2826
diff changeset
1572 }
2832
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
1573
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1574 for (final ImportFlowVelocityMeasurement m: this.flowVelocityMeasurements) {
7252
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1575 m.storeDependencies(river);
2832
ac5bd90697c1 Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
1576 }
2826
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1577 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1578 }
c3f8cf0cdf69 Prepared the importer to parse flow velocity files and added a config option to skip that process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2821
diff changeset
1579
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1580
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
1581 public void storeSedimentLoadLS() {
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
1582 if (!Config.INSTANCE.skipSedimentLoadLS()) {
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
1583 log.info("store sediment load longitudinal section data");
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1584
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1585 final River river = getPeer();
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1586
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1587 for (final ImportSedimentLoadLS sedimentLoadLS: this.sedimentLoadLSs) {
8032
fd3a24336e6a SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
"Tom Gottfried <tom@intevation.de>"
parents: 8031
diff changeset
1588 sedimentLoadLS.storeDependencies(river);
2839
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1589 }
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1590 }
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1591 }
163c037f2c7e Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2832
diff changeset
1592
2844
c4db0f75a94a Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2840
diff changeset
1593
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1594 public void storeSedimentLoad() {
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1595 if (!Config.INSTANCE.skipSedimentLoad()) {
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1596 log.info("store sediment load data at measurement stations");
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1597
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1598 for (final ImportSedimentLoad sedimentLoad: this.sedimentLoads) {
8056
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1599 sedimentLoad.storeDependencies();
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1600 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1601 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1602 }
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1603
d86cc6a17b7a Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents: 8032
diff changeset
1604
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1605 public void storeMeasurementStations() {
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1606 if (!Config.INSTANCE.skipMeasurementStations()) {
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1607 log.info("store measurement stations");
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1608
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1609 final River river = getPeer();
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1610
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1611 int count = 0;
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1612
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1613 for (final ImportMeasurementStation station: this.measurementStations) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1614 final boolean success = station.storeDependencies(river);
7252
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1615 if (success) {
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1616 count++;
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1617 }
4193
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1618 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1619
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1620 log.info("stored " + count + " measurement stations.");
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1621 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1622 }
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1623
f63b39799d2d Adapted DB schema (added relation measurement_station); improved importer to read files from filesystem with measurement stations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3660
diff changeset
1624
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1625 public void storeSQRelations() {
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1626 if (!Config.INSTANCE.skipSQRelation()) {
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1627 log.info("store sq relations");
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1628
3329
cc8fc6b29649 Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3328
diff changeset
1629 int count = 0;
cc8fc6b29649 Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3328
diff changeset
1630
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1631 for (final ImportSQRelation sqRelation: this.sqRelations) {
8641
c851d1ea543a SCHEMA CHANGE: Remove unnecessary direct relation of sq_relation with rivers.
Tom Gottfried <tom@intevation.de>
parents: 8559
diff changeset
1632 sqRelation.storeDependencies();
7252
c894b7b45c4c Replaced some tabs by spaces. Guys, please configure your editors not to insert tabs!
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7183
diff changeset
1633 count++;
3329
cc8fc6b29649 Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3328
diff changeset
1634 }
cc8fc6b29649 Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3328
diff changeset
1635
cc8fc6b29649 Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3328
diff changeset
1636 log.info("stored " + count + " sq relations.");
3328
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1637 }
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1638 }
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1639
a41f279a66e2 Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3327
diff changeset
1640
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1641 public void storeAnnotations() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1642 if (!Config.INSTANCE.skipAnnotations()) {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1643 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1644 for (final ImportAnnotation annotation: this.annotations) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1645 annotation.getPeer(river);
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1646 }
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1647 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1648 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1649
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
1650 public void storeGauges() {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1651 if (!Config.INSTANCE.skipGauges()) {
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1652 log.info("store gauges:");
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1653 final River river = getPeer();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1654 final Session session = ImporterSession.getInstance()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1655 .getDatabaseSession();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1656 for (final ImportGauge gauge: this.gauges) {
1223
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1657 log.info("\tgauge: " + gauge.getName());
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1658 gauge.storeDependencies(river);
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1659 ImporterSession.getInstance().getDatabaseSession();
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1660 session.flush();
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
1661 }
191
c4fb5141ce11 Propagate river into storing of gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 190
diff changeset
1662 }
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
1663 }
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
1664
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1665 public River getPeer() {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1666 if (this.peer == null) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1667 final Session session = ImporterSession.getInstance()
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1668 .getDatabaseSession();
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1669 final Query query = session.createQuery("from River where name=:name");
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1670
5027
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
1671 Unit u = null;
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1672 if (this.wstUnit != null) {
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1673 u = this.wstUnit.getPeer();
5027
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
1674 }
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
1675
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1676 query.setString("name", this.name);
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1677 final List<River> rivers = query.list();
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1678 if (rivers.isEmpty()) {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1679 log.info("Store new river '" + this.name + "'");
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1680 this.peer = new River(this.name, u, this.modelUuid);
5027
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
1681 if (!Config.INSTANCE.skipBWASTR()) {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1682 this.peer.setOfficialNumber(this.officialNumber);
5027
25c180fa6162 Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5020
diff changeset
1683 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1684 session.save(this.peer);
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1685 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1686 else {
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1687 this.peer = rivers.get(0);
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1688 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1689 }
8971
50416a0df385 Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents: 8856
diff changeset
1690 return this.peer;
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
1691 }
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1692 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1693 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org