Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java @ 2562:ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
flys-artifacts/trunk@4088 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 20 Feb 2012 14:36:28 +0000 |
parents | b3f6d49cdc80 |
children | 59c920e73d8a |
rev | line source |
---|---|
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.text.SimpleDateFormat; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import java.util.ArrayList; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 import java.util.Collections; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import java.util.Comparator; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 import java.util.Date; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.util.HashMap; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import java.util.List; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import java.util.Map; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.apache.log4j.Logger; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 import org.hibernate.SQLQuery; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 import org.hibernate.Session; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 import org.hibernate.type.StandardBasicTypes; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 import org.w3c.dom.Document; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 import org.w3c.dom.Element; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 public class FixingsOverview |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 implements Serializable |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 private static Logger log = Logger.getLogger(FixingsOverview.class); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 public static final double EPSILON = 1e-5; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 public static final double EPSILON2 = 1e-1; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 public static final String SQL_RIVER_ID = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 " id AS river_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 " km_up " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 "FROM rivers " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 " name = :name"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 public static final String SQL_RIVER_EXTENT = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 " MIN(wcv.position) AS start_km," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 " MAX(wcv.position) AS end_km " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 "FROM wst_column_values wcv" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 " JOIN wst_columns wc ON wcv.wst_column_id = wc.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 " JOIN wsts w ON wc.wst_id = w.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 " w.kind = 0 AND w.river_id = :river_id"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 public static final String SQL_GAUGES = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 " g.id AS gauge_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 " r.a AS a," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 " r.b AS b " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 "FROM gauges g" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 " JOIN ranges r ON g.range_id = r.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 " g.river_id = :river_id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 "ORDER BY r.a"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 public static final String SQL_DISCHARGE_SECTORS = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 " g.id AS gauge_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 " nmv.name AS name," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 " CAST(mv.value AS NUMERIC(38,2)) AS value " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 "FROM gauges g" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 " JOIN main_values mv ON g.id = mv.gauge_id" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 " JOIN named_main_values nmv ON nmv.id = mv.named_value_id" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 " JOIN main_value_types mvt ON nmv.type_id = mvt.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 " mvt.name = 'Q' AND (" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 " nmv.name = 'MNQ' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 " nmv.name LIKE 'MNQ(%' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 " nmv.name = 'MQ' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 " nmv.name LIKE 'MQ(%' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 " nmv.name = 'MHQ' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 " nmv.name LIKE 'MHQ(%' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 " nmv.name = 'HQ5' OR" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 " nmv.name LIKE 'HQ5(%') AND" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 " g.river_id = :river_id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 "ORDER BY" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 " g.id"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 public static final String SQL_FIXINGS = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 " id AS wst_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 " description " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 "FROM wsts " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 " river_id = :river_id AND kind = 2"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 public static final String SQL_FIXING_COLUMNS = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 " wc.id AS wst_column_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 " ti.start_time AS start_time," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 " wc.name AS name " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 "FROM wst_columns wc" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 " JOIN time_intervals ti ON wc.time_interval_id = ti.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 " wc.wst_id = :wst_id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 "ORDER BY position"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 public static final String SQL_FIXING_COLUMN_Q_RANGES = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 " wqr.q AS q," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 " r.a AS start_km," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 " r.b AS stop_km " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 "FROM wst_column_q_ranges wcqr" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 " JOIN wst_q_ranges wqr ON wcqr.wst_q_range_id = wqr.id" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 " JOIN ranges r ON wqr.range_id = r.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 " wcqr.wst_column_id = :column_id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 "ORDER BY r.a"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 public static final String SQL_FIXING_COLUMN_KM_RANGE = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 " MIN(position) AS start_km," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 " MAX(position) AS stop_km " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 "FROM" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 " wst_column_values " + |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
122 "WHERE" + |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 " wst_column_id = :column_id"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 public static class Range implements Serializable { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 protected double start; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 protected double end; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 public Range() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 public Range(double start, double end) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 this.start = start; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 this.end = end; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
136 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
138 public double getStart() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
139 return start; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
140 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
141 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
142 public double getEnd() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
143 return end; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
144 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
145 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 public boolean disjoint(Range other) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 return start > other.end || other.start > end; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
149 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
150 public boolean intersects(Range other) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
151 return !disjoint(other); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
152 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
153 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
154 public boolean clip(Range other) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
155 if (disjoint(other)) return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
156 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
157 if (other.start > start) start = other.start; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
158 if (other.end < end ) end = other.end; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
159 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
160 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
161 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
162 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
163 public boolean inside(double x) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
164 return x > start-EPSILON && x < end+EPSILON; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
165 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 } // class Range |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
167 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
168 public static class GaugeRange extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
169 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
170 private static final class Sector implements Serializable { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
171 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
172 int sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
173 double value; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
174 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
175 Sector(int sector, double value) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
176 this.sector = sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
177 this.value = value; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
178 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
179 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
180 } // class Sector |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
181 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
182 protected int gaugeId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
183 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
184 protected Map<String, Double> mainValues; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
185 protected List<Sector> sectors; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
186 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
187 public GaugeRange() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
188 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
189 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
190 public GaugeRange(double start, double end, int gaugeId) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
191 super(start, end); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
192 this.gaugeId = gaugeId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
193 mainValues = new HashMap<String, Double>(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
194 sectors = new ArrayList<Sector>(3); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
195 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
196 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
197 public void addMainValue(String label, Double value) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
198 int idx = label.indexOf('('); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
199 if (idx >= 0) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
200 label = label.substring(0, idx); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
201 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
202 mainValues.put(label, value); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
203 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
204 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
205 protected Double getMainValue(String label) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
206 Double v = mainValues.get(label); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
207 if (v == null) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
208 log.warn("Missing main value '" |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
209 + label + "' for gauge " + gaugeId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
210 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
211 return v; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
212 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
213 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
214 public void buildClasses() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
215 Double mnq = getMainValue("MNQ"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
216 Double mq = getMainValue("MQ"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
217 Double mhq = getMainValue("MHQ"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
218 Double hq5 = getMainValue("HQ5"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
219 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
220 Double [][] pairs = { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
221 { mnq, mq }, |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
222 { mq, mhq }, |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
223 { hq5, hq5 } }; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
224 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
225 for (int c = 0; c < pairs.length; ++c) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
226 Double [] pair = pairs[c]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
227 if (pair[0] != null && pair[1] != null) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
228 double value = 0.5*(pair[0] + pair[1]); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
229 sectors.add(new Sector(c, value)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
230 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
231 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
232 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
233 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
234 public int classify(double value) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
235 for (Sector sector: sectors) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
236 if (value < sector.value) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
237 return sector.sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
238 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
239 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
240 return sectors.size(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
241 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
242 } // class GaugeRange |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
243 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
244 public static class GaugeFinder { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
245 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
246 protected List<GaugeRange> gauges; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
247 protected boolean isKmUp; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
248 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
249 public GaugeFinder(List<GaugeRange> gauges) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
250 this(gauges, true); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
251 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
252 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
253 public GaugeFinder( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
254 List<GaugeRange> gauges, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
255 boolean isKmUp |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
256 ) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
257 this.gauges = gauges; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
258 this.isKmUp = isKmUp; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
259 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
260 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
261 public boolean getIsKmUp() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
262 return isKmUp; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
263 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
264 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
265 public void setIsKmUp(boolean isKmUp) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
266 this.isKmUp = isKmUp; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
267 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
268 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
269 public GaugeRange find(Range range) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
270 double km = isKmUp ? range.start : range.end; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
271 for (GaugeRange gauge: gauges) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
272 if (gauge.inside(km)) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
273 return gauge; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
274 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
275 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
276 return null; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
277 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
278 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
279 public GaugeRange find(int gaugeId) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
280 for (GaugeRange gauge: gauges) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
281 if (gauge.gaugeId == gaugeId) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
282 return gauge; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
283 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
284 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
285 return null; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
286 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
287 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
288 public boolean loadDischargeSectors(Session session, int riverId) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
289 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
290 SQLQuery query = session.createSQLQuery(SQL_DISCHARGE_SECTORS) |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
291 .addScalar("gauge_id", StandardBasicTypes.INTEGER) |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
292 .addScalar("name", StandardBasicTypes.STRING) |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
293 .addScalar("value", StandardBasicTypes.DOUBLE); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
294 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
295 query.setInteger("river_id", riverId); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
296 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
297 List<Object []> list = query.list(); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
298 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
299 if (list.isEmpty()) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
300 log.warn("River " + riverId + " has no discharge sectors."); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
301 return false; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
302 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
303 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
304 GaugeRange gauge = null; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
305 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
306 for (Object [] row: list) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
307 int gaugeId = (Integer)row[0]; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
308 String label = (String) row[1]; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
309 Double value = (Double) row[2]; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
310 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
311 if (gauge == null || gauge.gaugeId != gaugeId) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
312 if ((gauge = find(gaugeId)) == null) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
313 log.warn("Cannot find gauge for id " + gaugeId + "."); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
314 continue; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
315 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
316 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
317 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
318 gauge.addMainValue(label, value); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
319 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
320 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
321 for (GaugeRange g: gauges) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
322 g.buildClasses(); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
323 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
324 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
325 return true; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
326 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
327 } // class GaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
328 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
329 public static class QRange extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
330 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
331 protected double q; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
332 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
333 public QRange() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
334 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
335 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
336 public QRange(double start, double end, double q) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
337 super(start, end); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
338 this.q = q; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
339 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
340 } // class QRange |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
341 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
342 public static class SectorRange extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
343 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
344 protected int sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
345 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
346 public SectorRange() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
347 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
348 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
349 public SectorRange(SectorRange other) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
350 start = other.start; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
351 end = other.end; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
352 sector = other.sector; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
353 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
354 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
355 public SectorRange(double start, double end, int sector) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
356 super(start, end); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
357 this.sector = sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
358 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
359 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
360 public int getSector() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
361 return sector; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
362 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
363 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
364 public boolean enlarge(SectorRange other) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
365 if (sector == other.sector |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
366 && Math.abs(end-other.start) < EPSILON2) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
367 end = other.end; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
368 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
369 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
370 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
371 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
372 } // class SectorRange |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
373 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
374 public static class Fixing implements Serializable { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
375 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
376 public static final Comparator<Column> DATE_CMP = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
377 new Comparator<Column>() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
378 @Override |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
379 public int compare(Column a, Column b) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
380 return a.startTime.compareTo(b.startTime); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
381 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
382 }; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
383 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
384 public class Column extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
385 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
386 protected int columnId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
387 protected Date startTime; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
388 protected String name; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
389 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
390 protected List<SectorRange> sectors; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
391 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
392 public Column() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
393 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
394 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
395 public Column(int columnId, Date startTime, String name) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
396 this.columnId = columnId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
397 this.startTime = startTime; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
398 this.name = name; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
399 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
400 sectors = new ArrayList<SectorRange>(); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
401 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
402 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
403 public Fixing getFixing() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
404 return Fixing.this; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
405 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
406 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
407 public List<SectorRange> getSectors() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
408 return sectors; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
409 } |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
410 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
411 public void buildSectors(GaugeRange gauge, List<QRange> qRanges) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
412 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
413 for (QRange qRange: qRanges) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
414 SectorRange sector = new SectorRange( |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
415 qRange.start, qRange.end, |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
416 gauge.classify(qRange.q)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
417 if (sectors.isEmpty() |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
418 || !sectors.get(sectors.size()-1).enlarge(sector)) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
419 sectors.add(sector); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
420 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
421 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
422 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
423 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
424 public void loadKmRange(SQLQuery query) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
425 query.setInteger("column_id", columnId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
426 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
427 List<Object []> kms = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
428 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
429 if (kms.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
430 log.warn("No km range for column " + columnId + "."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
431 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
432 else { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
433 Object [] obj = kms.get(0); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
434 start = (Double)obj[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
435 end = (Double)obj[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
436 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
437 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
438 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
439 public void loadQRanges( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
440 SQLQuery query, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
441 GaugeFinder gaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
442 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
443 query.setInteger("column_id", columnId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
444 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
445 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
446 List<QRange> qRanges = new ArrayList<QRange>(list.size()); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
447 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
448 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
449 double q = (Double)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
450 double start = (Double)row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
451 double end = (Double)row[2]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
452 QRange qRange = new QRange(start, end, q); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
453 if (qRange.clip(this)) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
454 qRanges.add(qRange); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
455 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
456 } |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
457 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
458 GaugeRange gauge = gaugeFinder.find(this); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
459 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
460 if (gauge != null) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
461 buildSectors(gauge, qRanges); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
462 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
463 else { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
464 log.warn("No gauge found for column " + columnId + "."); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
465 } |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
466 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
467 } // class Column |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
468 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
469 protected int wstId; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
470 protected String description; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
471 protected List<Column> columns; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
472 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
473 public Fixing() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
474 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
475 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
476 public Fixing(int wstId, String description) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
477 this.wstId = wstId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
478 this.description = description; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
479 columns = new ArrayList<Column>(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
480 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
481 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
482 public void loadColumns(SQLQuery query) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
483 query.setInteger("wst_id", wstId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
484 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
485 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
486 int columnId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
487 Date startTime = (Date) row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
488 String name = (String) row[2]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
489 columns.add(new Column(columnId, startTime, name)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
490 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
491 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
492 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
493 public void loadColumnsKmRange(SQLQuery query) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
494 for (Column column: columns) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
495 column.loadKmRange(query); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
496 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
497 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
498 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
499 public void loadColumnsQRanges( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
500 SQLQuery query, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
501 GaugeFinder gaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
502 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
503 for (Column column: columns) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
504 column.loadQRanges(query, gaugeFinder); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
505 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
506 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
507 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
508 public void addAllColumns(List<Column> allColumns, Range range) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
509 for (Column column: columns) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
510 if (column.intersects(range)) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
511 allColumns.add(column); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
512 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
513 } |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
514 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
515 } // class Fixing |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
516 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
517 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
518 protected String riverName; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
519 protected int riverId; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
520 protected boolean isKmUp; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
521 protected List<Fixing> fixings; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
522 protected Range extent; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
523 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
524 public FixingsOverview() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
525 fixings = new ArrayList<Fixing>(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
526 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
527 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
528 public FixingsOverview(String riverName) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
529 this(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
530 this.riverName = riverName; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
531 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
532 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
533 protected boolean loadRiver(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
534 SQLQuery query = session.createSQLQuery(SQL_RIVER_ID) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
535 .addScalar("river_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
536 .addScalar("km_up", StandardBasicTypes.BOOLEAN); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
537 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
538 query.setString("name", riverName); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
539 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
540 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
541 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
542 if (list.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
543 log.warn("No river '" + riverName + "' found."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
544 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
545 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
546 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
547 Object [] row = list.get(0); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
548 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
549 riverId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
550 isKmUp = (Boolean)row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
551 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
552 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
553 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
554 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
555 protected boolean loadRiverExtent(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
556 SQLQuery query = session.createSQLQuery(SQL_RIVER_EXTENT) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
557 .addScalar("start_km", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
558 .addScalar("end_km", StandardBasicTypes.DOUBLE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
559 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
560 query.setInteger("river_id", riverId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
561 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
562 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
563 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
564 if (list.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
565 log.warn("River " + riverId + " has no extent."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
566 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
567 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
568 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
569 Object [] row = list.get(0); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
570 extent = new Range((Double)row[0], (Double)row[1]); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
571 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
572 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
573 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
574 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
575 protected GaugeFinder loadGauges(Session session) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
576 SQLQuery query = session.createSQLQuery(SQL_GAUGES) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
577 .addScalar("gauge_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
578 .addScalar("a", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
579 .addScalar("b", StandardBasicTypes.DOUBLE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
580 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
581 query.setInteger("river_id", riverId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
582 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
583 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
584 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
585 if (list.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
586 log.warn("River " + riverId + " has no gauges."); |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
587 return null; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
588 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
589 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
590 List<GaugeRange> gauges = new ArrayList<GaugeRange>(); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
591 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
592 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
593 int gaugeId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
594 double start = (Double) row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
595 double end = (Double) row[2]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
596 GaugeRange gauge = new GaugeRange(start, end, gaugeId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
597 gauges.add(gauge); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
598 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
599 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
600 return new GaugeFinder(gauges, isKmUp); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
601 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
602 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
603 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
604 protected void loadFixings(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
605 SQLQuery query = session.createSQLQuery(SQL_FIXINGS) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
606 .addScalar("wst_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
607 .addScalar("description", StandardBasicTypes.STRING); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
608 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
609 query.setInteger("river_id", riverId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
610 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
611 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
612 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
613 if (list.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
614 log.warn("River " + riverId + " has no fixings."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
615 // Its pretty fine to have no fixings. |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
616 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
617 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
618 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
619 int wstId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
620 String description = (String) row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
621 Fixing fixing = new Fixing(wstId, description); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
622 fixings.add(fixing); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
623 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
624 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
625 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
626 protected void loadFixingsColumns(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
627 SQLQuery query = session.createSQLQuery(SQL_FIXING_COLUMNS) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
628 .addScalar("wst_column_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
629 .addScalar("start_time", StandardBasicTypes.DATE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
630 .addScalar("name", StandardBasicTypes.STRING); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
631 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
632 for (Fixing fixing: fixings) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
633 fixing.loadColumns(query); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
634 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
635 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
636 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
637 protected void loadFixingsColumnsKmRange(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
638 SQLQuery query = session.createSQLQuery(SQL_FIXING_COLUMN_KM_RANGE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
639 .addScalar("start_km", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
640 .addScalar("stop_km", StandardBasicTypes.DOUBLE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
641 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
642 for (Fixing fixing: fixings) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
643 fixing.loadColumnsKmRange(query); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
644 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
645 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
646 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
647 protected void loadFixingsColumnsQRanges( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
648 Session session, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
649 GaugeFinder gaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
650 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
651 SQLQuery query = session.createSQLQuery(SQL_FIXING_COLUMN_Q_RANGES) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
652 .addScalar("q", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
653 .addScalar("start_km", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
654 .addScalar("stop_km", StandardBasicTypes.DOUBLE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
655 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
656 for (Fixing fixing: fixings) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
657 fixing.loadColumnsQRanges(query, gaugeFinder); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
658 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
659 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
660 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
661 public boolean load(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
662 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
663 if (!loadRiver(session) |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
664 || !loadRiverExtent(session)) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
665 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
666 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
667 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
668 GaugeFinder gaugeFinder = loadGauges(session); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
669 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
670 if (gaugeFinder == null |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
671 || !gaugeFinder.loadDischargeSectors(session, riverId)) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
672 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
673 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
674 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
675 loadFixings(session); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
676 loadFixingsColumns(session); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
677 loadFixingsColumnsKmRange(session); |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
678 loadFixingsColumnsQRanges(session, gaugeFinder); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
679 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
680 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
681 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
682 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
683 private static final Range FULL_EXTENT = |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
684 new Range(-Double.MAX_VALUE, Double.MAX_VALUE); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
685 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
686 public void generateOverview(Document document) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
687 generateOverview(document, FULL_EXTENT); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
688 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
689 |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
690 public void generateOverview(Document document, Range range) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
691 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
692 List<Fixing.Column> allColumns = new ArrayList<Fixing.Column>(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
693 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
694 for (Fixing fixing: fixings) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
695 fixing.addAllColumns(allColumns, range); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
696 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
697 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
698 Collections.sort(allColumns, Fixing.DATE_CMP); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
699 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
700 Element fixingsElement = document.createElement("fixings"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
701 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
702 Element riverElement = document.createElement("river"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
703 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
704 riverElement.setAttribute("from", String.valueOf(extent.start)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
705 riverElement.setAttribute("to", String.valueOf(extent.end)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
706 riverElement.setAttribute("rid", String.valueOf(riverId)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
707 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
708 fixingsElement.appendChild(riverElement); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
709 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
710 SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy HH:mm"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
711 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
712 Element esE = document.createElement("events"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
713 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
714 for (Fixing.Column column: allColumns) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
715 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
716 // TODO: Apply additional filters here. |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
717 List<SectorRange> sectors = column.getSectors(); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
718 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
719 if (!sectors.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
720 Element eE = document.createElement("event"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
721 eE.setAttribute("name", |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
722 String.valueOf(column.getFixing().description)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
723 eE.setAttribute("cid", String.valueOf(column.columnId)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
724 eE.setAttribute("date", df.format(column.startTime)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
725 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
726 for (SectorRange sector: sectors) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
727 Element sE = document.createElement("sector"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
728 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
729 sE.setAttribute("from", String.valueOf(sector.start)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
730 sE.setAttribute("to", String.valueOf(sector.end)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
731 sE.setAttribute("class", String.valueOf(sector.sector)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
732 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
733 eE.appendChild(sE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
734 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
735 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
736 esE.appendChild(eE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
737 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
738 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
739 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
740 fixingsElement.appendChild(esE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
741 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
742 document.appendChild(fixingsElement); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
743 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
744 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
745 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |