annotate flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java @ 2815:3febaed762b8

Added new parser (stub) to read MINFO sediment density files; prepared import process to handle those files. flys-backend/trunk@4232 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 13 Apr 2012 09:57:37 +0000
parents 8926571e47fb
children 8979f2294af9
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;
1211
f08fe480092c Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1206
diff changeset
28 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
29 import de.intevation.flys.importer.parsers.HYKParser;
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.AnnotationsParser;
f08fe480092c Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1206
diff changeset
31 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
32 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
33 import de.intevation.flys.importer.parsers.SedimentDensityParser;
1211
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.WstParser;
f08fe480092c Moved file parsers to separate package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1206
diff changeset
35
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
36 import org.hibernate.Session;
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
37 import org.hibernate.Query;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2806
diff changeset
38 import org.hibernate.exception.ConstraintViolationException;
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
39
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40 public class ImportRiver
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 {
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
42 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
43
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
44 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
45
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
46 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
47
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
48 public static final String EXTRA_LONGITUDINALS =
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
49 "Zus.L\u00e4ngsschnitte";
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
50
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
51 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
52 "Basisdaten",
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
53 "Fixierungen" };
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
54
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
55 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
56 "Amtl_Linien.wst";
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
57
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
58 public static final String FLOOD_WATER = "HW-Marken";
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
59
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
60 public static final String FLOOD_PROTECTION =
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
61 "HW-Schutzanlagen";
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
62
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
63 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
64
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
65 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
66
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
67 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
68
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
69 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
70
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
71 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
72
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
73
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
74 protected String name;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
75
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
76 protected File wstFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
78 protected File bbInfoFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
79
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
80 protected List<ImportGauge> gauges;
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
81
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
82 protected List<ImportAnnotation> annotations;
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
83
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
84 protected List<ImportHYK> hyks;
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
85
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
86 protected List<ImportCrossSection> crossSections;
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
87
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
88 protected List<ImportWst> extraWsts;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
89
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
90 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
91
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
92 protected List<ImportWst> officialLines;
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
93
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
94 protected List<ImportWst> floodWater;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
95
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
96 protected List<ImportWst> floodProtection;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
97
2811
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
98 protected List<ImportBedHeight> bedHeightSingles;
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
99
2811
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
100 protected List<ImportBedHeight> bedHeightEpochs;
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
101
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
102 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
103
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
104 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
105
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
106 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
107
765
763c4137d6e1 Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 503
diff changeset
108 protected AnnotationClassifier annotationClassifier;
763c4137d6e1 Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 503
diff changeset
109
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
110 protected River peer;
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
111
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 public ImportRiver() {
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
113 hyks = new ArrayList<ImportHYK>();
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
114 crossSections = new ArrayList<ImportCrossSection>();
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
115 extraWsts = new ArrayList<ImportWst>();
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
116 fixations = new ArrayList<ImportWst>();
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
117 officialLines = new ArrayList<ImportWst>();
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
118 floodWater = new ArrayList<ImportWst>();
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
119 floodProtection = new ArrayList<ImportWst>();
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
120 sedimentDensities = new ArrayList<ImportSedimentDensity>();
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122
766
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
123 public ImportRiver(
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
124 String name,
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
125 File wstFile,
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
126 File bbInfoFile,
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
127 AnnotationClassifier annotationClassifier
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
128 ) {
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
129 this();
766
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
130 this.name = name;
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
131 this.wstFile = wstFile;
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
132 this.bbInfoFile = bbInfoFile;
aa9e3da95c31 Importer: Fix import of annotation type classification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
133 this.annotationClassifier = annotationClassifier;
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136 public String getName() {
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137 return name;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
138 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
139
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140 public void setName(String name) {
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
141 this.name = name;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
143
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
144 public File getWstFile() {
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
145 return wstFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
146 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
147
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
148 public void setWstFile(File wstFile) {
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
149 this.wstFile = wstFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
150 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
151
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
152 public File getBBInfo() {
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
153 return bbInfoFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
154 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
155
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
156 public void setBBInfo(File bbInfoFile) {
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
157 this.bbInfoFile = bbInfoFile;
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
158 }
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
159
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
160 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
161 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
162 }
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
163
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
164 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
165 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
166 }
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
167
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
168 public File getMinfoDir() {
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
169 File riverDir = wstFile.getParentFile().getParentFile().getParentFile();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
170 return new File(riverDir, MINFO_DIR);
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
171 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
172
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
173 public void parseDependencies() throws IOException {
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
174 parseGauges();
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
175 parseAnnotations();
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
176 parsePRFs();
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
177 parseHYKs();
197
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
178 parseWst();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
179 parseExtraWsts();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
180 parseFixations();
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
181 parseOfficialLines();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
182 parseFloodWater();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
183 parseFloodProtection();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
184 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
185 parseSedimentDensity();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
186 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
187
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
188 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
189 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
190 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
191 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
192 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
193
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
194 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
195
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
196 File riverDir = wstFile.getParentFile().getParentFile();
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
197
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
198 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
199
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
200 if (!dir.isDirectory() || !dir.canRead()) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
201 log.info("no directory '" + dir + "' found");
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
202 return;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
203 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
204
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
205 File [] files = dir.listFiles();
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
206
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
207 if (files == null) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
208 log.warn("cannot read '" + dir + "'");
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
209 return;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
210 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
211
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
212 for (File file: files) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
213 if (!file.isFile() || !file.canRead()) {
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
214 continue;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
215 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
216 String name = file.getName().toLowerCase();
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
217 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
218 continue;
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
219 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
220 log.info("found file '" + file.getName() + "'");
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
221 WstParser wstParser = new WstParser();
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
222 wstParser.parse(file);
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
223 ImportWst iw = wstParser.getWst();
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
224 iw.setKind(5);
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
225 iw.setDescription(FLOOD_PROTECTION + "/" + iw.getDescription());
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
226 floodProtection.add(iw);
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
227 }
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
228 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
229
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
230
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
231 public void parseBedHeight() throws IOException {
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
232 log.info("Parse bed height.");
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
233
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
234 File minfoDir = getMinfoDir();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
235 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
236 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
237 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
238
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
239 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
240 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
241 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
242 else {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
243 parseBedHeightSingles(singlesDir);
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
244 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
245
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
246 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
247 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
248 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
249 else {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
250 parseBedHeightEpochs(epochDir);
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
251 }
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2806
diff changeset
252
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2806
diff changeset
253 log.info("Finished parsing bed heights.");
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
254 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
255
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
256
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
257 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
258 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
259
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
260 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
261 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
262 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
263 }
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
264
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
265 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
266 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
267
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
268 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
269
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
270 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
271 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
272 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
273 }
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
274
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
275 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
276
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
277 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
278 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
279 }
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
280
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
281 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
282
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
283 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
284 }
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
285
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
286
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
287 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
288 log.debug("Parse bed height singles");
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
289
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
290 File[] files = dir.listFiles();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
291
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
292 if (files == null) {
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
293 log.warn("Cannot parse directory '" + dir + "'");
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
294 return;
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
295 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
296
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
297 BedHeightSingleParser parser = new BedHeightSingleParser();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
298
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
299 for (File file: files) {
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
300 parser.parse(file);
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 bedHeightSingles = parser.getBedHeights();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
304 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
305
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
306
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
307 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
308 log.debug("Parse bed height epochs");
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
309
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
310 File[] files = dir.listFiles();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
311
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
312 if (files == null) {
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
313 log.warn("Cannot parse directory '" + dir + "'");
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
314 return;
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
315 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
316
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
317 BedHeightEpochParser parser = new BedHeightEpochParser();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
318
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
319 for (File file: files) {
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
320 parser.parse(file);
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
321 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
322
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
323 bedHeightEpochs = parser.getBedHeights();
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
324 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
325
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
326
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
327 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
328 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
329 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
330 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
331 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
332
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
333 log.info("Parse flood water wst file");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
334
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
335 File riverDir = wstFile.getParentFile().getParentFile();
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
336
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
337 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
338
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
339 if (!dir.isDirectory() || !dir.canRead()) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
340 log.info("no directory '" + dir + "' found");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
341 return;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
342 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
343
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
344 File [] files = dir.listFiles();
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
345
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
346 if (files == null) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
347 log.warn("cannot read '" + dir + "'");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
348 return;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
349 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
350
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
351 for (File file: files) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
352 if (!file.isFile() || !file.canRead()) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
353 continue;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
354 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
355 String name = file.getName().toLowerCase();
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
356 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
357 continue;
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
358 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
359 log.info("found file '" + file.getName() + "'");
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
360 WstParser wstParser = new WstParser();
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
361 wstParser.parse(file);
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
362 ImportWst iw = wstParser.getWst();
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
363 iw.setKind(4);
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
364 iw.setDescription(FLOOD_WATER + "/" + iw.getDescription());
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
365 floodWater.add(iw);
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
366 }
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
367 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
368
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
369 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
370 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
371 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
372 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
373 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
374
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
375 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
376
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
377 File riverDir = wstFile.getParentFile().getParentFile();
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
378
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
379 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
380 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
381
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
382 if (!dir.isDirectory() || !dir.canRead()) {
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
383 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
384 continue;
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
385 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
386
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
387 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
388 if (!file.isFile() || !file.canRead()) {
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
389 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
390 continue;
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
391 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
392 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
393
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
394 WstParser wstParser = new WstParser();
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
395 wstParser.parse(file);
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
396 ImportWst iw = wstParser.getWst();
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
397 iw.setKind(3);
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
398 iw.setDescription(folder + "/" + iw.getDescription());
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
399 officialLines.add(iw);
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
400 } // for all folders
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
401
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
402 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
403
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
404 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
405 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
406 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
407 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
408 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
409
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
410 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
411
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
412 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
413
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
414 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
415 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
416
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
417 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
418 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
419 return;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
420 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
421
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
422 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
423
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
424 if (files == null) {
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
425 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
426 return;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
427 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
428
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
429 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
430 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
431 continue;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
432 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
433 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
434 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
435 continue;
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
436 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
437 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
438
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
439 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
440 wstParser.parse(file);
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
441 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
442 iw.setKind(2);
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
443 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
444 fixations.add(iw);
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
445 }
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
446 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
447
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
448 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
449 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
450 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
451 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
452 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
453
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
454 log.info("Parse extra longitudinal wst files");
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
455
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
456 File riverDir = wstFile.getParentFile().getParentFile();
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
457
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
458 File extraDir = FileTools.repair(
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
459 new File(riverDir, EXTRA_LONGITUDINALS));
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
460
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
461 if (!extraDir.isDirectory() || !extraDir.canRead()) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
462 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
463 return;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
464 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
465
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
466 File [] files = extraDir.listFiles();
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
467
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
468 if (files == null) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
469 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
470 return;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
471 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
472
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
473 for (File file: files) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
474 if (!file.isFile() || !file.canRead()) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
475 continue;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
476 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
477 String name = file.getName().toLowerCase();
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
478 if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
479 continue;
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
480 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
481 log.debug("Found WST file: " + file);
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
483 WstParser wstParser = new WstParser();
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
484 wstParser.parse(file);
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
485 ImportWst iw = wstParser.getWst();
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
486 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
487 iw.setDescription(EXTRA_LONGITUDINALS + "/" + iw.getDescription());
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
488 extraWsts.add(iw);
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
489 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
490
197
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
491 }
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
492
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
493 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
494 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
495 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
496 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
497 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
498
197
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
499 WstParser wstParser = new WstParser();
c0dcc2357106 Added stub for WST parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 194
diff changeset
500 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
501 wst = wstParser.getWst();
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
502 }
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
503
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
504 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
505 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
506 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
507 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
508 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
509
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
510 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
511 gltFile = FileTools.repair(gltFile);
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
512
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
513 if (!gltFile.isFile() || !gltFile.canRead()) {
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
514 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
515 return;
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
516 }
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
517
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
518 PegelGltParser pgltp = new PegelGltParser();
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
519 pgltp.parse(gltFile);
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
520
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
521 gauges = pgltp.getGauges();
189
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
522
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
523 for (ImportGauge gauge: gauges) {
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
524 gauge.parseDependencies();
bc3747a371cc First part of parsing main values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 188
diff changeset
525 }
184
4ab2c3bd474c Added parsing of PEGEL.GLT files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 177
diff changeset
526 }
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
527
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
528 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
529 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
530 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
531 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
532 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
533
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
534 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
535 AnnotationsParser aparser =
763c4137d6e1 Added classification of annotation types. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 503
diff changeset
536 new AnnotationsParser(annotationClassifier);
186
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
537 aparser.parse(riverDir);
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
538
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
539 annotations = aparser.getAnnotations();
cf8cbcb6a10d Added parser to read *.KM files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 184
diff changeset
540 }
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
541
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
542 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
543 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
544 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
545 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
546 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
547
1220
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
548 log.info("looking for HYK files");
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
549 HYKParser parser = new HYKParser();
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
550 File riverDir = wstFile
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
551 .getParentFile() // Basisdaten
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
552 .getParentFile() // Hydrologie
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
553 .getParentFile(); // <river>
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
554
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
555 parser.parseHYKs(riverDir, new HYKParser.Callback() {
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
556
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
557 Set<HashedFile> hfs = new HashSet<HashedFile>();
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
558
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
559 @Override
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
560 public boolean hykAccept(File file) {
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
561 HashedFile hf = new HashedFile(file);
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
562 boolean success = hfs.add(hf);
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
563 if (!success) {
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
564 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
565 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
566 return success;
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
567 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
568
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
569 @Override
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
570 public void hykParsed(HYKParser parser) {
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
571 log.debug("callback from HYK parser");
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
572 ImportHYK hyk = parser.getHYK();
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
573 hyk.setRiver(ImportRiver.this);
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
574 hyks.add(hyk);
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
575 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
576 });
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
577 }
3c860d3e79d9 Importer: Parse HYKs from importer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1211
diff changeset
578
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
579 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
580 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
581 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
582 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
583 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
584
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
585 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
586 PRFParser parser = new PRFParser();
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
587 File riverDir = wstFile
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
588 .getParentFile() // Basisdaten
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
589 .getParentFile() // Hydrologie
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
590 .getParentFile(); // <river>
1206
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
591
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
592 parser.parsePRFs(riverDir, new PRFParser.Callback() {
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
593
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
594 Set<HashedFile> prfs = new HashSet<HashedFile>();
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
595
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
596 @Override
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
597 public boolean prfAccept(File file) {
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
598 HashedFile hf = new HashedFile(file);
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
599 boolean success = prfs.add(hf);
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
600 if (!success) {
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
601 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
602 }
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
603 return success;
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
604 }
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
605
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
606 @Override
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
607 public void prfParsed(PRFParser parser) {
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
608 log.debug("callback from PRF parser");
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
609
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
610 String description = parser.getDescription();
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
611 Integer year = parser.getYear();
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
612 ImportTimeInterval ti = year != null
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
613 ? new ImportTimeInterval(yearToDate(year))
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
614 : null;
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
615
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
616 List<ImportCrossSectionLine> lines =
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
617 new ArrayList<ImportCrossSectionLine>();
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
618
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
619 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
620 BigDecimal km = new BigDecimal(entry.getKey());
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
621 List<XY> points = entry.getValue();
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
622 lines.add(new ImportCrossSectionLine(km, points));
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
623 }
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
624
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
625 crossSections.add(new ImportCrossSection(
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
626 ImportRiver.this, description, ti, lines));
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
627 }
c7370734b872 Prevent parsing and storing PRF duplicates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1204
diff changeset
628 });
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
629 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
630
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
631 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
632 Calendar cal = Calendar.getInstance();
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
633 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
634 long ms = cal.getTimeInMillis();
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
635 cal.setTimeInMillis(ms - ms%1000);
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
636 return cal.getTime();
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
637 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
638
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
639 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
640 storeWstUnit();
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
641 storeAnnotations();
1221
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
642 storeHYKs();
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
643 storeCrossSections();
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
644 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
645 storeWst();
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
646 storeExtraWsts();
483
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
647 storeFixations();
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
648 storeOfficialLines();
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
649 storeFloodWater();
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
650 storeFloodProtection();
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
651 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
652 storeSedimentDensity();
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
653 }
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
654
2347
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
655 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
656 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
657 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
658 }
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
659 else {
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
660 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
661 }
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
662 }
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
663
1221
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
664 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
665 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
666 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
667 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
668 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
669 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
670 }
1221
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
671 }
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
672 }
979ff070e368 Store HYK data structures to database. Needs testing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1220
diff changeset
673
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
674 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
675 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
676 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
677 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
678 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
679 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
680 }
1204
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
681 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
682 }
22858e7cca79 Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 766
diff changeset
683
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
684 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
685 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
686 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
687 wst.storeDependencies(river);
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
688 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
689 }
f1fd9cab6a07 Importer: parse and store fixation wst files as well
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 482
diff changeset
690
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
691 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
692 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
693 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
694 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
695 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
696 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
697 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
698 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
699 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
700 }
268f8da412e3 Importer: Added a central configuration to allow skipping of parsing/storing individual sub systems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1221
diff changeset
701
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
702 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
703 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
704 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
705 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
706 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
707 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
708 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
709 }
482
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
710 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
711 }
3a99d0295006 Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 201
diff changeset
712
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
713 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
714 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
715 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
716 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
717 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
718 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
719 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
720 }
484
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
721 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
722 }
a9e9a8a44d19 Parse and store "amtliche Linien" wst files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 483
diff changeset
723
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
724 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
725 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
726 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
727 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
728 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
729 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
730 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
731 }
490
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
732 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
733 }
13af9318a4a2 Import "Hochwasser-Marken", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 484
diff changeset
734
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
735 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
736 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
737 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
738 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
739 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
740 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
741 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
742 }
494
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
743 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
744 }
88d5b02ff0c1 Importer: Import the "HW-Schutzanlagen", too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 491
diff changeset
745
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
746
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
747 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
748 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
749 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
750 storeBedHeightSingle();
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
751 }
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2806
diff changeset
752
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
753 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
754 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
755 storeBedHeightEpoch();
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
756 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
757 }
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2806
diff changeset
758
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
759
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
760 private void storeBedHeightSingle() {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
761 River river = getPeer();
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
762
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
763 if (bedHeightSingles != null) {
2811
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
764 for (ImportBedHeight tmp: bedHeightSingles) {
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
765 ImportBedHeightSingle single = (ImportBedHeightSingle) tmp;
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
766
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
767 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
768
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
769 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
770
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
771 try {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
772 single.storeDependencies(river);
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
773 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
774 catch (SQLException sqle) {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
775 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
776 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
777 catch (ConstraintViolationException cve) {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
778 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
779 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
780 }
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
781 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
782 else {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
783 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
784 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
785 }
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
786
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
787
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
788 private void storeBedHeightEpoch() {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
789 River river = getPeer();
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
790
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
791 if (bedHeightEpochs != null) {
2811
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
792 for (ImportBedHeight tmp: bedHeightEpochs) {
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
793 ImportBedHeightEpoch epoch = (ImportBedHeightEpoch) tmp;
8926571e47fb Finished importing MINFO bed heights (single and epoch).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2810
diff changeset
794
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
795 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
796
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
797 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
798
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
799 try {
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
800 epoch.storeDependencies(river);
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
801 }
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
802 catch (SQLException sqle) {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
803 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
804 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
805 catch (ConstraintViolationException cve) {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
806 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
807 }
2806
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
808 }
2810
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
809 }
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
810 else {
04eeb45df27b Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2809
diff changeset
811 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
812 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
813 }
33f40b23edd8 Initial checkin for parsing MINFO bed heights.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2347
diff changeset
814
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
815 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
816 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
817 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
818
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
819 // TODO
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
820 }
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
821 }
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
822
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
823 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
824 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
825 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
826 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
827 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
828 }
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
829 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
830 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
831
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
832 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
833 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
834 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
835 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
836 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
837 .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
838 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
839 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
840 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
841 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
842 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
843 }
191
c4fb5141ce11 Propagate river into storing of gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 190
diff changeset
844 }
190
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
845 }
d40da430d2fe Added stub code to write gauges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 189
diff changeset
846
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
847 public River getPeer() {
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
848 if (peer == null) {
497
67fd63e4ef66 Importer: centralized caching
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 494
diff changeset
849 Session session = ImporterSession.getInstance().getDatabaseSession();
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
850 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
851
0acf28a3d28a Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1234
diff changeset
852 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
853
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
854 query.setString("name", name);
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
855 List<River> rivers = query.list();
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
856 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
857 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
858 peer = new River(name, u);
188
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
859 session.save(peer);
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
860 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
861 else {
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
862 peer = rivers.get(0);
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
863 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
864 }
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
865 return peer;
003ac16812dd Store annotations in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 186
diff changeset
866 }
177
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
867 }
31895d24387e Importer: Added info gew parser.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
868 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org