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