Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java @ 2851:acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
flys-backend/trunk@4305 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 26 Apr 2012 09:48:49 +0000 |
parents | a65b5b0ade6f |
children | 2f874d14ac68 |
rev | line source |
---|---|
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.importer; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
3 import java.math.BigDecimal; |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
4 |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
5 import java.util.List; |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
6 import java.util.Map; |
1206
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
7 import java.util.Set; |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
8 import java.util.HashSet; |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
9 import java.util.ArrayList; |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
10 import java.util.Date; |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
11 import java.util.Calendar; |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
12 |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import java.io.File; |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
14 import java.io.IOException; |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
15 |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2806
diff
changeset
|
16 import java.sql.SQLException; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2806
diff
changeset
|
17 |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
18 import org.apache.log4j.Logger; |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
19 |
1234
c5c48f52dc7b
Removed FileTools that has been moved to artifacts-common module.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1223
diff
changeset
|
20 import de.intevation.artifacts.common.utils.FileTools; |
c5c48f52dc7b
Removed FileTools that has been moved to artifacts-common module.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1223
diff
changeset
|
21 import de.intevation.artifacts.common.utils.FileTools.HashedFile; |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
22 |
1234
c5c48f52dc7b
Removed FileTools that has been moved to artifacts-common module.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1223
diff
changeset
|
23 import de.intevation.flys.model.River; |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
24 import de.intevation.flys.model.Unit; |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
26 import de.intevation.flys.importer.parsers.BedHeightEpochParser; |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
27 import de.intevation.flys.importer.parsers.BedHeightSingleParser; |
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
|
28 import de.intevation.flys.importer.parsers.FlowVelocityModelParser; |
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
|
29 import de.intevation.flys.importer.parsers.FlowVelocityMeasurementParser; |
1211
f08fe480092c
Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1206
diff
changeset
|
30 import de.intevation.flys.importer.parsers.PRFParser; |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
31 import de.intevation.flys.importer.parsers.HYKParser; |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
32 import de.intevation.flys.importer.parsers.MorphologicalWidthParser; |
1211
f08fe480092c
Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1206
diff
changeset
|
33 import de.intevation.flys.importer.parsers.AnnotationsParser; |
f08fe480092c
Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1206
diff
changeset
|
34 import de.intevation.flys.importer.parsers.AnnotationClassifier; |
f08fe480092c
Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1206
diff
changeset
|
35 import de.intevation.flys.importer.parsers.PegelGltParser; |
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
|
36 import de.intevation.flys.importer.parsers.SedimentDensityParser; |
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
|
37 import de.intevation.flys.importer.parsers.SedimentYieldParser; |
1211
f08fe480092c
Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1206
diff
changeset
|
38 import de.intevation.flys.importer.parsers.WstParser; |
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
|
39 import de.intevation.flys.importer.parsers.WaterlevelDifferencesParser; |
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
|
40 import de.intevation.flys.importer.parsers.WaterlevelParser; |
1211
f08fe480092c
Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1206
diff
changeset
|
41 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
42 import org.hibernate.Session; |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
43 import org.hibernate.Query; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2806
diff
changeset
|
44 import org.hibernate.exception.ConstraintViolationException; |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
45 |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 public class ImportRiver |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 { |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
48 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
|
49 |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
50 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
|
51 |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
52 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
|
53 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
54 public static final String EXTRA_LONGITUDINALS = |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
55 "Zus.L\u00e4ngsschnitte"; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
56 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
57 public static final String [] OFFICIAL_LINES_FOLDERS = { |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
58 "Basisdaten", |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
59 "Fixierungen" }; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
60 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
61 public static final String OFFICIAL_LINES = |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
62 "Amtl_Linien.wst"; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
63 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
64 public static final String FLOOD_WATER = "HW-Marken"; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
65 |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
66 public static final String FLOOD_PROTECTION = |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
67 "HW-Schutzanlagen"; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
68 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
69 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
|
70 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
71 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
|
72 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
73 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
|
74 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
75 public static final String BED_HEIGHT_EPOCH_DIR = "Epochen"; |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
76 |
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
|
77 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
|
78 |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
79 public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite"; |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
80 |
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
|
81 public static final String FLOW_VELOCITY_DIR = "Geschwindigkeit_Schubspannung"; |
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
|
82 |
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
|
83 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
|
84 |
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
|
85 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
|
86 |
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
|
87 public static final String SEDIMENT_YIELD_DIR = "Fracht"; |
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
|
88 |
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
|
89 public static final String SEDIMENT_YIELD_SINGLE_DIR = "Einzeljahre"; |
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
|
90 |
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
|
91 public static final String SEDIMENT_YIELD_EPOCH_DIR = "Epochen"; |
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
|
92 |
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
|
93 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
|
94 |
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
|
95 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
|
96 |
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
|
97 public static final String MINFO_WATERLEVEL_DIFF_DIR = "Wasserspiegeldifferenzen"; |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
98 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
99 |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 protected String name; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 protected File wstFile; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 protected File bbInfoFile; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
106 protected List<ImportGauge> gauges; |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
107 |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
108 protected List<ImportAnnotation> annotations; |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
109 |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
110 protected List<ImportHYK> hyks; |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
111 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
112 protected List<ImportCrossSection> crossSections; |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
113 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
114 protected List<ImportWst> extraWsts; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
115 |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
116 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
|
117 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
118 protected List<ImportWst> officialLines; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
119 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
120 protected List<ImportWst> floodWater; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
121 |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
122 protected List<ImportWst> floodProtection; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
123 |
2811
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
124 protected List<ImportBedHeight> bedHeightSingles; |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
125 |
2811
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
126 protected List<ImportBedHeight> bedHeightEpochs; |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
127 |
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
|
128 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
|
129 |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
130 protected List<ImportMorphWidth> morphologicalWidths; |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
131 |
2827
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
132 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
|
133 |
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
|
134 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
|
135 |
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
|
136 protected List<ImportSedimentYield> sedimentYields; |
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
|
137 |
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
|
138 protected List<ImportWaterlevel> 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
|
139 |
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
|
140 protected List<ImportWaterlevelDifference> waterlevelDiffs; |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
141 |
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
|
142 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
|
143 |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
144 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
|
145 |
765
763c4137d6e1
Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
503
diff
changeset
|
146 protected AnnotationClassifier annotationClassifier; |
763c4137d6e1
Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
503
diff
changeset
|
147 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
148 protected River peer; |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
149 |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 public ImportRiver() { |
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
|
151 hyks = new ArrayList<ImportHYK>(); |
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
|
152 crossSections = new ArrayList<ImportCrossSection>(); |
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
|
153 extraWsts = new ArrayList<ImportWst>(); |
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
|
154 fixations = new ArrayList<ImportWst>(); |
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
|
155 officialLines = new ArrayList<ImportWst>(); |
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
|
156 floodWater = new ArrayList<ImportWst>(); |
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
|
157 floodProtection = new ArrayList<ImportWst>(); |
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
|
158 sedimentDensities = new ArrayList<ImportSedimentDensity>(); |
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
|
159 morphologicalWidths = new ArrayList<ImportMorphWidth>(); |
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
|
160 flowVelocityModels = new ArrayList<ImportFlowVelocityModel>(); |
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
|
161 flowVelocityMeasurements = new ArrayList<ImportFlowVelocityMeasurement>(); |
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
|
162 sedimentYields = new ArrayList<ImportSedimentYield>(); |
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
|
163 waterlevels = new ArrayList<ImportWaterlevel>(); |
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
|
164 waterlevelDiffs = new ArrayList<ImportWaterlevelDifference>(); |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
165 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 |
766
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
167 public ImportRiver( |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
168 String name, |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
169 File wstFile, |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
170 File bbInfoFile, |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
171 AnnotationClassifier annotationClassifier |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
172 ) { |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
173 this(); |
766
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
174 this.name = name; |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
175 this.wstFile = wstFile; |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
176 this.bbInfoFile = bbInfoFile; |
aa9e3da95c31
Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
765
diff
changeset
|
177 this.annotationClassifier = annotationClassifier; |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
178 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
179 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
180 public String getName() { |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
181 return name; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
182 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
183 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
184 public void setName(String name) { |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
185 this.name = name; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
186 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
187 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
188 public File getWstFile() { |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
189 return wstFile; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
190 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
191 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
192 public void setWstFile(File wstFile) { |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
193 this.wstFile = wstFile; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
194 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
195 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
196 public File getBBInfo() { |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
197 return bbInfoFile; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
198 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
199 |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
200 public void setBBInfo(File bbInfoFile) { |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
201 this.bbInfoFile = bbInfoFile; |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
202 } |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
203 |
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
|
204 public ImportWst getWst() { |
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
|
205 return 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
|
206 } |
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
|
207 |
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
|
208 public void setWst(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
|
209 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
|
210 } |
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
|
211 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
212 public File getMinfoDir() { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
213 File riverDir = wstFile.getParentFile().getParentFile().getParentFile(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
214 return new File(riverDir, MINFO_DIR); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
215 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
216 |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
217 public void parseDependencies() throws IOException { |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
218 parseGauges(); |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
219 parseAnnotations(); |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
220 parsePRFs(); |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
221 parseHYKs(); |
197
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
222 parseWst(); |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
223 parseExtraWsts(); |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
224 parseFixations(); |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
225 parseOfficialLines(); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
226 parseFloodWater(); |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
227 parseFloodProtection(); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
228 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
|
229 parseSedimentDensity(); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
230 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
|
231 parseFlowVelocity(); |
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
|
232 parseSedimentYield(); |
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
|
233 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
|
234 parseWaterlevelDifferences(); |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
235 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
236 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
237 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
|
238 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
|
239 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
|
240 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
|
241 } |
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
|
242 |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
243 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
|
244 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
245 File riverDir = wstFile.getParentFile().getParentFile(); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
246 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
247 File dir = FileTools.repair(new File(riverDir, FLOOD_PROTECTION)); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
248 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
249 if (!dir.isDirectory() || !dir.canRead()) { |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
250 log.info("no directory '" + dir + "' found"); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
251 return; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
252 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
253 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
254 File [] files = dir.listFiles(); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
255 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
256 if (files == null) { |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
257 log.warn("cannot read '" + dir + "'"); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
258 return; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
259 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
260 |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
261 for (File file: files) { |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
262 if (!file.isFile() || !file.canRead()) { |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
263 continue; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
264 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
265 String name = file.getName().toLowerCase(); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
266 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
|
267 continue; |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
268 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
269 log.info("found file '" + file.getName() + "'"); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
270 WstParser wstParser = new WstParser(); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
271 wstParser.parse(file); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
272 ImportWst iw = wstParser.getWst(); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
273 iw.setKind(5); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
274 iw.setDescription(FLOOD_PROTECTION + "/" + iw.getDescription()); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
275 floodProtection.add(iw); |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
276 } |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
277 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
278 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
279 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
280 public void parseBedHeight() throws IOException { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
281 File minfoDir = getMinfoDir(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
282 File bedHeightDir = new File(minfoDir, BED_HEIGHT_DIR); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
283 File singlesDir = new File(bedHeightDir, BED_HEIGHT_SINGLE_DIR); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
284 File epochDir = new File(bedHeightDir, BED_HEIGHT_EPOCH_DIR); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
285 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
286 if (Config.INSTANCE.skipBedHeightSingle()) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
287 log.info("skip parsing bed height single."); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
288 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
289 else { |
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
|
290 log.info("Parse bed height single."); |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
291 parseBedHeightSingles(singlesDir); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
292 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
293 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
294 if (Config.INSTANCE.skipBedHeightEpoch()) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
295 log.info("skip parsing bed height epochs."); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
296 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
297 else { |
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
|
298 log.info("Parse bed height epochs."); |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
299 parseBedHeightEpochs(epochDir); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
300 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
301 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
302 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
303 |
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
|
304 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
|
305 log.debug("Parse 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
|
306 |
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
|
307 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
|
308 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
|
309 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
|
310 } |
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
|
311 |
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
|
312 File minfoDir = getMinfoDir(); |
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
|
313 File sediment = new File(minfoDir, SEDIMENT_DENSITY_DIR); |
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
|
314 |
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
|
315 File[] files = sediment.listFiles(); |
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
|
316 |
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
|
317 if (files == null) { |
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
|
318 log.warn("Cannot parse directory '" + sediment + "'"); |
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
|
319 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
|
320 } |
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
|
321 |
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
|
322 SedimentDensityParser parser = new SedimentDensityParser(); |
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
|
323 |
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
|
324 for (File file: files) { |
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
|
325 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
|
326 } |
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
|
327 |
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
|
328 sedimentDensities = parser.getSedimentDensities(); |
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
|
329 |
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
|
330 log.info("Parsed " + sedimentDensities.size() + " sediment densities."); |
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
|
331 } |
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
|
332 |
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
|
333 |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
334 protected void parseMorphologicalWidth() throws IOException { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
335 log.debug("Parse morphological width"); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
336 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
337 if (Config.INSTANCE.skipMorphologicalWidth()) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
338 log.info("skip parsing morphological width."); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
339 return; |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
340 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
341 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
342 File minfoDir = getMinfoDir(); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
343 File morphDir = new File(minfoDir, MORPHOLOGICAL_WIDTH_DIR); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
344 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
345 File[] files = morphDir.listFiles(); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
346 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
347 if (files == null) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
348 log.warn("Cannot parse directory '" + morphDir + "'"); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
349 return; |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
350 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
351 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
352 MorphologicalWidthParser parser = new MorphologicalWidthParser(); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
353 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
354 for (File file: files) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
355 parser.parse(file); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
356 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
357 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
358 morphologicalWidths = parser.getMorphologicalWidths(); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
359 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
360 log.info("Parsed " + morphologicalWidths.size() + " morph. widths files."); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
361 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
362 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
363 |
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
|
364 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
|
365 log.debug("Parse 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
|
366 |
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
|
367 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
|
368 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
|
369 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
|
370 } |
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
|
371 |
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
|
372 File minfoDir = getMinfoDir(); |
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
|
373 File flowDir = new File(minfoDir, FLOW_VELOCITY_DIR); |
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
|
374 File modelDir = new File(flowDir, FLOW_VELOCITY_MODEL); |
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
|
375 File measureDir = new File(flowDir, FLOW_VELOCITY_MEASUREMENTS); |
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
|
376 |
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
|
377 File[] modelFiles = modelDir.listFiles(); |
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
|
378 File[] measureFiles = measureDir.listFiles(); |
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
|
379 |
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
|
380 if (modelFiles == null) { |
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
|
381 log.warn("Cannot parse directory '" + modelDir + "'"); |
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
|
382 } |
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
|
383 else { |
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
|
384 FlowVelocityModelParser parser = new FlowVelocityModelParser(); |
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
|
385 |
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
|
386 for (File model: modelFiles) { |
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
|
387 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
|
388 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
|
389 } |
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
|
390 |
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
|
391 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
|
392 } |
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
|
393 |
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
|
394 if (measureFiles == null) { |
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
|
395 log.warn("Cannot parse directory '" + measureDir + "'"); |
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
|
396 } |
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
|
397 else { |
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
|
398 FlowVelocityMeasurementParser parser = |
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
|
399 new FlowVelocityMeasurementParser(); |
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
|
400 |
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
|
401 for (File measurement: measureFiles) { |
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
|
402 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
|
403 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
|
404 } |
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
|
405 |
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
|
406 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
|
407 } |
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
|
408 } |
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
|
409 |
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
|
410 |
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
|
411 protected void parseSedimentYield() throws IOException { |
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
|
412 log.debug("Parse sediment yield data"); |
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
|
413 |
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
|
414 if (Config.INSTANCE.skipSedimentYield()) { |
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
|
415 log.info("skip parsing sediment yield data"); |
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
|
416 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
|
417 } |
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
|
418 |
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
|
419 File minfoDir = getMinfoDir(); |
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
|
420 File sedimentYieldDir = new File(minfoDir, SEDIMENT_YIELD_DIR); |
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
|
421 |
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
|
422 File singleDir = new File(sedimentYieldDir, SEDIMENT_YIELD_SINGLE_DIR); |
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
|
423 File epochDir = new File(sedimentYieldDir, SEDIMENT_YIELD_EPOCH_DIR); |
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
|
424 |
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
|
425 File[] singles = singleDir.listFiles(); |
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
|
426 File[] epochs = epochDir.listFiles(); |
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
|
427 |
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
|
428 SedimentYieldParser parser = new SedimentYieldParser(); |
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
|
429 |
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
|
430 if (singles == null || singles.length == 0) { |
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
|
431 log.warn("Cannot parse directory '" + singleDir + "'"); |
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
|
432 } |
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
|
433 else { |
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
|
434 for (File file: singles) { |
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
|
435 if (file.isDirectory()) { |
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
|
436 for (File child: file.listFiles()) { |
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
|
437 parser.parse(child); |
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
|
438 } |
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
|
439 } |
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
|
440 else { |
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
|
441 parser.parse(file); |
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
|
442 } |
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
|
443 } |
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
|
444 } |
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
|
445 |
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
|
446 if (epochs == null || epochs.length == 0) { |
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
|
447 log.warn("Cannot parse directory '" + epochDir + "'"); |
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
|
448 } |
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
|
449 else { |
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
|
450 for (File file: epochs) { |
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
|
451 if (file.isDirectory()) { |
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
|
452 for (File child: file.listFiles()) { |
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
|
453 parser.parse(child); |
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
|
454 } |
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
|
455 } |
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
|
456 else { |
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
|
457 parser.parse(file); |
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
|
458 } |
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
|
459 } |
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
|
460 } |
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
|
461 |
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
|
462 sedimentYields = parser.getSedimentYields(); |
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
|
463 } |
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
|
464 |
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
|
465 |
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
|
466 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
|
467 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
|
468 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
|
469 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
|
470 } |
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
|
471 |
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
|
472 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
|
473 |
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
|
474 File minfo = getMinfoDir(); |
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
|
475 File fixDir = new File(minfo, MINFO_FIXATIONS_DIR); |
2845
a65b5b0ade6f
Completed the MINFO waterlevel import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
476 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
|
477 |
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
|
478 File[] files = wspDir.listFiles(); |
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
|
479 |
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
|
480 if (files == null) { |
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
|
481 log.warn("Cannot read directory '" + wspDir + "'"); |
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
|
482 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
|
483 } |
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
|
484 |
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
|
485 WaterlevelParser parser = new WaterlevelParser(); |
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
|
486 |
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
|
487 for (File file: files) { |
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
|
488 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
|
489 } |
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
|
490 |
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
|
491 waterlevels = parser.getWaterlevels(); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
492 } |
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
|
493 |
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
|
494 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
495 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
|
496 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
|
497 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
|
498 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
|
499 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
500 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
501 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
|
502 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
503 File minfo = getMinfoDir(); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
504 File fixDir = new File(minfo, MINFO_FIXATIONS_DIR); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
505 File diffDir = new File(fixDir, MINFO_WATERLEVEL_DIFF_DIR); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
506 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
507 File[] files = diffDir.listFiles(); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
508 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
509 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
|
510 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
|
511 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
|
512 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
513 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
514 WaterlevelDifferencesParser parser = new WaterlevelDifferencesParser(); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
515 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
516 for (File file: files) { |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
517 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
|
518 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
519 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
520 waterlevelDiffs = parser.getDifferences(); |
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
|
521 } |
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
|
522 |
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
|
523 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
524 protected void parseBedHeightSingles(File dir) throws IOException { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
525 log.debug("Parse bed height singles"); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
526 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
527 File[] files = dir.listFiles(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
528 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
529 if (files == null) { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
530 log.warn("Cannot parse directory '" + dir + "'"); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
531 return; |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
532 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
533 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
534 BedHeightSingleParser parser = new BedHeightSingleParser(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
535 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
536 for (File file: files) { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
537 parser.parse(file); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
538 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
539 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
540 bedHeightSingles = parser.getBedHeights(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
541 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
542 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
543 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
544 protected void parseBedHeightEpochs(File dir) throws IOException { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
545 log.debug("Parse bed height epochs"); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
546 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
547 File[] files = dir.listFiles(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
548 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
549 if (files == null) { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
550 log.warn("Cannot parse directory '" + dir + "'"); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
551 return; |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
552 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
553 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
554 BedHeightEpochParser parser = new BedHeightEpochParser(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
555 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
556 for (File file: files) { |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
557 parser.parse(file); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
558 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
559 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
560 bedHeightEpochs = parser.getBedHeights(); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
561 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
562 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
563 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
564 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
|
565 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
|
566 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
|
567 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
|
568 } |
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
|
569 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
570 log.info("Parse flood water wst file"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
571 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
572 File riverDir = wstFile.getParentFile().getParentFile(); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
573 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
574 File dir = FileTools.repair(new File(riverDir, FLOOD_WATER)); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
575 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
576 if (!dir.isDirectory() || !dir.canRead()) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
577 log.info("no directory '" + dir + "' found"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
578 return; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
579 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
580 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
581 File [] files = dir.listFiles(); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
582 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
583 if (files == null) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
584 log.warn("cannot read '" + dir + "'"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
585 return; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
586 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
587 |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
588 for (File file: files) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
589 if (!file.isFile() || !file.canRead()) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
590 continue; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
591 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
592 String name = file.getName().toLowerCase(); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
593 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) { |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
594 continue; |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
595 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
596 log.info("found file '" + file.getName() + "'"); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
597 WstParser wstParser = new WstParser(); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
598 wstParser.parse(file); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
599 ImportWst iw = wstParser.getWst(); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
600 iw.setKind(4); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
601 iw.setDescription(FLOOD_WATER + "/" + iw.getDescription()); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
602 floodWater.add(iw); |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
603 } |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
604 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
605 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
606 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
|
607 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
|
608 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
|
609 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
|
610 } |
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
|
611 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
612 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
|
613 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
614 File riverDir = wstFile.getParentFile().getParentFile(); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
615 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
616 for (String folder: OFFICIAL_LINES_FOLDERS) { |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
617 File dir = FileTools.repair(new File(riverDir, folder)); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
618 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
619 if (!dir.isDirectory() || !dir.canRead()) { |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
620 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
|
621 continue; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
622 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
623 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
624 File file = FileTools.repair(new File(dir, OFFICIAL_LINES)); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
625 if (!file.isFile() || !file.canRead()) { |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
626 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
|
627 continue; |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
628 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
629 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
|
630 |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
631 WstParser wstParser = new WstParser(); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
632 wstParser.parse(file); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
633 ImportWst iw = wstParser.getWst(); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
634 iw.setKind(3); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
635 iw.setDescription(folder + "/" + iw.getDescription()); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
636 officialLines.add(iw); |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
637 } // for all folders |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
638 |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
639 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
640 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
641 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
|
642 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
|
643 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
|
644 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
|
645 } |
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
|
646 |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
647 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
|
648 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
649 File riverDir = wstFile.getParentFile().getParentFile(); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
650 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
651 File fixDir = FileTools.repair( |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
652 new File(riverDir, FIXATIONS)); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
653 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
654 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
|
655 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
|
656 return; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
657 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
658 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
659 File [] files = fixDir.listFiles(); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
660 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
661 if (files == null) { |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
662 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
|
663 return; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
664 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
665 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
666 for (File file: files) { |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
667 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
|
668 continue; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
669 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
670 String name = file.getName().toLowerCase(); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
671 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
|
672 continue; |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
673 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
674 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
|
675 |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
676 WstParser wstParser = new WstParser(); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
677 wstParser.parse(file); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
678 ImportWst iw = wstParser.getWst(); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
679 iw.setKind(2); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
680 iw.setDescription(FIXATIONS+ "/" + iw.getDescription()); |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
681 fixations.add(iw); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
682 } |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
683 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
684 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
685 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
|
686 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
|
687 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
|
688 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
|
689 } |
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
|
690 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
691 log.info("Parse extra longitudinal wst files"); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
692 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
693 File riverDir = wstFile.getParentFile().getParentFile(); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
694 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
695 File extraDir = FileTools.repair( |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
696 new File(riverDir, EXTRA_LONGITUDINALS)); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
697 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
698 if (!extraDir.isDirectory() || !extraDir.canRead()) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
699 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
|
700 return; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
701 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
702 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
703 File [] files = extraDir.listFiles(); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
704 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
705 if (files == null) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
706 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
|
707 return; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
708 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
709 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
710 for (File file: files) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
711 if (!file.isFile() || !file.canRead()) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
712 continue; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
713 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
714 String name = file.getName().toLowerCase(); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
715 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
716 continue; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
717 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
718 log.debug("Found WST file: " + file); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
719 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
720 WstParser wstParser = new WstParser(); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
721 wstParser.parse(file); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
722 ImportWst iw = wstParser.getWst(); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
723 iw.setKind(1); |
491
738140fe56fe
Importer: Prefix "Zusätzliche Längsschnitte" with "Zus.Längsschnitte" in description.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
490
diff
changeset
|
724 iw.setDescription(EXTRA_LONGITUDINALS + "/" + iw.getDescription()); |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
725 extraWsts.add(iw); |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
726 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
727 |
197
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
728 } |
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
729 |
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
730 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
|
731 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
|
732 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
|
733 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
|
734 } |
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
|
735 |
197
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
736 WstParser wstParser = new WstParser(); |
c0dcc2357106
Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
194
diff
changeset
|
737 wstParser.parse(wstFile); |
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
|
738 wst = wstParser.getWst(); |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
739 } |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
740 |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
741 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
|
742 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
|
743 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
|
744 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
|
745 } |
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
|
746 |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
747 File gltFile = new File(wstFile.getParentFile(), PEGEL_GLT); |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
748 gltFile = FileTools.repair(gltFile); |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
749 |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
750 if (!gltFile.isFile() || !gltFile.canRead()) { |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
751 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
|
752 return; |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
753 } |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
754 |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
755 PegelGltParser pgltp = new PegelGltParser(); |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
756 pgltp.parse(gltFile); |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
757 |
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
758 gauges = pgltp.getGauges(); |
189
bc3747a371cc
First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
188
diff
changeset
|
759 |
bc3747a371cc
First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
188
diff
changeset
|
760 for (ImportGauge gauge: gauges) { |
bc3747a371cc
First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
188
diff
changeset
|
761 gauge.parseDependencies(); |
bc3747a371cc
First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
188
diff
changeset
|
762 } |
184
4ab2c3bd474c
Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
177
diff
changeset
|
763 } |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
764 |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
765 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
|
766 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
|
767 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
|
768 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
|
769 } |
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
|
770 |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
771 File riverDir = wstFile.getParentFile().getParentFile(); |
765
763c4137d6e1
Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
503
diff
changeset
|
772 AnnotationsParser aparser = |
763c4137d6e1
Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
503
diff
changeset
|
773 new AnnotationsParser(annotationClassifier); |
186
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
774 aparser.parse(riverDir); |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
775 |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
776 annotations = aparser.getAnnotations(); |
cf8cbcb6a10d
Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
184
diff
changeset
|
777 } |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
778 |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
779 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
|
780 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
|
781 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
|
782 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
|
783 } |
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
|
784 |
1220
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
785 log.info("looking for HYK files"); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
786 HYKParser parser = new HYKParser(); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
787 File riverDir = wstFile |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
788 .getParentFile() // Basisdaten |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
789 .getParentFile() // Hydrologie |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
790 .getParentFile(); // <river> |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
791 |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
792 parser.parseHYKs(riverDir, new HYKParser.Callback() { |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
793 |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
794 Set<HashedFile> hfs = new HashSet<HashedFile>(); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
795 |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
796 @Override |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
797 public boolean hykAccept(File file) { |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
798 HashedFile hf = new HashedFile(file); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
799 boolean success = hfs.add(hf); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
800 if (!success) { |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
801 log.warn("HYK file '" + file + "' seems to be a duplicate."); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
802 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
803 return success; |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
804 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
805 |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
806 @Override |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
807 public void hykParsed(HYKParser parser) { |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
808 log.debug("callback from HYK parser"); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
809 ImportHYK hyk = parser.getHYK(); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
810 hyk.setRiver(ImportRiver.this); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
811 hyks.add(hyk); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
812 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
813 }); |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
814 } |
3c860d3e79d9
Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1211
diff
changeset
|
815 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
816 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
|
817 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
|
818 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
|
819 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
|
820 } |
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
|
821 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
822 log.info("looking for PRF files"); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
823 PRFParser parser = new PRFParser(); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
824 File riverDir = wstFile |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
825 .getParentFile() // Basisdaten |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
826 .getParentFile() // Hydrologie |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
827 .getParentFile(); // <river> |
1206
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
828 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
829 parser.parsePRFs(riverDir, new PRFParser.Callback() { |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
830 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
831 Set<HashedFile> prfs = new HashSet<HashedFile>(); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
832 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
833 @Override |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
834 public boolean prfAccept(File file) { |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
835 HashedFile hf = new HashedFile(file); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
836 boolean success = prfs.add(hf); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
837 if (!success) { |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
838 log.warn("PRF file '" + file + "' seems to be a duplicate."); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
839 } |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
840 return success; |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
841 } |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
842 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
843 @Override |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
844 public void prfParsed(PRFParser parser) { |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
845 log.debug("callback from PRF parser"); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
846 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
847 String description = parser.getDescription(); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
848 Integer year = parser.getYear(); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
849 ImportTimeInterval ti = year != null |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
850 ? new ImportTimeInterval(yearToDate(year)) |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
851 : null; |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
852 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
853 List<ImportCrossSectionLine> lines = |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
854 new ArrayList<ImportCrossSectionLine>(); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
855 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
856 for (Map.Entry<Double, List<XY>> entry: parser.getData().entrySet()) { |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
857 BigDecimal km = new BigDecimal(entry.getKey()); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
858 List<XY> points = entry.getValue(); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
859 lines.add(new ImportCrossSectionLine(km, points)); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
860 } |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
861 |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
862 crossSections.add(new ImportCrossSection( |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
863 ImportRiver.this, description, ti, lines)); |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
864 } |
c7370734b872
Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
865 }); |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
866 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
867 |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
868 public static Date yearToDate(int year) { |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
869 Calendar cal = Calendar.getInstance(); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
870 cal.set(year, 5, 15, 12, 0, 0); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
871 long ms = cal.getTimeInMillis(); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
872 cal.setTimeInMillis(ms - ms%1000); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
873 return cal.getTime(); |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
874 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
875 |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
876 public void storeDependencies() { |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
877 storeWstUnit(); |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
878 storeAnnotations(); |
1221
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
879 storeHYKs(); |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
880 storeCrossSections(); |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
881 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
|
882 storeWst(); |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
883 storeExtraWsts(); |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
884 storeFixations(); |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
885 storeOfficialLines(); |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
886 storeFloodWater(); |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
887 storeFloodProtection(); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
888 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
|
889 storeSedimentDensity(); |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
890 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
|
891 storeFlowVelocity(); |
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
|
892 storeSedimentYield(); |
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
|
893 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
|
894 storeWaterlevelDifferences(); |
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
|
895 } |
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
|
896 |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
897 public void storeWstUnit() { |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
898 if (wst == null) { |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
899 wstUnit = new ImportUnit("NN + m"); |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
900 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
901 else { |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
902 wstUnit = wst.getUnit(); |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
903 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
904 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
905 |
1221
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
906 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
|
907 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
|
908 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
|
909 getPeer(); |
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
|
910 for (ImportHYK hyk: 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
|
911 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
|
912 } |
1221
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
913 } |
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
914 } |
979ff070e368
Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1220
diff
changeset
|
915 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
916 public void storeCrossSections() { |
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
|
917 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
|
918 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
|
919 getPeer(); |
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
|
920 for (ImportCrossSection crossSection: crossSections) { |
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
|
921 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
|
922 } |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
923 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
924 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
766
diff
changeset
|
925 |
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
|
926 public void storeWst() { |
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
|
927 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
|
928 River river = getPeer(); |
483
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
929 wst.storeDependencies(river); |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
930 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
931 } |
f1fd9cab6a07
Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
932 |
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
|
933 public void storeFixations() { |
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
|
934 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
|
935 log.info("store fixation wsts"); |
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
|
936 River river = getPeer(); |
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
|
937 for (ImportWst wst: 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
|
938 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
|
939 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
|
940 } |
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
|
941 } |
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
|
942 } |
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
|
943 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
944 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
|
945 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
|
946 log.info("store extra wsts"); |
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
|
947 River river = getPeer(); |
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
|
948 for (ImportWst wst: extraWsts) { |
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
|
949 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
|
950 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
|
951 } |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
952 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
953 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
954 |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
955 public void storeOfficialLines() { |
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
|
956 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
|
957 log.info("store official lines wsts"); |
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
|
958 River river = getPeer(); |
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
|
959 for (ImportWst wst: officialLines) { |
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
|
960 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
|
961 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
|
962 } |
484
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
963 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
964 } |
a9e9a8a44d19
Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
483
diff
changeset
|
965 |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
966 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
|
967 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
|
968 log.info("store flood water wsts"); |
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
|
969 River river = getPeer(); |
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
|
970 for (ImportWst wst: floodWater) { |
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
|
971 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
|
972 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
|
973 } |
490
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
974 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
975 } |
13af9318a4a2
Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
484
diff
changeset
|
976 |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
977 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
|
978 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
|
979 log.info("store flood protection wsts"); |
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
|
980 River river = getPeer(); |
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
|
981 for (ImportWst wst: floodProtection) { |
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
|
982 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
|
983 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
|
984 } |
494
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
985 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
986 } |
88d5b02ff0c1
Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
491
diff
changeset
|
987 |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
988 |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
989 public void storeBedHeight() { |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
990 if (!Config.INSTANCE.skipBedHeightSingle()) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
991 log.info("store bed heights single"); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
992 storeBedHeightSingle(); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
993 } |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2806
diff
changeset
|
994 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
995 if (!Config.INSTANCE.skipBedHeightEpoch()) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
996 log.info("store bed height epoch."); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
997 storeBedHeightEpoch(); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
998 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
999 } |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2806
diff
changeset
|
1000 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1001 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1002 private void storeBedHeightSingle() { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1003 River river = getPeer(); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1004 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1005 if (bedHeightSingles != null) { |
2811
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
1006 for (ImportBedHeight tmp: bedHeightSingles) { |
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
1007 ImportBedHeightSingle single = (ImportBedHeightSingle) tmp; |
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
1008 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1009 String desc = single.getDescription(); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1010 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1011 log.debug("name: " + desc); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1012 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1013 try { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1014 single.storeDependencies(river); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1015 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1016 catch (SQLException sqle) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1017 log.error("File '" + desc + "' is broken!"); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1018 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1019 catch (ConstraintViolationException cve) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1020 log.error("File '" + desc + "' is broken!"); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1021 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1022 } |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1023 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1024 else { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1025 log.info("No single bed heights to store."); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1026 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1027 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1028 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1029 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1030 private void storeBedHeightEpoch() { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1031 River river = getPeer(); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1032 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1033 if (bedHeightEpochs != null) { |
2811
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
1034 for (ImportBedHeight tmp: bedHeightEpochs) { |
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
1035 ImportBedHeightEpoch epoch = (ImportBedHeightEpoch) tmp; |
8926571e47fb
Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
1036 |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1037 String desc = epoch.getDescription(); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1038 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1039 log.debug("name: " + desc); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1040 |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1041 try { |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1042 epoch.storeDependencies(river); |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1043 } |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1044 catch (SQLException sqle) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1045 log.error("File '" + desc + "' is broken!"); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1046 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1047 catch (ConstraintViolationException cve) { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1048 log.error("File '" + desc + "' is broken!"); |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1049 } |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1050 } |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1051 } |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1052 else { |
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
1053 log.info("No epoch bed heights to store."); |
2806
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1054 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1055 } |
33f40b23edd8
Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2347
diff
changeset
|
1056 |
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
|
1057 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
|
1058 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
|
1059 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
|
1060 |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1061 River river = getPeer(); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1062 |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1063 for (ImportSedimentDensity density: sedimentDensities) { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1064 String desc = density.getDescription(); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1065 |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1066 log.debug("name: " + desc); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1067 |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1068 try { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1069 density.storeDependencies(river); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1070 } |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1071 catch (SQLException sqle) { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1072 log.error("File '" + desc + "' is broken!"); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1073 } |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1074 catch (ConstraintViolationException cve) { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1075 log.error("File '" + desc + "' is broken!"); |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1076 } |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2815
diff
changeset
|
1077 } |
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
|
1078 } |
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
|
1079 } |
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
|
1080 |
2821
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1081 public void storeMorphologicalWidth() { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1082 if (!Config.INSTANCE.skipMorphologicalWidth()) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1083 log.info("store morphological width"); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1084 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1085 River river = getPeer(); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1086 |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1087 for (ImportMorphWidth width: morphologicalWidths) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1088 try { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1089 width.storeDependencies(river); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1090 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1091 catch (SQLException sqle) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1092 log.error("Error while parsing file for morph. width."); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1093 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1094 catch (ConstraintViolationException cve) { |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1095 log.error("Error while parsing file for morph. width."); |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1096 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1097 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1098 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1099 } |
0a536eb5d668
Added parser for parsing morphological widths.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
1100 |
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
|
1101 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
|
1102 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
|
1103 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
|
1104 |
2827
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1105 River river = getPeer(); |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1106 |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1107 for (ImportFlowVelocityModel flowVelocityModel: flowVelocityModels){ |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1108 try { |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1109 flowVelocityModel.storeDependencies(river); |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1110 } |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1111 catch (SQLException sqle) { |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1112 log.error("Error while storing flow velocity model.", sqle); |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1113 } |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1114 catch (ConstraintViolationException cve) { |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1115 log.error("Error while storing flow velocity model.", cve); |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1116 } |
85b25e74594f
Added temp classes used during the import process of flow velocity data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2826
diff
changeset
|
1117 } |
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
|
1118 |
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
|
1119 for (ImportFlowVelocityMeasurement m: 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
|
1120 try { |
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
|
1121 m.storeDependencies(river); |
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
|
1122 } |
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
|
1123 catch (SQLException sqle) { |
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
|
1124 log.error("Error while storing flow velocity measurement.", sqle); |
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
|
1125 } |
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
|
1126 catch (ConstraintViolationException cve) { |
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
|
1127 log.error("Error while storing flow velocity measurement.", cve); |
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
|
1128 } |
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
|
1129 } |
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
|
1130 } |
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
|
1131 } |
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
|
1132 |
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
|
1133 |
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
|
1134 public void storeSedimentYield() { |
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
|
1135 if (!Config.INSTANCE.skipSedimentYield()) { |
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
|
1136 log.info("store sediment yield data"); |
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
|
1137 |
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
|
1138 River river = getPeer(); |
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
|
1139 |
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
|
1140 for (ImportSedimentYield sedimentYield: sedimentYields) { |
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
|
1141 try { |
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
|
1142 sedimentYield.storeDependencies(river); |
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
|
1143 } |
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
|
1144 catch (SQLException sqle) { |
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
|
1145 log.error("Error while storing sediment yield.", sqle); |
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
|
1146 } |
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
|
1147 catch (ConstraintViolationException cve) { |
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
|
1148 log.error("Error while storing sediment yield.", cve); |
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
|
1149 } |
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
|
1150 } |
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
|
1151 } |
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
|
1152 } |
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
|
1153 |
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
|
1154 |
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
|
1155 public void storeWaterlevels() { |
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
|
1156 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
|
1157 log.info("store 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
|
1158 |
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
|
1159 River river = getPeer(); |
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
|
1160 |
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
|
1161 for (ImportWaterlevel waterlevel: 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
|
1162 waterlevel.storeDependencies(river); |
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
|
1163 } |
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
|
1164 } |
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
|
1165 } |
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
|
1166 |
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
|
1167 |
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
|
1168 public void storeWaterlevelDifferences() { |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1169 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
|
1170 log.info("store 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
|
1171 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1172 River river = getPeer(); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1173 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1174 for (ImportWaterlevelDifference diff: waterlevelDiffs) { |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1175 try { |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1176 diff.storeDependencies(river); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1177 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1178 catch (SQLException sqle) { |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1179 log.error("Error while storing waterlevel diff.", sqle); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1180 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1181 catch (ConstraintViolationException cve) { |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1182 log.error("Error while storing waterlevel diff.", cve); |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1183 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1184 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1185 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1186 } |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1187 |
acb8d08f59a2
Parse and store MINFO waterlevel differences; added config option to skip this process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2845
diff
changeset
|
1188 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1189 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
|
1190 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
|
1191 River river = getPeer(); |
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
|
1192 for (ImportAnnotation annotation: 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
|
1193 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
|
1194 } |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1195 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1196 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1197 |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1198 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
|
1199 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
|
1200 log.info("store 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
|
1201 River river = getPeer(); |
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
|
1202 Session session = ImporterSession.getInstance() |
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
|
1203 .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
|
1204 for (ImportGauge gauge: 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
|
1205 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
|
1206 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
|
1207 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
|
1208 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
|
1209 } |
191
c4fb5141ce11
Propagate river into storing of gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
190
diff
changeset
|
1210 } |
190
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1211 } |
d40da430d2fe
Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
189
diff
changeset
|
1212 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1213 public River getPeer() { |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1214 if (peer == null) { |
497
67fd63e4ef66
Importer: centralized caching
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
494
diff
changeset
|
1215 Session session = ImporterSession.getInstance().getDatabaseSession(); |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1216 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
|
1217 |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1218 Unit u = wstUnit.getPeer(); |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1219 |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1220 query.setString("name", name); |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1221 List<River> rivers = query.list(); |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1222 if (rivers.isEmpty()) { |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1223 log.info("Store new river '" + name + "'"); |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1234
diff
changeset
|
1224 peer = new River(name, u); |
188
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1225 session.save(peer); |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1226 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1227 else { |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1228 peer = rivers.get(0); |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1229 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1230 } |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1231 return peer; |
003ac16812dd
Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
186
diff
changeset
|
1232 } |
177
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1233 } |
31895d24387e
Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1234 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |