Mercurial > dive4elements > river
annotate backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 8988:ae76f618d990
Checks added for missing import directory
author | mschaefer |
---|---|
date | Sun, 08 Apr 2018 18:09:32 +0200 |
parents | 50416a0df385 |
children | a2a42a6bac6b |
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 | 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 | 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 | 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 | 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 | 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 | 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 |
8988 | 394 public AnnotationClassifier getAnnotationClassifier() { |
395 return this.annotationClassifier; | |
396 } | |
397 | |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
398 public void parseDependencies() throws IOException { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
399 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
|
400 parseGauges(); |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
401 parseAnnotations(); |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
402 parsePRFs(); |
4712
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
403 parseDA66s(); |
4767
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
404 parseDA50s(); |
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
405 parseW80s(); |
5810
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
406 parseW80CSVs(); |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
407 parseHYKs(); |
197
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
408 parseWst(); |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
409 parseExtraWsts(); |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
410 parseFixations(); |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
411 parseOfficialLines(); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
412 parseFloodWater(); |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
413 parseFloodProtection(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
414 parseMeasurementStations(); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
415 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
|
416 parseSedimentDensity(); |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
417 parsePorosity(); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
418 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
|
419 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
|
420 parseSedimentLoadLS(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
421 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
|
422 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
|
423 parseWaterlevelDifferences(); |
3328
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
424 parseSQRelation(); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
425 this.sinfoImporter.setup(getRiverDir(), this); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
426 this.sinfoImporter.parse(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
427 this.uinfoImporter.setup(getRiverDir(), this); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
428 this.uinfoImporter.parse(); |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
429 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
430 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
431 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
|
432 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
|
433 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
|
434 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
|
435 } |
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
|
436 |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
437 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
|
438 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
439 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
|
440 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
441 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
|
442 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
443 if (!dir.isDirectory() || !dir.canRead()) { |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
444 log.info("no directory '" + dir + "' found"); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
445 return; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
446 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
447 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
448 final File [] files = dir.listFiles(); |
494
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 if (files == null) { |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
451 log.warn("cannot read '" + dir + "'"); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
452 return; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
453 } |
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 for (final File file: files) { |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
456 if (!file.isFile() || !file.canRead()) { |
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 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
459 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
|
460 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
|
461 continue; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
462 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
463 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
|
464 try { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
465 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
|
466 wstParser.parse(file); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
467 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
|
468 iw.setKind(5); |
8856 | 469 iw.setDescription( |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
470 FLOOD_PROTECTION + "/" + iw.getDescription()); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
471 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
|
472 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
473 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
|
474 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
|
475 } |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
476 } |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
477 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
478 |
5027
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
479 public void storeOfficialNumber() { |
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
480 if (Config.INSTANCE.skipBWASTR()) { |
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
481 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
|
482 return; |
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
483 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
484 getPeer().setOfficialNumber(this.officialNumber); |
5027
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
485 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
486 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
487 public void parseBedHeight() throws IOException { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
488 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
489 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
|
490 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
|
491 |
8559
6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents:
8557
diff
changeset
|
492 if (Config.INSTANCE.skipBedHeight()) { |
8762
86da84a95fac
Clean up a few debug messages.
Tom Gottfried <tom@intevation.de>
parents:
8641
diff
changeset
|
493 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
|
494 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
495 else { |
8762
86da84a95fac
Clean up a few debug messages.
Tom Gottfried <tom@intevation.de>
parents:
8641
diff
changeset
|
496 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
|
497 parseBedHeights(singlesDir); |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
498 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
499 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
500 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
501 |
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
|
502 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
|
503 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
|
504 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
|
505 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
|
506 } |
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
|
507 |
3327
bf8d9a4f4cd4
Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3320
diff
changeset
|
508 log.debug("Parse sediment density"); |
bf8d9a4f4cd4
Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3320
diff
changeset
|
509 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
510 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
511 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
|
512 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
513 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
|
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 if (files == null) { |
3660
976ead36192d
backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3659
diff
changeset
|
516 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
|
517 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
|
518 } |
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 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
520 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
|
521 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
522 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
|
523 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
|
524 } |
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
|
525 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
526 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
|
527 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
528 log.info("Parsed " + this.sedimentDensities.size() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
529 + " 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
|
530 } |
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
|
531 |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
532 protected void parsePorosity() throws IOException { |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
533 if (Config.INSTANCE.skipPorosity()) { |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
534 log.info("skip parsing porosity."); |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
535 return; |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
536 } |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
537 |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
538 log.debug("Parse porosity"); |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
539 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
540 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
541 final File porosity = new File(minfoDir, POROSITY_DIR); |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
542 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
543 final File[] files = porosity.listFiles(); |
7841
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 if (files == null) { |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
546 log.warn("Cannot read directory '" + porosity + "'"); |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
547 return; |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
548 } |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
549 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
550 final PorosityParser parser = new PorosityParser(); |
7841
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 for (final File file: files) { |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
553 parser.parse(file); |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
554 } |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
555 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
556 this.porosities = parser.getPorosities(); |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
557 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
558 log.info("Parsed " + this.porosities.size() + " porosities."); |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
559 } |
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
|
560 |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
561 protected void parseMorphologicalWidth() throws IOException { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
562 if (Config.INSTANCE.skipMorphologicalWidth()) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
563 log.info("skip parsing morphological width."); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
564 return; |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
565 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
566 |
3327
bf8d9a4f4cd4
Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3320
diff
changeset
|
567 log.debug("Parse morphological width"); |
bf8d9a4f4cd4
Cleared some irritating debug messages.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3320
diff
changeset
|
568 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
569 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
570 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
|
571 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
572 final File[] files = morphDir.listFiles(); |
2821
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 if (files == null) { |
3660
976ead36192d
backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3659
diff
changeset
|
575 log.warn("Cannot read directory '" + morphDir + "'"); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
576 return; |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
577 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
578 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
579 final MorphologicalWidthParser parser = new MorphologicalWidthParser(); |
2821
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 for (final File file: files) { |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
582 parser.parse(file); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
583 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
584 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
585 this.morphologicalWidths = parser.getMorphologicalWidths(); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
586 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
587 log.info("Parsed " + this.morphologicalWidths.size() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
588 + " morph. widths files."); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
589 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
590 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
591 |
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
|
592 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
|
593 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
|
594 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
|
595 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
|
596 } |
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
|
597 |
3328
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
598 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
|
599 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
600 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
601 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
|
602 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
|
603 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
|
604 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
605 final File[] modelFiles = modelDir.listFiles(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
606 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
|
607 |
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
|
608 if (modelFiles == null) { |
3660
976ead36192d
backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3659
diff
changeset
|
609 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
|
610 } |
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 else { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
612 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
|
613 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
614 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
|
615 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
|
616 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
|
617 } |
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
|
618 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
619 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
|
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 |
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
|
622 if (measureFiles == null) { |
3660
976ead36192d
backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3659
diff
changeset
|
623 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
|
624 } |
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
|
625 else { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
626 final FlowVelocityMeasurementParser parser = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
627 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
|
628 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
629 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
|
630 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
|
631 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
|
632 } |
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
|
633 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
634 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
|
635 } |
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
|
636 } |
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
|
637 |
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
|
638 |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
639 private void parseSedimentLoadFiles( |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
640 final File[] files, |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
641 final AbstractSedimentLoadParser parser |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
642 ) throws IOException { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
643 for (final File file: files) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
644 if (file.isDirectory()) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
645 for (final File child: file.listFiles()) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
646 parser.parse(child); |
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 } |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
649 else { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
650 parser.parse(file); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
651 } |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
652 } |
6724
0baf7abffcc6
issue1393/ImportRiver: Import official epochs from directory, minor refac.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6347
diff
changeset
|
653 } |
0baf7abffcc6
issue1393/ImportRiver: Import official epochs from directory, minor refac.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6347
diff
changeset
|
654 |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
655 |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
656 private void parseSedimentLoadDir( |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
657 final File sedimentLoadDir, |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
658 final AbstractSedimentLoadParser parser |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
659 ) throws IOException { |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
660 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
661 final File[] sedimentLoadSubDirs = { |
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_SINGLE_DIR), |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
664 new File(sedimentLoadDir, |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
665 SEDIMENT_LOAD_EPOCH_DIR), |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
666 new File(sedimentLoadDir, |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
667 SEDIMENT_LOAD_OFF_EPOCH_DIR), |
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 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
670 for (final File subDir : sedimentLoadSubDirs) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
671 final File[] files = subDir.listFiles(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
672 |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
673 if (files == null || files.length == 0) { |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
674 log.warn("Cannot read directory '" + subDir + "'"); |
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 else { |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
677 parseSedimentLoadFiles(files, parser); |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
678 } |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
679 } |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
680 } |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
681 |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
682 |
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
|
683 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
|
684 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
|
685 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
|
686 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
|
687 } |
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
|
688 |
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
|
689 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
|
690 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
691 final SedimentLoadLSParser parser = new SedimentLoadLSParser(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
692 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
693 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
694 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
|
695 final File sedimentLoadLSDir = new File(sedimentLoadDir, |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
696 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
|
697 |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
698 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
|
699 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
700 this.sedimentLoadLSs = parser.getSedimentLoadLSs(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
701 } |
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
|
702 |
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
|
703 |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
704 protected void parseSedimentLoad() throws IOException { |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
705 if (Config.INSTANCE.skipSedimentLoad()) { |
8856 | 706 log.info( |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
707 "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
|
708 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
|
709 } |
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
|
710 |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
711 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
|
712 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
713 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
|
714 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
715 final File minfoDir = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
716 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
|
717 final File sedimentLoadMSDir = new File(sedimentLoadDir, |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
718 SEDIMENT_LOAD_MS_DIR); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
719 |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
720 parseSedimentLoadDir(sedimentLoadMSDir, parser); |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
721 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
722 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
|
723 } |
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
|
724 |
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
|
725 |
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
|
726 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
|
727 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
|
728 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
|
729 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
|
730 } |
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
|
731 |
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
|
732 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
|
733 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
734 final File minfo = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
735 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
|
736 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
|
737 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
738 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
|
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 if (files == null) { |
5262
0d9ad1c432b8
ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5261
diff
changeset
|
741 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
|
742 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
|
743 } |
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 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
745 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
|
746 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
747 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
|
748 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
|
749 } |
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
|
750 |
5050
e6dc908297e8
ImportRiver: Make waterlevels become fixation-wsts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5027
diff
changeset
|
751 // The parsed ImportWaterlevels are converted to |
e6dc908297e8
ImportRiver: Make waterlevels become fixation-wsts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5027
diff
changeset
|
752 // 'fixation'-wsts now. |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
753 for(final ImportWst iw: parser.getWaterlevels()) { |
5227
a981222b6260
ImportRiver: Preparing wst-based waterleveldifferences.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5149
diff
changeset
|
754 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
|
755 iw.setKind(7); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
756 this.waterlevels.add(iw); |
5050
e6dc908297e8
ImportRiver: Make waterlevels become fixation-wsts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5027
diff
changeset
|
757 } |
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
|
758 } |
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
|
759 |
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
|
760 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
|
761 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
|
762 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
|
763 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
|
764 } |
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
|
765 |
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
|
766 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
|
767 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
768 final File minfo = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
769 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
|
770 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
|
771 |
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 if (coredataFile == null || !coredataFile.exists()) { |
8856 | 773 log.warn("No core data file '" |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
774 + 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
|
775 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
|
776 } |
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
|
777 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
778 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
|
779 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
|
780 parser.parse(coredataFile); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
781 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
|
782 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
783 log.info("Successfully parsed " + this.measurementStations.size() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
784 + " 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
|
785 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
786 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
|
787 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
|
788 ": " + 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
|
789 } |
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
|
790 } |
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
|
791 |
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
|
792 |
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 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
|
794 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
|
795 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
|
796 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
|
797 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
798 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
799 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
|
800 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
801 final File minfo = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
802 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
|
803 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
|
804 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
805 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
|
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 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
|
808 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
|
809 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
|
810 } |
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 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
812 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
|
813 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
814 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
|
815 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
|
816 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
817 |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
818 // WaterlevelDifferences become Wsts now. |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
819 for(final ImportWst iw: parser.getDifferences()) { |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
820 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
|
821 iw.setKind(6); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
822 this.waterlevelDifferences.add(iw); |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
823 } |
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
|
824 } |
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
|
825 |
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
|
826 |
3328
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
827 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
|
828 if (Config.INSTANCE.skipSQRelation()) { |
3329
cc8fc6b29649
Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3328
diff
changeset
|
829 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
|
830 return; |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
831 } |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
832 |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
833 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
|
834 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
835 final File minfo = getMinfoDir(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
836 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
|
837 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
838 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
|
839 |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
840 if (files == null) { |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
841 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
|
842 return; |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
843 } |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
844 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
845 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
|
846 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
847 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
|
848 parser.parse(file); |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
849 } |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
850 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
851 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
|
852 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
853 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
|
854 } |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
855 |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
856 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
857 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
|
858 log.debug("Parse bed height singles"); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
859 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
860 final File[] files = dir.listFiles(new FilenameFilter() { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
861 @Override |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
862 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
|
863 return name.toLowerCase().endsWith(".csv"); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
864 } |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
865 }); |
2806
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 if (files == null) { |
3660
976ead36192d
backend: Mention backend warnings in importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3659
diff
changeset
|
868 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
|
869 return; |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
870 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
871 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
872 final BedHeightParser parser = new BedHeightParser(); |
2806
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 for (final File file: files) { |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
875 parser.parse(file); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
876 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
877 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
878 this.bedHeights = parser.getBedHeights(); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
879 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
880 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
881 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
|
882 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
|
883 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
|
884 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
|
885 } |
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
|
886 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
887 log.info("Parse flood water wst file"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
888 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
889 final File riverDir = this.wstFile.getParentFile().getParentFile(); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
890 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
891 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
|
892 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
893 if (!dir.isDirectory() || !dir.canRead()) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
894 log.info("no directory '" + dir + "' found"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
895 return; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
896 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
897 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
898 final File [] files = dir.listFiles(); |
490
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 if (files == null) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
901 log.warn("cannot read '" + dir + "'"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
902 return; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
903 } |
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 for (final File file: files) { |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
906 if (!file.isFile() || !file.canRead()) { |
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 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
909 final String name = file.getName().toLowerCase(); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
910 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
911 continue; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
912 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
913 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
|
914 try { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
915 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
|
916 wstParser.parse(file); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
917 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
|
918 iw.setKind(4); |
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
919 iw.setDescription(FLOOD_WATER + "/" + iw.getDescription()); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
920 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
|
921 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
922 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
|
923 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
|
924 } |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
925 } |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
926 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
927 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
928 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
|
929 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
|
930 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
|
931 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
|
932 } |
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
|
933 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
934 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
|
935 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
936 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
|
937 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
938 for (final String folder: OFFICIAL_LINES_FOLDERS) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
939 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
|
940 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
941 if (!dir.isDirectory() || !dir.canRead()) { |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
942 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
|
943 continue; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
944 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
945 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
946 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
|
947 if (!file.isFile() || !file.canRead()) { |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
948 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
|
949 continue; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
950 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
951 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
|
952 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
953 final ImportWst iw = new ImportWst( |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
954 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
|
955 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
956 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
|
957 try { |
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
958 wstParser.parse(file); |
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
959 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
960 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
|
961 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
|
962 continue; |
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
963 } |
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
964 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
965 iw.setKind(3); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
966 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
|
967 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
968 final File configFile = FileTools.repair( |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
969 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
|
970 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
|
971 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
|
972 } |
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
973 else { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
974 final OfficialLinesConfigParser olcp = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
975 new OfficialLinesConfigParser(); |
6335
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
976 try { |
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
977 olcp.parse(configFile); |
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
978 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
979 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
|
980 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
|
981 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
982 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
|
983 if (mainValueNames.isEmpty()) { |
8856 | 984 log.warn( |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
985 "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
|
986 } |
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
987 else { |
6345
0f7e9a4f1c5a
Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6339
diff
changeset
|
988 // Join as much as possible. |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
989 final Iterator<ImportWstColumn> wi = iw.getColumns().iterator(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
990 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
|
991 while (wi.hasNext() && si.hasNext()) { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
992 final ImportOfficialWstColumn wc = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
993 (ImportOfficialWstColumn)wi.next(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
994 final String name = si.next(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
995 final ImportOfficialLine iol = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
996 new ImportOfficialLine(name, wc); |
6345
0f7e9a4f1c5a
Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6339
diff
changeset
|
997 wc.setOfficialLine(iol); |
0f7e9a4f1c5a
Backend: Joined official lines with there importer model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6339
diff
changeset
|
998 } |
6335
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
999 } |
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
1000 } |
b2a470c148a7
Backend: First steps to integrate parsing of official config files.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6283
diff
changeset
|
1001 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1002 this.officialLines.add(iw); |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1003 } // for all folders |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1004 |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1005 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1006 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1007 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
|
1008 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
|
1009 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
|
1010 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
|
1011 } |
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
|
1012 |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1013 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
|
1014 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1015 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
|
1016 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1017 final File fixDir = FileTools.repair( |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1018 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
|
1019 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1020 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
|
1021 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
|
1022 return; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1023 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1024 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1025 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
|
1026 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1027 if (files == null) { |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1028 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
|
1029 return; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1030 } |
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 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
|
1033 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
|
1034 continue; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1035 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1036 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
|
1037 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
|
1038 continue; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1039 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1040 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
|
1041 |
7339
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
1042 try { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1043 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
|
1044 wstParser.parse(file); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1045 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
|
1046 iw.setKind(2); |
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
1047 iw.setDescription(FIXATIONS+ "/" + iw.getDescription()); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1048 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
|
1049 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1050 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
|
1051 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
|
1052 } |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1053 } |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1054 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1055 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1056 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
|
1057 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
|
1058 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
|
1059 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
|
1060 } |
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
|
1061 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1062 log.info("Parse extra longitudinal wst files"); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1063 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1064 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
|
1065 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1066 final File extraDir = FileTools.repair( |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1067 new File(riverDir, EXTRA_LONGITUDINALS)); |
482
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 if (!extraDir.isDirectory() || !extraDir.canRead()) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1070 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
|
1071 return; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1072 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1073 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1074 final File [] files = extraDir.listFiles(); |
482
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 if (files == null) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1077 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
|
1078 return; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1079 } |
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 for (final File file: files) { |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1082 if (!file.isFile() || !file.canRead()) { |
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 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1085 final String name = file.getName().toLowerCase(); |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1086 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1087 continue; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1088 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1089 log.debug("Found WST file: " + file); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1090 |
7339
40e5ad76103c
WST Import: Added parse error exception to WST parser.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7252
diff
changeset
|
1091 try { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1092 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
|
1093 wstParser.parse(file); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1094 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
|
1095 iw.setKind(1); |
8856 | 1096 iw.setDescription( |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1097 EXTRA_LONGITUDINALS + "/" + iw.getDescription()); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1098 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
|
1099 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1100 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
|
1101 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
|
1102 } |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1103 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1104 |
197
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
1105 } |
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
1106 |
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
1107 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
|
1108 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
|
1109 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
|
1110 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
|
1111 } |
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
|
1112 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1113 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
|
1114 try { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1115 wstParser.parse(this.wstFile); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1116 this.wst = wstParser.getWst(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1117 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
|
1118 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1119 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
|
1120 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
|
1121 } |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1122 } |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1123 |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1124 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
|
1125 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
|
1126 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
|
1127 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
|
1128 } |
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
|
1129 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1130 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
|
1131 gltFile = FileTools.repair(gltFile); |
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 if (!gltFile.isFile() || !gltFile.canRead()) { |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1134 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
|
1135 return; |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1136 } |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1137 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1138 final PegelGltParser pgltp = new PegelGltParser(); |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1139 pgltp.parse(gltFile); |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1140 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1141 this.gauges = pgltp.getGauges(); |
189
bc3747a371cc
First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
188
diff
changeset
|
1142 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1143 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
|
1144 gauge.parseDependencies(); |
bc3747a371cc
First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
188
diff
changeset
|
1145 } |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
1146 } |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1147 |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1148 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
|
1149 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
|
1150 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
|
1151 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
|
1152 } |
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
|
1153 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1154 final File riverDir = this.wstFile.getParentFile().getParentFile(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1155 final AnnotationsParser aparser = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1156 new AnnotationsParser(this.annotationClassifier); |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1157 aparser.parse(riverDir); |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1158 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1159 this.annotations = aparser.getAnnotations(); |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
1160 } |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1161 |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1162 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
|
1163 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
|
1164 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
|
1165 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
|
1166 } |
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
|
1167 |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1168 log.info("looking for HYK files"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1169 final HYKParser parser = new HYKParser(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1170 final File riverDir = this.wstFile |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1171 .getParentFile() // Basisdaten |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1172 .getParentFile() // Hydrologie |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1173 .getParentFile(); // <river> |
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 parser.parseHYKs(riverDir, new HYKParser.Callback() { |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1176 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1177 Set<HashedFile> hfs = new HashSet<>(); |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1178 |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1179 @Override |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1180 public boolean hykAccept(final File file) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1181 final HashedFile hf = new HashedFile(file); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1182 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
|
1183 if (!success) { |
8856 | 1184 log.warn("HYK file '" + file |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1185 + "' seems to be a duplicate."); |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1186 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1187 return success; |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1188 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1189 |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1190 @Override |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1191 public void hykParsed(final HYKParser parser) { |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1192 log.debug("callback from HYK parser"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1193 final ImportHYK hyk = parser.getHYK(); |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1194 hyk.setRiver(ImportRiver.this); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1195 ImportRiver.this.hyks.add(hyk); |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1196 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1197 }); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1198 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
1199 |
4712
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1200 |
4767
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1201 /** 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
|
1202 public void parseW80s() { |
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1203 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
|
1204 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
|
1205 return; |
4767
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1206 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1207 final W80Parser parser = new W80Parser(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1208 final File riverDir = this.wstFile |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1209 .getParentFile() // Basisdaten |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1210 .getParentFile() // Hydrologie |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1211 .getParentFile(); // <river> |
4767
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1212 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1213 final ImportRiverCrossSectionParserCallback w80Callback = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1214 new ImportRiverCrossSectionParserCallback("w80"); |
4779
18908a3cbb3a
ImportRiver: Use callback (refactoring), resolving TODOs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4778
diff
changeset
|
1215 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
|
1216 } |
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1217 |
5810
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1218 /** Create a W80 Parser and parse w80 files found. */ |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1219 public void parseW80CSVs() { |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1220 if (Config.INSTANCE.skipW80CSVs()) { |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1221 log.info("skip parsing W80 csvs"); |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1222 return; |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1223 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1224 final W80CSVParser parser = new W80CSVParser(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1225 final File riverDir = this.wstFile |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1226 .getParentFile() // Basisdaten |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1227 .getParentFile() // Hydrologie |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1228 .getParentFile(); // <river> |
5810
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1229 |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1230 // Construct the Cross-Section-Data path. |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1231 final File csDir = new File(riverDir.getPath() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1232 + File.separator + "Geodaesie" |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1233 + File.separator + "Querprofile" |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1234 + File.separator + "QP-Daten"); |
5810
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1235 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1236 final ImportRiverCrossSectionParserCallback w80CSVCallback = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1237 new ImportRiverCrossSectionParserCallback("w80-csv"); |
5810
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1238 parser.parseW80CSVs(csDir, w80CSVCallback); |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1239 } |
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1240 |
4782
696285cef182
ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4781
diff
changeset
|
1241 |
696285cef182
ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4781
diff
changeset
|
1242 /** |
696285cef182
ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4781
diff
changeset
|
1243 * 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
|
1244 * ross-sections found. |
696285cef182
ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4781
diff
changeset
|
1245 */ |
4767
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1246 public void parseDA50s() { |
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1247 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
|
1248 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
|
1249 return; |
4767
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1250 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1251 final DA50Parser parser = new DA50Parser(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1252 final File riverDir = this.wstFile |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1253 .getParentFile() // Basisdaten |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1254 .getParentFile() // Hydrologie |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1255 .getParentFile(); // <river> |
4782
696285cef182
ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4781
diff
changeset
|
1256 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1257 final ImportRiverCrossSectionParserCallback da50Callback = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1258 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
|
1259 |
4782
696285cef182
ImportRiver: Trigger basic (useless) da50 parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4781
diff
changeset
|
1260 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
|
1261 } |
03246a8b3869
ImportRiver: Added w80 and hook for da50 parsing (not implemented).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4735
diff
changeset
|
1262 |
4724
c30152f77f77
ImportRiver: Refactoring, use description and year of da66parser.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4716
diff
changeset
|
1263 |
4712
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1264 /** Create a DA66 Parser and parse the da66 files found. */ |
8856 | 1265 // TODO this is a copy of parsePRFs, extract interfaces |
1266 //(e.g. CrossSectionParser). | |
4712
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1267 public void parseDA66s() { |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1268 if (Config.INSTANCE.skipDA66s()) { |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1269 log.info("skip parsing DA66s"); |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1270 return; |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1271 } |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1272 |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1273 log.info("looking for DA66 files"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1274 final DA66Parser parser = new DA66Parser(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1275 final File riverDir = this.wstFile |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1276 .getParentFile() // Basisdaten |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1277 .getParentFile() // Hydrologie |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1278 .getParentFile(); // <river> |
4712
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1279 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1280 final ImportRiverCrossSectionParserCallback da66Callback = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1281 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
|
1282 |
4779
18908a3cbb3a
ImportRiver: Use callback (refactoring), resolving TODOs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4778
diff
changeset
|
1283 parser.parseDA66s(riverDir, da66Callback); |
4712
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1284 } |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1285 |
70842db72ee4
Include improved DA66Parser into importer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4706
diff
changeset
|
1286 /** 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
|
1287 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
|
1288 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
|
1289 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
|
1290 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
|
1291 } |
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
|
1292 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1293 log.info("looking for PRF files"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1294 final PRFParser parser = new PRFParser(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1295 final File riverDir = this.wstFile |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1296 .getParentFile() // Basisdaten |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1297 .getParentFile() // Hydrologie |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1298 .getParentFile(); // <river> |
1206
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
1299 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1300 final ImportRiverCrossSectionParserCallback prfCallback = |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1301 new ImportRiverCrossSectionParserCallback("prf"); |
4779
18908a3cbb3a
ImportRiver: Use callback (refactoring), resolving TODOs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4778
diff
changeset
|
1302 parser.parsePRFs(riverDir, prfCallback); |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1303 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1304 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1305 public static Date yearToDate(final int year) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1306 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
|
1307 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
|
1308 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
|
1309 cal.setTimeInMillis(ms - ms%1000); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1310 return cal.getTime(); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1311 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1312 |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1313 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
|
1314 /* 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
|
1315 * 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
|
1316 * 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
|
1317 final Session session = ImporterSession.getInstance().getDatabaseSession(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1318 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
|
1319 query.setString("name", this.name); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1320 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
|
1321 if (rivers.isEmpty() && Config.INSTANCE.skipWst()){ |
8856 | 1322 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
|
1323 + "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
|
1324 return; |
827da1952ce2
Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6724
diff
changeset
|
1325 } |
827da1952ce2
Importer: force import of waterlevel WST-file in first run.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6724
diff
changeset
|
1326 |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1327 storeWstUnit(); |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1328 storeAnnotations(); |
1221
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
1329 storeHYKs(); |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1330 storeCrossSections(); |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1331 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
|
1332 storeWst(); |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1333 storeExtraWsts(); |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1334 storeFixations(); |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1335 storeOfficialLines(); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
1336 storeFloodWater(); |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
1337 storeFloodProtection(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1338 storeMeasurementStations(); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1339 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
|
1340 storeSedimentDensity(); |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1341 storePorosity(); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1342 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
|
1343 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
|
1344 storeSedimentLoadLS(); |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1345 storeSedimentLoad(); |
5261
1e403a0efc21
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5248
diff
changeset
|
1346 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
|
1347 storeWaterlevelDifferences(); |
3328
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
1348 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
|
1349 storeOfficialNumber(); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1350 this.sinfoImporter.store(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1351 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
|
1352 } |
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
|
1353 |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1354 public void storeWstUnit() { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1355 if (this.wst == null) { |
8856 | 1356 log.warn("No unit given. " |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1357 + "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
|
1358 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1359 else { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1360 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
|
1361 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1362 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1363 |
1221
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
1364 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
|
1365 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
|
1366 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
|
1367 getPeer(); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1368 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
|
1369 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
|
1370 } |
1221
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
1371 } |
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
1372 } |
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
1373 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1374 public void storeCrossSections() { |
5810
dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5806
diff
changeset
|
1375 if (!Config.INSTANCE.skipPRFs() |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1376 || !Config.INSTANCE.skipDA66s() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1377 || !Config.INSTANCE.skipDA50s() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1378 || !Config.INSTANCE.skipW80s() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1379 || !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
|
1380 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
|
1381 getPeer(); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1382 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
|
1383 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
|
1384 } |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1385 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1386 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
1387 |
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
|
1388 public void storeWst() { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1389 if (this.wst != null && !Config.INSTANCE.skipWst()) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1390 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1391 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
|
1392 |
0fe00824bd96
flys/issue1500: The main wst file determines km_up now.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6724
diff
changeset
|
1393 // 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
|
1394 // 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
|
1395 final Session session = ImporterSession.getInstance() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1396 .getDatabaseSession(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1397 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
|
1398 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
|
1399 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1400 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
1401 |
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
|
1402 public void storeFixations() { |
5262
0d9ad1c432b8
ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5261
diff
changeset
|
1403 if (!Config.INSTANCE.skipFixations()) { |
0d9ad1c432b8
ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5261
diff
changeset
|
1404 log.info("store fixation wsts"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1405 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1406 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
|
1407 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
|
1408 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
|
1409 } |
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
|
1410 } |
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
|
1411 } |
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
|
1412 |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1413 |
5261
1e403a0efc21
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5248
diff
changeset
|
1414 /** 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
|
1415 public void storeWaterlevels() { |
1e403a0efc21
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5248
diff
changeset
|
1416 if (!Config.INSTANCE.skipWaterlevels()) |
5262
0d9ad1c432b8
ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5261
diff
changeset
|
1417 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1418 log.info("store waterlevel wsts from csv"); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1419 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1420 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
|
1421 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
|
1422 wWst.storeDependencies(river); |
1e403a0efc21
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5248
diff
changeset
|
1423 } |
1e403a0efc21
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5248
diff
changeset
|
1424 } |
5262
0d9ad1c432b8
ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5261
diff
changeset
|
1425 |
5261
1e403a0efc21
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5248
diff
changeset
|
1426 |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1427 /** Store wsts from waterleveldifference-csv files. */ |
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1428 public void storeWaterlevelDifferences() { |
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1429 if (!Config.INSTANCE.skipWaterlevelDifferences()) |
5280
dba703edfff1
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5262
diff
changeset
|
1430 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1431 log.info("store waterleveldifferences wsts from csv"); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1432 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1433 for (final ImportWst dWst: this.waterlevelDifferences) { |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1434 log.debug("water.diff.: name " + dWst.getDescription()); |
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1435 dWst.storeDependencies(river); |
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1436 } |
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1437 } |
5280
dba703edfff1
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5262
diff
changeset
|
1438 |
5232
11b2a0c55318
ImportRiver: Import WaterlevelDifferences as Wst.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5227
diff
changeset
|
1439 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1440 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
|
1441 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
|
1442 log.info("store extra wsts"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1443 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1444 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
|
1445 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
|
1446 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
|
1447 } |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1448 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1449 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
1450 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1451 public void storeOfficialLines() { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1452 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
|
1453 return; |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1454 } |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1455 |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1456 log.info("store official lines wsts"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1457 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1458 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
|
1459 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
|
1460 wst.storeDependencies(river); |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1461 |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1462 // 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
|
1463 for (final ImportWstColumn wc: wst.getColumns()) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1464 final ImportOfficialWstColumn owc = (ImportOfficialWstColumn)wc; |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1465 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
|
1466 if (ioc != null) { |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1467 if (ioc.getPeer(river) == null) { |
8856 | 1468 log.warn("Cannot store official line: " |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1469 + ioc.getName()); |
6347
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1470 } |
75c483450c96
Backend: Store official lines from config if they are any.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6345
diff
changeset
|
1471 } |
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
|
1472 } |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1473 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1474 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
1475 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
1476 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
|
1477 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
|
1478 log.info("store flood water wsts"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1479 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1480 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
|
1481 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
|
1482 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
|
1483 } |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
1484 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
1485 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
1486 |
5262
0d9ad1c432b8
ImportRiver: Cosmetics, resolved todo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5261
diff
changeset
|
1487 |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
1488 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
|
1489 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
|
1490 log.info("store flood protection wsts"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1491 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1492 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
|
1493 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
|
1494 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
|
1495 } |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
1496 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
1497 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
1498 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1499 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1500 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
|
1501 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
|
1502 log.info("store bed heights"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1503 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
|
1504 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1505 if (this.bedHeights != null) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1506 for (final ImportBedHeight tmp: this.bedHeights) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1507 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
|
1508 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1509 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
|
1510 |
8559
6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents:
8557
diff
changeset
|
1511 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
|
1512 |
6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents:
8557
diff
changeset
|
1513 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
|
1514 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1515 } |
8559
6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents:
8557
diff
changeset
|
1516 else { |
6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
"Tom Gottfried <tom@intevation.de>"
parents:
8557
diff
changeset
|
1517 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
|
1518 } |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1519 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1520 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1521 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1522 |
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
|
1523 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
|
1524 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
|
1525 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
|
1526 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1527 final River river = getPeer(); |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1528 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1529 for (final ImportSedimentDensity density: this.sedimentDensities) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1530 final String desc = density.getDescription(); |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1531 |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1532 log.debug("name: " + desc); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1533 |
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
|
1534 density.storeDependencies(river); |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1535 } |
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
|
1536 } |
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
|
1537 } |
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
|
1538 |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1539 public void storePorosity() { |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1540 if (!Config.INSTANCE.skipPorosity()) { |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1541 log.info("store porosity"); |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1542 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1543 final River river = getPeer(); |
7841
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1544 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1545 for (final ImportPorosity porosity: this.porosities) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1546 final String desc = porosity.getDescription(); |
7841
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 log.debug("name: " + desc); |
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 porosity.storeDependencies(river); |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1551 } |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1552 } |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1553 } |
8036688f24e1
Parse and import porosities.
Raimund Renkert <rrenkert@intevation.de>
parents:
7767
diff
changeset
|
1554 |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1555 public void storeMorphologicalWidth() { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1556 if (!Config.INSTANCE.skipMorphologicalWidth()) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1557 log.info("store morphological width"); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1558 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1559 final River river = getPeer(); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1560 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1561 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
|
1562 width.storeDependencies(river); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1563 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1564 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1565 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1566 |
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
|
1567 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
|
1568 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
|
1569 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
|
1570 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1571 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
|
1572 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1573 for (final ImportFlowVelocityModel flowVelocityModel: this.flowVelocityModels |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1574 ) { |
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 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
|
1576 } |
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
|
1577 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1578 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
|
1579 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
|
1580 } |
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
|
1581 } |
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
|
1582 } |
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
|
1583 |
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 |
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
|
1585 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
|
1586 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
|
1587 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
|
1588 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1589 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
|
1590 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1591 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
|
1592 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
|
1593 } |
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
|
1594 } |
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
|
1595 } |
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
|
1596 |
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
|
1597 |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1598 public void storeSedimentLoad() { |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1599 if (!Config.INSTANCE.skipSedimentLoad()) { |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1600 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
|
1601 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1602 for (final ImportSedimentLoad sedimentLoad: this.sedimentLoads) { |
8056
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1603 sedimentLoad.storeDependencies(); |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1604 } |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1605 } |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1606 } |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1607 |
d86cc6a17b7a
Importer: Import sediment load at measurement stations.
Tom Gottfried <tom@intevation.de>
parents:
8032
diff
changeset
|
1608 |
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
|
1609 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
|
1610 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
|
1611 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
|
1612 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1613 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
|
1614 |
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
|
1615 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
|
1616 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1617 for (final ImportMeasurementStation station: this.measurementStations) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1618 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
|
1619 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
|
1620 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
|
1621 } |
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
|
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 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
|
1625 } |
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
|
1626 } |
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
|
1627 |
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
|
1628 |
3328
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
1629 public void storeSQRelations() { |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
1630 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
|
1631 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
|
1632 |
3329
cc8fc6b29649
Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3328
diff
changeset
|
1633 int count = 0; |
cc8fc6b29649
Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3328
diff
changeset
|
1634 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1635 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
|
1636 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
|
1637 count++; |
3329
cc8fc6b29649
Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3328
diff
changeset
|
1638 } |
cc8fc6b29649
Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3328
diff
changeset
|
1639 |
cc8fc6b29649
Store sq relations into database after parsing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3328
diff
changeset
|
1640 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
|
1641 } |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
1642 } |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
1643 |
a41f279a66e2
Added parser and import classes to import MINFO sq relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3327
diff
changeset
|
1644 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1645 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
|
1646 if (!Config.INSTANCE.skipAnnotations()) { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1647 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1648 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
|
1649 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
|
1650 } |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1651 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1652 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1653 |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1654 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
|
1655 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
|
1656 log.info("store gauges:"); |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1657 final River river = getPeer(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1658 final Session session = ImporterSession.getInstance() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1659 .getDatabaseSession(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1660 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
|
1661 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
|
1662 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
|
1663 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
|
1664 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
|
1665 } |
191
c4fb5141ce11
Propagate river into storing of gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
190
diff
changeset
|
1666 } |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1667 } |
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1668 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1669 public River getPeer() { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1670 if (this.peer == null) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1671 final Session session = ImporterSession.getInstance() |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1672 .getDatabaseSession(); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1673 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
|
1674 |
5027
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
1675 Unit u = null; |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1676 if (this.wstUnit != null) { |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1677 u = this.wstUnit.getPeer(); |
5027
25c180fa6162
Use BWASTRParser to set official numbers on rivers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5020
diff
changeset
|
1678 } |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1679 |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1680 query.setString("name", this.name); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1681 final List<River> rivers = query.list(); |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1682 if (rivers.isEmpty()) { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1683 log.info("Store new river '" + this.name + "'"); |
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1684 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
|
1685 if (!Config.INSTANCE.skipBWASTR()) { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1686 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
|
1687 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1688 session.save(this.peer); |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1689 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1690 else { |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1691 this.peer = rivers.get(0); |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1692 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1693 } |
8971
50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
mschaefer
parents:
8856
diff
changeset
|
1694 return this.peer; |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1695 } |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1696 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1697 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |