Mercurial > dive4elements > river
comparison flys-artifacts/doc/conf/meta-data.xml @ 5135:cad911029c9d
Merged with 'dc-km-filter-rr' branch.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 28 Feb 2013 12:47:24 +0100 |
parents | a020100ee6a1 86e79fbb8fa3 |
children | 801175535406 |
comparison
equal
deleted
inserted
replaced
5133:8e52b4829cd1 | 5135:cad911029c9d |
---|---|
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
2 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage"> | 2 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage"> |
3 <datacage> | 3 <datacage> |
4 <dc:macro name="SQL-wst_columns_statement"> | 4 <dc:comment> |
5 Statement to load data from wsts. | |
6 </dc:comment> | |
7 <dc:macro name="SQL-wst_columns_statement"> | |
5 <dc:statement> | 8 <dc:statement> |
6 SELECT wst_columns.id AS prot_column_id, | 9 SELECT wst_columns.id AS prot_column_id, |
7 wst_columns.name AS prot_column_name, | 10 wst_columns.name AS prot_column_name, |
8 wst_columns.position AS prot_rel_pos, | 11 wst_columns.position AS prot_rel_pos, |
9 wst_columns.description AS info, | 12 wst_columns.description AS info, |
10 wst_ranges.a AS deffrom, | 13 wst_ranges.a AS deffrom, |
11 wst_ranges.b AS defto | 14 wst_ranges.b AS defto |
12 FROM wst_columns, wst_ranges | 15 FROM wst_columns, wst_ranges |
13 WHERE wst_columns.wst_id = ${prot_id} AND wst_ranges.wst_column_id = wst_columns.id | 16 WHERE wst_columns.wst_id = ${prot_id} |
17 AND wst_ranges.wst_column_id = wst_columns.id | |
18 AND (${fromkm} BETWEEN wst_ranges.a AND wst_ranges.b | |
19 OR ${tokm} BETWEEN wst_ranges.a AND wst_ranges.b | |
20 OR wst_ranges.a BETWEEN ${fromkm} AND ${tokm} | |
21 OR wst_ranges.b BETWEEN ${fromkm} AND ${tokm}) | |
14 ORDER by wst_columns.position | 22 ORDER by wst_columns.position |
15 </dc:statement> | 23 </dc:statement> |
16 </dc:macro> | 24 </dc:macro> |
25 | |
26 <dc:comment> | |
27 Load user specific distance information from artifact. | |
28 </dc:comment> | |
29 <dc:macro name="user-range"> | |
30 <dc:choose> | |
31 <dc:when test="dc:contains($parameters, 'user-id')"> | |
32 <dc:context connection="user"> | |
33 <dc:statement> | |
34 SELECT COALESCE(ld_mode, '') AS ldm, | |
35 COALESCE(ld_locations, '') AS ldl, | |
36 COALESCE(ld_from, '') AS ldf, | |
37 COALESCE(ld_to, '') AS ldt | |
38 FROM master_artifacts_range | |
39 WHERE gid = CAST(${artifact-id} as uuid) | |
40 </dc:statement> | |
41 <dc:elements> | |
42 <dc:variable name="fromkm" type="number" expr="dc:fromValue($ldm, $ldl, $ldf)"/> | |
43 <dc:variable name="tokm" type="number" expr="dc:toValue($ldm, $ldl, $ldt)"/> | |
44 <dc:macro-body/> | |
45 </dc:elements> | |
46 </dc:context> | |
47 </dc:when> | |
48 <dc:otherwise> | |
49 <dc:variable name="fromkm" type="number" expr="dc:fromValue('', '', '')"/> | |
50 <dc:variable name="tokm" type="number" expr="dc:toValue('', '', '')"/> | |
51 <dc:macro-body/> | |
52 </dc:otherwise> | |
53 </dc:choose> | |
54 </dc:macro> | |
55 | |
56 <dc:comment> | |
57 System part. Load data for the given river. | |
58 </dc:comment> | |
17 <dc:macro name="load-system"> | 59 <dc:macro name="load-system"> |
18 <dc:context connection="system"> | 60 <dc:context connection="system"> |
19 <dc:statement> | 61 <dc:statement> |
20 SELECT id AS river_id, name as river_name FROM rivers | 62 SELECT id AS river_id, name as river_name FROM rivers |
21 WHERE lower(name) LIKE lower(${river}) | 63 WHERE lower(name) LIKE lower(${river}) |
22 </dc:statement> | 64 </dc:statement> |
23 <dc:elements> | 65 <dc:elements> |
66 | |
24 <dc:comment> | 67 <dc:comment> |
25 Base-data macros (mostly data imported from wst-files) | 68 Base-data macros (mostly data imported from wst-files). |
26 </dc:comment> | 69 </dc:comment> |
27 <dc:macro name="basedata_0"> | 70 <dc:macro name="basedata_0"> |
71 <dc:call-macro name="user-range"> | |
28 <dc:comment comment=" BASEDATA ---------------------------"/> | 72 <dc:comment comment=" BASEDATA ---------------------------"/> |
29 <basedata> | 73 <basedata> |
30 <dc:context> | 74 <dc:context connection="system"> |
31 <dc:statement> | 75 <dc:statement> |
32 SELECT id AS prot_id, | 76 SELECT id AS prot_id, |
33 description AS prot_description | 77 description AS prot_description |
34 FROM wsts WHERE kind = 0 AND river_id = ${river_id} | 78 FROM wsts WHERE kind = 0 AND river_id = ${river_id} |
35 </dc:statement> | 79 </dc:statement> |
49 </dc:context> | 93 </dc:context> |
50 </basedata> | 94 </basedata> |
51 </dc:elements> | 95 </dc:elements> |
52 </dc:context> | 96 </dc:context> |
53 </basedata> | 97 </basedata> |
54 </dc:macro> | 98 </dc:call-macro> |
99 </dc:macro> | |
100 | |
55 <dc:macro name="basedata_0_wq"> | 101 <dc:macro name="basedata_0_wq"> |
102 <dc:call-macro name="user-range"> | |
56 <dc:comment comment=" BASEDATA ---------------------------"/> | 103 <dc:comment comment=" BASEDATA ---------------------------"/> |
57 <basedata> | 104 <basedata> |
58 <dc:context> | 105 <dc:context connection="system"> |
59 <dc:statement> | 106 <dc:statement> |
60 SELECT id AS prot_id, | 107 SELECT id AS prot_id, |
61 description AS prot_description | 108 description AS prot_description |
62 FROM wsts WHERE kind = 0 AND river_id = ${river_id} | 109 FROM wsts WHERE kind = 0 AND river_id = ${river_id} |
63 </dc:statement> | 110 </dc:statement> |
77 </dc:context> | 124 </dc:context> |
78 </basedata> | 125 </basedata> |
79 </dc:elements> | 126 </dc:elements> |
80 </dc:context> | 127 </dc:context> |
81 </basedata> | 128 </basedata> |
129 </dc:call-macro> | |
82 </dc:macro> | 130 </dc:macro> |
83 | 131 |
84 <dc:macro name="basedata_1_additionals_marks"> | 132 <dc:macro name="basedata_1_additionals_marks"> |
133 <dc:call-macro name="user-range"> | |
85 <dc:comment comment=".ZUS -------------------------------"/> | 134 <dc:comment comment=".ZUS -------------------------------"/> |
86 <additionals> | 135 <additionals> |
87 <dc:context> | 136 <dc:context connection="system"> |
88 <dc:statement> | 137 <dc:statement> |
89 SELECT id AS prot_id, | 138 SELECT id AS prot_id, |
90 description AS prot_description | 139 description AS prot_description |
91 FROM wsts WHERE kind = 1 AND river_id = ${river_id} | 140 FROM wsts WHERE kind = 1 AND river_id = ${river_id} |
92 </dc:statement> | 141 </dc:statement> |
106 </dc:context> | 155 </dc:context> |
107 </additional> | 156 </additional> |
108 </dc:elements> | 157 </dc:elements> |
109 </dc:context> | 158 </dc:context> |
110 </additionals> | 159 </additionals> |
160 </dc:call-macro> | |
111 </dc:macro> | 161 </dc:macro> |
112 | 162 |
113 <dc:macro name="basedata_1_additionals"> | 163 <dc:macro name="basedata_1_additionals"> |
164 <dc:call-macro name="user-range"> | |
114 <dc:comment comment=".ZUS -------------------------------"/> | 165 <dc:comment comment=".ZUS -------------------------------"/> |
115 <additionals> | 166 <additionals> |
116 <dc:context> | 167 <dc:context connection="system"> |
117 <dc:statement> | 168 <dc:statement> |
118 SELECT id AS prot_id, | 169 SELECT id AS prot_id, |
119 description AS prot_description | 170 description AS prot_description |
120 FROM wsts WHERE kind = 1 AND river_id = ${river_id} | 171 FROM wsts WHERE kind = 1 AND river_id = ${river_id} |
121 </dc:statement> | 172 </dc:statement> |
135 </dc:context> | 186 </dc:context> |
136 </additional> | 187 </additional> |
137 </dc:elements> | 188 </dc:elements> |
138 </dc:context> | 189 </dc:context> |
139 </additionals> | 190 </additionals> |
191 </dc:call-macro> | |
140 </dc:macro> | 192 </dc:macro> |
141 | 193 |
142 <dc:macro name="basedata_1_additionals-relative_point"> | 194 <dc:macro name="basedata_1_additionals-relative_point"> |
195 <dc:call-macro name="user-range"> | |
143 <dc:comment comment=".ZUS -------------------------------"/> | 196 <dc:comment comment=".ZUS -------------------------------"/> |
144 <additionals> | 197 <additionals> |
145 <dc:context> | 198 <dc:context connection="system"> |
146 <dc:statement> | 199 <dc:statement> |
147 SELECT id AS prot_id, | 200 SELECT id AS prot_id, |
148 description AS prot_description | 201 description AS prot_description |
149 FROM wsts WHERE kind = 1 AND river_id = ${river_id} | 202 FROM wsts WHERE kind = 1 AND river_id = ${river_id} |
150 </dc:statement> | 203 </dc:statement> |
164 </dc:context> | 217 </dc:context> |
165 </relativepoint> | 218 </relativepoint> |
166 </dc:elements> | 219 </dc:elements> |
167 </dc:context> | 220 </dc:context> |
168 </additionals> | 221 </additionals> |
222 </dc:call-macro> | |
169 </dc:macro> | 223 </dc:macro> |
170 | 224 |
171 <dc:macro name="basedata_2_fixations_wst"> | 225 <dc:macro name="basedata_2_fixations_wst"> |
172 <fixations> | 226 <dc:call-macro name="user-range"> |
173 <dc:context> | 227 <fixations> |
174 <dc:statement> | 228 <dc:context connection="system"> |
175 SELECT id AS prot_id, | 229 <dc:statement> |
176 description AS prot_description | 230 SELECT id AS prot_id, |
177 FROM wsts WHERE kind = 2 AND river_id = ${river_id} | 231 description AS prot_description |
178 </dc:statement> | 232 FROM wsts WHERE kind = 2 AND river_id = ${river_id} |
179 <dc:elements> | 233 </dc:statement> |
180 <fixation> | 234 <dc:elements> |
181 <dc:attribute name="name" value="${prot_description}"/> | 235 <fixation> |
182 <!--dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/--> | 236 <dc:attribute name="name" value="${prot_description}"/> |
183 <dc:context> | 237 <!--dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/--> |
184 <dc:call-macro name="SQL-wst_columns_statement"/> | 238 <dc:context> |
185 <dc:elements> | 239 <dc:call-macro name="SQL-wst_columns_statement"/> |
186 <column> | 240 <dc:elements> |
187 <dc:attribute name="name" value="${prot_column_name}"/> | 241 <column> |
188 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> | 242 <dc:attribute name="name" value="${prot_column_name}"/> |
189 <dc:attribute name="factory" value="wqinterpol"/> | 243 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> |
190 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 244 <dc:attribute name="factory" value="wqinterpol"/> |
191 </column> | 245 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
192 </dc:elements> | 246 </column> |
193 </dc:context> | 247 </dc:elements> |
194 </fixation> | 248 </dc:context> |
195 </dc:elements> | 249 </fixation> |
196 </dc:context> | 250 </dc:elements> |
197 </fixations> | 251 </dc:context> |
252 </fixations> | |
253 </dc:call-macro> | |
198 </dc:macro> | 254 </dc:macro> |
199 | 255 |
200 <dc:macro name="basedata_2_fixations_wqkms"> | 256 <dc:macro name="basedata_2_fixations_wqkms"> |
201 <fixations> | 257 <dc:call-macro name="user-range"> |
202 <dc:context> | 258 <fixations> |
203 <dc:statement> | 259 <dc:context connection="system"> |
204 SELECT id AS prot_id, | 260 <dc:statement> |
205 description AS prot_description | 261 SELECT id AS prot_id, |
206 FROM wsts WHERE kind = 2 AND river_id = ${river_id} | 262 description AS prot_description |
207 </dc:statement> | 263 FROM wsts WHERE kind = 2 AND river_id = ${river_id} |
208 <dc:elements> | 264 </dc:statement> |
209 <fixation> | 265 <dc:elements> |
210 <dc:attribute name="name" value="${prot_description}"/> | 266 <fixation> |
211 <dc:context> | 267 <dc:attribute name="name" value="${prot_description}"/> |
212 <dc:call-macro name="SQL-wst_columns_statement"/> | 268 <dc:context> |
213 <dc:elements> | 269 <dc:call-macro name="SQL-wst_columns_statement"/> |
214 <column> | 270 <dc:elements> |
215 <dc:attribute name="name" value="${prot_column_name}"/> | 271 <column> |
216 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> | 272 <dc:attribute name="name" value="${prot_column_name}"/> |
217 <dc:attribute name="factory" value="wqinterpol"/> | 273 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> |
218 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 274 <dc:attribute name="factory" value="wqinterpol"/> |
219 </column> | 275 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
220 </dc:elements> | 276 </column> |
221 </dc:context> | 277 </dc:elements> |
222 </fixation> | 278 </dc:context> |
223 </dc:elements> | 279 </fixation> |
224 </dc:context> | 280 </dc:elements> |
225 </fixations> | 281 </dc:context> |
282 </fixations> | |
283 </dc:call-macro> | |
226 </dc:macro> | 284 </dc:macro> |
227 | 285 |
228 <dc:macro name="basedata_2_fixations"> | 286 <dc:macro name="basedata_2_fixations"> |
229 <fixations> | 287 <dc:call-macro name="user-range"> |
230 <dc:context> | 288 <fixations> |
231 <dc:statement> | 289 <dc:context connection="system"> |
232 SELECT id AS prot_id, | 290 <dc:statement> |
233 description AS prot_description | 291 SELECT id AS prot_id, |
234 FROM wsts WHERE kind = 2 AND river_id = ${river_id} | 292 description AS prot_description |
235 </dc:statement> | 293 FROM wsts WHERE kind = 2 AND river_id = ${river_id} |
236 <dc:elements> | 294 </dc:statement> |
237 <fixation> | 295 <dc:elements> |
238 <dc:attribute name="name" value="${prot_description}"/> | 296 <fixation> |
239 <dc:context> | 297 <dc:attribute name="name" value="${prot_description}"/> |
240 <dc:call-macro name="SQL-wst_columns_statement"/> | 298 <dc:context> |
241 <dc:elements> | 299 <dc:call-macro name="SQL-wst_columns_statement"/> |
242 <column> | 300 <dc:elements> |
243 <dc:attribute name="name" value="${prot_column_name}"/> | 301 <column> |
244 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> | 302 <dc:attribute name="name" value="${prot_column_name}"/> |
245 <dc:attribute name="factory" value="staticwkms"/> | 303 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> |
246 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 304 <dc:attribute name="factory" value="staticwkms"/> |
247 </column> | 305 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
248 </dc:elements> | 306 </column> |
249 </dc:context> | 307 </dc:elements> |
250 </fixation> | 308 </dc:context> |
251 </dc:elements> | 309 </fixation> |
252 </dc:context> | 310 </dc:elements> |
253 </fixations> | 311 </dc:context> |
312 </fixations> | |
313 </dc:call-macro> | |
254 </dc:macro> | 314 </dc:macro> |
255 | 315 |
256 <dc:macro name="basedata_2_fixations_relative_point"> | 316 <dc:macro name="basedata_2_fixations_relative_point"> |
257 <fixations> | 317 <dc:call-macro name="user-range"> |
258 <dc:context> | 318 <fixations> |
259 <dc:statement> | 319 <dc:context connection="system"> |
260 SELECT id AS prot_id, | 320 <dc:statement> |
261 description AS prot_description | 321 SELECT id AS prot_id, |
262 FROM wsts WHERE kind = 2 AND river_id = ${river_id} | 322 description AS prot_description |
263 </dc:statement> | 323 FROM wsts WHERE kind = 2 AND river_id = ${river_id} |
264 <dc:elements> | 324 </dc:statement> |
265 <relativepoint> | 325 <dc:elements> |
266 <dc:attribute name="name" value="${prot_description}"/> | 326 <relativepoint> |
267 <dc:context> | 327 <dc:attribute name="name" value="${prot_description}"/> |
268 <dc:call-macro name="SQL-wst_columns_statement"/> | 328 <dc:context> |
269 <dc:elements> | 329 <dc:call-macro name="SQL-wst_columns_statement"/> |
270 <column> | 330 <dc:elements> |
271 <dc:attribute name="name" value="${prot_column_name}"/> | 331 <column> |
272 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> | 332 <dc:attribute name="name" value="${prot_column_name}"/> |
273 <dc:attribute name="factory" value="staticwkms"/> | 333 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> |
274 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 334 <dc:attribute name="factory" value="staticwkms"/> |
275 </column> | 335 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
276 </dc:elements> | 336 </column> |
277 </dc:context> | 337 </dc:elements> |
278 </relativepoint> | 338 </dc:context> |
279 </dc:elements> | 339 </relativepoint> |
280 </dc:context> | 340 </dc:elements> |
281 </fixations> | 341 </dc:context> |
342 </fixations> | |
343 </dc:call-macro> | |
282 </dc:macro> | 344 </dc:macro> |
283 | 345 |
284 <dc:macro name="basedata_3_officials"> | 346 <dc:macro name="basedata_3_officials"> |
347 <dc:call-macro name="user-range"> | |
285 <dc:comment comment=".wst -------------------------------"/> | 348 <dc:comment comment=".wst -------------------------------"/> |
286 <officiallines> | 349 <officiallines> |
287 <dc:context> | 350 <dc:context connection="system"> |
288 <dc:statement> | 351 <dc:statement> |
289 SELECT id AS prot_id, | 352 SELECT id AS prot_id, |
290 description AS prot_description | 353 description AS prot_description |
291 FROM wsts WHERE kind = 3 AND river_id = ${river_id} | 354 FROM wsts WHERE kind = 3 AND river_id = ${river_id} |
292 </dc:statement> | 355 </dc:statement> |
306 </dc:context> | 369 </dc:context> |
307 </official> | 370 </official> |
308 </dc:elements> | 371 </dc:elements> |
309 </dc:context> | 372 </dc:context> |
310 </officiallines> | 373 </officiallines> |
374 </dc:call-macro> | |
311 </dc:macro> | 375 </dc:macro> |
312 | 376 |
313 <dc:macro name="basedata_4_heightmarks-points-relative_points"> | 377 <dc:macro name="basedata_4_heightmarks-points-relative_points"> |
314 <heightmarks> | 378 <dc:call-macro name="user-range"> |
315 <dc:context> | 379 <heightmarks> |
316 <dc:statement> | 380 <dc:context connection="system"> |
317 SELECT id AS prot_id, | 381 <dc:statement> |
318 description AS prot_description | 382 SELECT id AS prot_id, |
319 FROM wsts WHERE kind = 4 AND river_id = ${river_id} | 383 description AS prot_description |
320 </dc:statement> | 384 FROM wsts WHERE kind = 4 AND river_id = ${river_id} |
321 <dc:elements> | 385 </dc:statement> |
322 <relativepoint> | 386 <dc:elements> |
323 <dc:attribute name="name" value="${prot_description}"/> | 387 <relativepoint> |
324 <dc:context> | 388 <dc:attribute name="name" value="${prot_description}"/> |
325 <dc:call-macro name="SQL-wst_columns_statement"/> | 389 <dc:context> |
326 <dc:elements> | 390 <dc:call-macro name="SQL-wst_columns_statement"/> |
327 <column> | 391 <dc:elements> |
328 <dc:attribute name="name" value="${prot_column_name}"/> | 392 <column> |
329 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/> | 393 <dc:attribute name="name" value="${prot_column_name}"/> |
330 <dc:attribute name="factory" value="staticwkms"/> | 394 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/> |
331 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 395 <dc:attribute name="factory" value="staticwkms"/> |
332 </column> | 396 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
333 </dc:elements> | 397 </column> |
334 </dc:context> | 398 </dc:elements> |
335 </relativepoint> | 399 </dc:context> |
336 </dc:elements> | 400 </relativepoint> |
337 </dc:context> | 401 </dc:elements> |
338 </heightmarks> | 402 </dc:context> |
403 </heightmarks> | |
404 </dc:call-macro> | |
339 </dc:macro> | 405 </dc:macro> |
340 | 406 |
341 <dc:macro name="basedata_4_heightmarks-points"> | 407 <dc:macro name="basedata_4_heightmarks-points"> |
342 <heightmarks> | 408 <dc:call-macro name="user-range"> |
343 <dc:context> | 409 <heightmarks> |
344 <dc:statement> | 410 <dc:context connection="system"> |
345 SELECT id AS prot_id, | 411 <dc:statement> |
346 description AS prot_description | 412 SELECT id AS prot_id, |
347 FROM wsts WHERE kind = 4 AND river_id = ${river_id} | 413 description AS prot_description |
348 </dc:statement> | 414 FROM wsts WHERE kind = 4 AND river_id = ${river_id} |
349 <dc:elements> | 415 </dc:statement> |
350 <heightmark> | 416 <dc:elements> |
351 <dc:attribute name="name" value="${prot_description}"/> | 417 <heightmark> |
352 <dc:context> | 418 <dc:attribute name="name" value="${prot_description}"/> |
353 <dc:call-macro name="SQL-wst_columns_statement"/> | 419 <dc:context> |
354 <dc:elements> | 420 <dc:call-macro name="SQL-wst_columns_statement"/> |
355 <column> | 421 <dc:elements> |
356 <dc:attribute name="name" value="${prot_column_name}"/> | 422 <column> |
357 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/> | 423 <dc:attribute name="name" value="${prot_column_name}"/> |
358 <dc:attribute name="factory" value="staticwkms"/> | 424 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/> |
359 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 425 <dc:attribute name="factory" value="staticwkms"/> |
360 </column> | 426 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
361 </dc:elements> | 427 </column> |
362 </dc:context> | 428 </dc:elements> |
363 </heightmark> | 429 </dc:context> |
364 </dc:elements> | 430 </heightmark> |
365 </dc:context> | 431 </dc:elements> |
366 </heightmarks> | 432 </dc:context> |
433 </heightmarks> | |
434 </dc:call-macro> | |
367 </dc:macro> | 435 </dc:macro> |
368 | 436 |
369 <dc:macro name="basedata_4_heightmarks-wq"> | 437 <dc:macro name="basedata_4_heightmarks-wq"> |
370 <heightmarks> | 438 <dc:call-macro name="user-range"> |
371 <dc:context> | 439 <heightmarks> |
372 <dc:statement> | 440 <dc:context connection="system"> |
373 SELECT id AS prot_id, | 441 <dc:statement> |
374 description AS prot_description | 442 SELECT id AS prot_id, |
375 FROM wsts WHERE kind = 4 AND river_id = ${river_id} | 443 description AS prot_description |
376 </dc:statement> | 444 FROM wsts WHERE kind = 4 AND river_id = ${river_id} |
377 <dc:elements> | 445 </dc:statement> |
378 <heightmark> | 446 <dc:elements> |
379 <dc:attribute name="name" value="${prot_description}"/> | 447 <heightmark> |
380 <dc:context> | 448 <dc:attribute name="name" value="${prot_description}"/> |
381 <dc:call-macro name="SQL-wst_columns_statement"/> | 449 <dc:context> |
382 <dc:elements> | 450 <dc:call-macro name="SQL-wst_columns_statement"/> |
383 <column> | 451 <dc:elements> |
384 <dc:attribute name="name" value="${prot_column_name}"/> | 452 <column> |
385 <dc:attribute name="ids" value="heightmarks_annotations-wstv-${prot_rel_pos}-${prot_id}"/> | 453 <dc:attribute name="name" value="${prot_column_name}"/> |
386 <dc:attribute name="factory" value="wqinterpol"/> | 454 <dc:attribute name="ids" value="heightmarks_annotations-wstv-${prot_rel_pos}-${prot_id}"/> |
387 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 455 <dc:attribute name="factory" value="wqinterpol"/> |
388 </column> | 456 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
389 </dc:elements> | 457 </column> |
390 </dc:context> | 458 </dc:elements> |
391 </heightmark> | 459 </dc:context> |
392 </dc:elements> | 460 </heightmark> |
393 </dc:context> | 461 </dc:elements> |
394 </heightmarks> | 462 </dc:context> |
463 </heightmarks> | |
464 </dc:call-macro> | |
395 </dc:macro> | 465 </dc:macro> |
396 | 466 |
397 <dc:macro name="basedata_5_flood-protections_relative_points"> | 467 <dc:macro name="basedata_5_flood-protections_relative_points"> |
398 <flood_protections> | 468 <dc:call-macro name="user-range"> |
399 <dc:attribute name="id" value="flood-protections-${river_id}"/> | 469 <flood_protections> |
400 <dc:context> | 470 <dc:attribute name="id" value="flood-protections-${river_id}"/> |
401 <dc:statement> | 471 <dc:context connection="system"> |
402 SELECT id AS prot_id, | 472 <dc:statement> |
403 description AS prot_description | 473 SELECT id AS prot_id, |
404 FROM wsts WHERE kind = 5 AND river_id = ${river_id} | 474 description AS prot_description |
405 </dc:statement> | 475 FROM wsts WHERE kind = 5 AND river_id = ${river_id} |
406 <dc:elements> | 476 </dc:statement> |
407 <relativepoint> | 477 <dc:elements> |
408 <dc:attribute name="name" value="${prot_description}"/> | 478 <relativepoint> |
409 <dc:attribute name="db-id" value="${prot_id}"/> | 479 <dc:attribute name="name" value="${prot_description}"/> |
410 <dc:attribute name="factory" value="staticwkms"/> | 480 <dc:attribute name="db-id" value="${prot_id}"/> |
411 <columns> | 481 <dc:attribute name="factory" value="staticwkms"/> |
482 <columns> | |
483 <dc:context> | |
484 <dc:call-macro name="SQL-wst_columns_statement"/> | |
485 <dc:elements> | |
486 <column> | |
487 <dc:attribute name="name" value="${prot_column_name}"/> | |
488 <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/> | |
489 <dc:attribute name="factory" value="staticwkms"/> | |
490 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | |
491 </column> | |
492 </dc:elements> | |
493 </dc:context> | |
494 </columns> | |
495 </relativepoint> | |
496 </dc:elements> | |
497 </dc:context> | |
498 </flood_protections> | |
499 </dc:call-macro> | |
500 </dc:macro> | |
501 | |
502 <dc:macro name="basedata_5_flood-protections"> | |
503 <dc:call-macro name="user-range"> | |
504 <flood_protections> | |
505 <dc:attribute name="id" value="flood-protections-${river_id}"/> | |
506 <dc:context connection="system"> | |
507 <dc:statement> | |
508 SELECT id AS prot_id, | |
509 description AS prot_description | |
510 FROM wsts WHERE kind = 5 AND river_id = ${river_id} | |
511 </dc:statement> | |
512 <dc:elements> | |
513 <flood_protection> | |
514 <dc:attribute name="name" value="${prot_description}"/> | |
515 <dc:attribute name="db-id" value="${prot_id}"/> | |
516 <dc:attribute name="factory" value="staticwkms"/> | |
412 <dc:context> | 517 <dc:context> |
413 <dc:call-macro name="SQL-wst_columns_statement"/> | 518 <dc:call-macro name="SQL-wst_columns_statement"/> |
414 <dc:elements> | 519 <dc:elements> |
415 <column> | 520 <column> |
416 <dc:attribute name="name" value="${prot_column_name}"/> | 521 <dc:attribute name="name" value="${prot_column_name}"/> |
418 <dc:attribute name="factory" value="staticwkms"/> | 523 <dc:attribute name="factory" value="staticwkms"/> |
419 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | 524 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> |
420 </column> | 525 </column> |
421 </dc:elements> | 526 </dc:elements> |
422 </dc:context> | 527 </dc:context> |
423 </columns> | 528 </flood_protection> |
424 </relativepoint> | 529 </dc:elements> |
425 </dc:elements> | 530 </dc:context> |
426 </dc:context> | 531 </flood_protections> |
427 </flood_protections> | 532 </dc:call-macro> |
428 </dc:macro> | |
429 | |
430 <dc:macro name="basedata_5_flood-protections"> | |
431 <flood_protections> | |
432 <dc:attribute name="id" value="flood-protections-${river_id}"/> | |
433 <dc:context> | |
434 <dc:statement> | |
435 SELECT id AS prot_id, | |
436 description AS prot_description | |
437 FROM wsts WHERE kind = 5 AND river_id = ${river_id} | |
438 </dc:statement> | |
439 <dc:elements> | |
440 <flood_protection> | |
441 <dc:attribute name="name" value="${prot_description}"/> | |
442 <dc:attribute name="db-id" value="${prot_id}"/> | |
443 <dc:attribute name="factory" value="staticwkms"/> | |
444 <dc:context> | |
445 <dc:call-macro name="SQL-wst_columns_statement"/> | |
446 <dc:elements> | |
447 <column> | |
448 <dc:attribute name="name" value="${prot_column_name}"/> | |
449 <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/> | |
450 <dc:attribute name="factory" value="staticwkms"/> | |
451 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> | |
452 </column> | |
453 </dc:elements> | |
454 </dc:context> | |
455 </flood_protection> | |
456 </dc:elements> | |
457 </dc:context> | |
458 </flood_protections> | |
459 </dc:macro> | 533 </dc:macro> |
460 | 534 |
461 <dc:macro name="mainvalues"> | 535 <dc:macro name="mainvalues"> |
462 <mainvalue> | 536 <mainvalue> |
463 <dc:attribute name="factory" value="mainvalue"/> | 537 <dc:attribute name="factory" value="mainvalue"/> |
510 </dc:context> | 584 </dc:context> |
511 </annotations> | 585 </annotations> |
512 </dc:macro> | 586 </dc:macro> |
513 | 587 |
514 <dc:macro name="cross_sections"> | 588 <dc:macro name="cross_sections"> |
515 <cross_sections> | 589 <dc:call-macro name="user-range"> |
516 <dc:attribute name="id" value="flood-protections-${river_id}"/> | 590 <cross_sections> |
517 <dc:context> | 591 <dc:attribute name="id" value="flood-protections-${river_id}"/> |
518 <dc:statement> | 592 <dc:context connection="system"> |
519 SELECT id AS prot_id, | 593 <dc:statement> |
520 description AS prot_description | 594 SELECT DISTINCT ON (cs.id) |
521 FROM cross_sections WHERE river_id = ${river_id} | 595 cs.id AS prot_id, |
522 </dc:statement> | 596 cs.description AS prot_description |
523 <dc:elements> | 597 FROM cross_sections cs |
524 <cross_section> | 598 JOIN cross_section_lines csl ON csl.cross_section_id = cs.id |
525 <dc:attribute name="name" value="${prot_description}"/> | 599 WHERE cs.river_id = ${river_id} |
526 <dc:attribute name="ids" value="${prot_id}"/> | 600 AND csl.km BETWEEN ${fromkm} AND ${tokm} |
527 <dc:attribute name="factory" value="crosssections"/> | 601 </dc:statement> |
528 </cross_section> | 602 <dc:elements> |
529 </dc:elements> | 603 <cross_section> |
530 </dc:context> | 604 <dc:attribute name="name" value="${prot_description}"/> |
531 </cross_sections> | 605 <dc:attribute name="ids" value="${prot_id}"/> |
606 <dc:attribute name="factory" value="crosssections"/> | |
607 </cross_section> | |
608 </dc:elements> | |
609 </dc:context> | |
610 </cross_sections> | |
611 </dc:call-macro> | |
532 </dc:macro> | 612 </dc:macro> |
533 | 613 |
534 <dc:macro name="hyks"> | 614 <dc:macro name="hyks"> |
535 <hyks> | 615 <dc:call-macro name="user-range"> |
536 <dc:attribute name="id" value="hyk-${river_id}"/> | 616 <hyks> |
537 <dc:context> | 617 <dc:attribute name="id" value="hyk-${river_id}"/> |
538 <dc:statement> | 618 <dc:context connection="system"> |
539 SELECT id AS hyk_id, | 619 <dc:statement> |
540 description AS hyk_description | 620 SELECT DISTINCT ON (h.id) |
541 FROM hyks WHERE river_id = ${river_id} | 621 h.id AS hyk_id, |
542 </dc:statement> | 622 h.description AS hyk_description |
543 <dc:elements> | 623 FROM hyks h |
544 <hyk> | 624 JOIN hyk_entries he ON he.hyk_id = h.id |
545 <dc:attribute name="name" value="${hyk_description}"/> | 625 WHERE river_id = ${river_id} |
546 <dc:attribute name="ids" value="${hyk_id}"/> | 626 AND he.km BETWEEN ${fromkm} AND ${tokm} |
547 <dc:attribute name="factory" value="hyk"/> | 627 </dc:statement> |
548 </hyk> | 628 <dc:elements> |
549 </dc:elements> | 629 <hyk> |
550 </dc:context> | 630 <dc:attribute name="name" value="${hyk_description}"/> |
551 </hyks> | 631 <dc:attribute name="ids" value="${hyk_id}"/> |
632 <dc:attribute name="factory" value="hyk"/> | |
633 </hyk> | |
634 </dc:elements> | |
635 </dc:context> | |
636 </hyks> | |
637 </dc:call-macro> | |
552 </dc:macro> | 638 </dc:macro> |
553 | 639 |
554 <dc:macro name="flow_velocity_measurements"> | 640 <dc:macro name="flow_velocity_measurements"> |
555 <flowvelocitymeasurement> | 641 <dc:call-macro name="user-range"> |
556 <dc:context> | 642 <flowvelocitymeasurement> |
557 <dc:statement> | 643 <dc:context connection="system"> |
558 SELECT id AS fvmid, | 644 <dc:statement> |
559 description AS fvmd | 645 SELECT id AS fvmid, |
560 FROM flow_velocity_measurements WHERE river_id = ${river_id} | 646 description AS fvmd |
561 </dc:statement> | 647 FROM flow_velocity_measurements WHERE river_id = ${river_id} |
562 <dc:elements> | 648 </dc:statement> |
563 <flow_velocity_measurement> | 649 <dc:elements> |
564 <dc:attribute name="name" value="${fvmd}"/> | 650 <flow_velocity_measurement> |
565 <dc:attribute name="ids" value="${fvmid}"/> | 651 <dc:attribute name="name" value="${fvmd}"/> |
566 <dc:attribute name="factory" value="flowvelocity"/> | 652 <dc:attribute name="ids" value="${fvmid}"/> |
567 <dc:context> | 653 <dc:attribute name="factory" value="flowvelocity"/> |
568 <dc:statement> | 654 <dc:context> |
569 SELECT id, description, station, datetime, v, w, q | 655 <dc:statement> |
570 FROM flow_velocity_measure_values | 656 SELECT id, description, station, datetime, v, w, q |
571 WHERE measurements_id = ${fvmid} | 657 FROM flow_velocity_measure_values |
572 </dc:statement> | 658 WHERE measurements_id = ${fvmid} |
573 <dc:elements> | 659 AND station BETWEEN ${fromkm} AND ${tokm} |
574 <measurement_value> | 660 </dc:statement> |
575 <dc:attribute name="name" value="${id}-${description}-${station}-${datetime}"/> | 661 <dc:elements> |
576 <dc:attribute name="ids" value="${id}"/> | 662 <measurement_value> |
577 <dc:attribute name="factory" value="flowvelocity"/> | 663 <dc:attribute name="name" value="${id}-${description}-${station}-${datetime}"/> |
578 </measurement_value> | 664 <dc:attribute name="ids" value="${id}"/> |
579 </dc:elements> | 665 <dc:attribute name="factory" value="flowvelocity"/> |
580 </dc:context> | 666 </measurement_value> |
581 </flow_velocity_measurement> | 667 </dc:elements> |
668 </dc:context> | |
669 </flow_velocity_measurement> | |
582 </dc:elements> | 670 </dc:elements> |
583 </dc:context> | 671 </dc:context> |
584 </flowvelocitymeasurement> | 672 </flowvelocitymeasurement> |
673 </dc:call-macro> | |
674 </dc:macro> | |
675 | |
676 <dc:macro name="sounding-width"> | |
677 <soundings_width> | |
678 <dc:context> | |
679 <dc:statement> | |
680 SELECT id AS bedh_id, | |
681 year AS bedh_year, | |
682 description AS bedh_descr | |
683 FROM bed_height_single WHERE river_id = ${river_id} | |
684 </dc:statement> | |
685 <dc:elements> | |
686 <height> | |
687 <dc:attribute name="factory" value="bedheight"/> | |
688 <dc:attribute name="ids" value="bedheight-singlevalues-${bedh_id}-${bedh_year}"/> | |
689 <dc:attribute name="description" value="${bedh_descr}"/> | |
690 </height> | |
691 </dc:elements> | |
692 </dc:context> | |
693 </soundings_width> | |
585 </dc:macro> | 694 </dc:macro> |
586 | 695 |
587 <dc:macro name="longitudinal-section-prototype"> | 696 <dc:macro name="longitudinal-section-prototype"> |
588 <dc:call-macro name="basedata_0"/> | 697 <dc:call-macro name="basedata_0"/> |
589 <dc:call-macro name="basedata_1_additionals"/> | 698 <dc:call-macro name="basedata_1_additionals"/> |
590 <dc:comment comment=" FIXATIONS ---------------------------"/> | 699 <dc:comment comment=" FIXATIONS ---------------------------"/> |
591 <dc:call-macro name="basedata_2_fixations"/> | 700 <dc:call-macro name="basedata_2_fixations"/> |
592 <dc:comment comment=" HOEHENMARKEN ---------------------------"/> | 701 <dc:comment comment=" HOEHENMARKEN ---------------------------"/> |
593 <dc:call-macro name="basedata_4_heightmarks-points"/> | 702 <dc:call-macro name="basedata_4_heightmarks-points"/> |
594 <dc:comment comment=" AMTL LINIEN ---------------------------"/> | 703 <dc:comment comment=" AMTL LINIEN ---------------------------"/> |
595 <dc:call-macro name="basedata_3_officials"/> | 704 <dc:call-macro name="basedata_3_officials"/> |
596 <dc:call-macro name="basedata_5_flood-protections"/> | 705 <dc:call-macro name="basedata_5_flood-protections"/> |
597 <dc:call-macro name="annotations_per_type"/> | 706 <dc:call-macro name="annotations_per_type"/> |
598 </dc:macro> | 707 </dc:macro> |
599 | 708 |
600 <dc:comment> | 709 <dc:comment> |
601 | |
602 + River-Node | 710 + River-Node |
603 | |
604 </dc:comment> | 711 </dc:comment> |
605 | |
606 <river> | 712 <river> |
607 <dc:attribute name="name" value="${river_name}"/> | 713 <dc:attribute name="name" value="${river_name}"/> |
608 | 714 |
609 <dc:choose> | 715 <dc:choose> |
610 <dc:when test="dc:contains($parameters, 'recommended')"> | 716 <dc:when test="dc:contains($parameters, 'recommended')"> |
710 </dc:if> | 816 </dc:if> |
711 <dc:comment> | 817 <dc:comment> |
712 MINFO bedheight middle | 818 MINFO bedheight middle |
713 </dc:comment> | 819 </dc:comment> |
714 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> | 820 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> |
715 <soundings_width> | 821 <dc:call-macro name="sounding-width"/> |
716 <dc:context> | |
717 <dc:statement> | |
718 SELECT id AS bedh_id, | |
719 year AS bedh_year, | |
720 description AS bedh_descr | |
721 FROM bed_height_single WHERE river_id = ${river_id} | |
722 </dc:statement> | |
723 <dc:elements> | |
724 <height> | |
725 <dc:attribute name="factory" value="bedheight"/> | |
726 <dc:attribute name="ids" value="bedheight-singlevalues-${bedh_id}-${bedh_year}"/> | |
727 <dc:attribute name="description" value="${bedh_descr}"/> | |
728 </height> | |
729 </dc:elements> | |
730 </dc:context> | |
731 </soundings_width> | |
732 </dc:if> | 822 </dc:if> |
733 <dc:comment comment="--- non-recommendations---"/> | 823 <dc:comment comment="--- non-recommendations---"/> |
734 </dc:otherwise> | 824 </dc:otherwise> |
735 </dc:choose> | 825 </dc:choose> |
736 | 826 |
1282 ------------------ | 1372 ------------------ |
1283 </dc:comment> | 1373 </dc:comment> |
1284 <dc:when test="dc:contains($parameters, 'user-id')"> | 1374 <dc:when test="dc:contains($parameters, 'user-id')"> |
1285 | 1375 |
1286 | 1376 |
1287 <old_calculations> | 1377 <old_calculations> |
1288 <dc:context connection="user"> | 1378 <!-- <dc:macro name="load-user">--> |
1289 <dc:comment> | 1379 <dc:call-macro name="user-range"> |
1290 Get the user and collection-id. | 1380 <dc:context connection="user"> |
1291 </dc:comment> | 1381 <dc:comment> |
1292 <dc:statement> | 1382 Get the user and collection-id. |
1383 </dc:comment> | |
1384 <dc:statement> | |
1293 SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name | 1385 SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name |
1294 FROM collections c JOIN users u ON c.user_id = u.id | 1386 FROM collections c JOIN users u ON c.user_id = u.id |
1295 WHERE u.gid = CAST(${user-id} AS uuid) | 1387 WHERE u.gid = CAST(${user-id} AS uuid) |
1296 ORDER BY c.creation DESC | 1388 ORDER BY c.creation DESC |
1297 </dc:statement> | 1389 </dc:statement> |
1298 | 1390 |
1391 | |
1392 <dc:macro name="range-filter"> | |
1393 <dc:statement> | |
1394 SELECT m.id AS a_id, | |
1395 m.state AS a_state, | |
1396 m.gid AS a_gid, | |
1397 m.creation AS a_creation, | |
1398 COALESCE(ld_mode, '') AS ld_m, | |
1399 COALESCE(ld_locations, '') AS ld_l, | |
1400 COALESCE(ld_from, '') AS ld_f, | |
1401 COALESCE(ld_to, '') AS ld_t | |
1402 FROM master_artifacts_range m | |
1403 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1404 AND EXISTS ( | |
1405 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1406 </dc:statement> | |
1407 <dc:elements> | |
1408 <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/> | |
1409 <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/> | |
1410 <dc:if test="($from >= $fromkm and $from <= $tokm) or ($to <= $tokm and $to >= $fromkm) or ($from <= $fromkm and $to >= $tokm)"> | |
1411 <dc:macro-body/> | |
1412 </dc:if> | |
1413 </dc:elements> | |
1414 </dc:macro> | |
1415 | |
1299 <!-- OFFICIAL LINES --> | 1416 <!-- OFFICIAL LINES --> |
1300 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')"> | 1417 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')"> |
1301 <dc:comment comment=".wst -------------------------------"/> | 1418 <dc:comment comment=".wst -------------------------------"/> |
1302 <officiallines> | 1419 <officiallines> |
1303 <dc:elements> | 1420 <dc:elements> |
1304 <dc:context> | 1421 <dc:context> |
1305 <dc:statement> | 1422 <dc:statement> |
1306 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation, ardg.v as gaugy, arv.v as wqsingle | 1423 SELECT m.id AS a_id, |
1307 FROM master_artifacts m, artifact_data ardg, artifact_data arv | 1424 m.state AS a_state, |
1308 WHERE m.collection_id = ${collection_id} AND m.gid = CAST(${artifact-id} AS uuid) AND ardg.artifact_id = m.id AND ardg.k = 'ld_gaugename' AND arv.artifact_id = m.id AND arv.k = 'wq_single' | 1425 m.gid AS a_gid, |
1309 AND EXISTS ( | 1426 m.creation AS a_creation, |
1310 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | 1427 ardg.v AS gaugy, |
1428 arv.v AS wqsingle | |
1429 FROM master_artifacts m, | |
1430 artifact_data ardg, | |
1431 artifact_data arv | |
1432 WHERE m.collection_id = ${collection_id} | |
1433 AND m.gid = CAST(${artifact-id} AS uuid) | |
1434 AND ardg.artifact_id = m.id | |
1435 AND ardg.k = 'ld_gaugename' | |
1436 AND arv.artifact_id = m.id | |
1437 AND arv.k = 'wq_single' | |
1438 AND EXISTS ( | |
1439 SELECT id | |
1440 FROM artifact_data ad | |
1441 WHERE ad.artifact_id = m.id | |
1442 AND k = 'river' | |
1443 AND v = ${river}) | |
1311 </dc:statement> | 1444 </dc:statement> |
1312 <dc:elements> | 1445 <dc:elements> |
1313 <dc:context connection="system"> | 1446 <dc:context connection="system"> |
1314 <dc:statement> | 1447 <dc:statement> |
1315 SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval | 1448 SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval |
1333 | 1466 |
1334 <dc:comment> | 1467 <dc:comment> |
1335 SHOW W-DIFFERENCES | 1468 SHOW W-DIFFERENCES |
1336 </dc:comment> | 1469 </dc:comment> |
1337 | 1470 |
1338 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))"> | 1471 <dc:macro name="differences"> |
1339 <differences> | 1472 <differences> |
1340 <dc:elements> | 1473 <dc:elements> |
1341 <dc:context> | 1474 <dc:context> |
1342 <dc:statement> | 1475 <dc:call-macro name="range-filter"> |
1343 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1344 FROM master_artifacts m | |
1345 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1346 AND EXISTS ( | |
1347 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1348 </dc:statement> | |
1349 <dc:elements> | |
1350 <dc:context> | 1476 <dc:context> |
1351 <dc:statement> | 1477 <dc:statement> |
1352 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1478 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1353 FROM outs as o, facets as f, artifacts as a | 1479 FROM outs as o, facets as f, artifacts as a |
1354 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1480 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1361 <dc:attribute name="ids" value="${aid}"/> | 1487 <dc:attribute name="ids" value="${aid}"/> |
1362 <dc:attribute name="out" value="w_differences"/> | 1488 <dc:attribute name="out" value="w_differences"/> |
1363 </dc:element> | 1489 </dc:element> |
1364 </dc:elements> | 1490 </dc:elements> |
1365 </dc:context> | 1491 </dc:context> |
1366 </dc:elements> | 1492 </dc:call-macro> |
1367 </dc:context> | 1493 </dc:context> |
1368 </dc:elements> | 1494 </dc:elements> |
1369 </differences> | 1495 </differences> |
1370 </dc:if> | 1496 </dc:macro> |
1371 | 1497 |
1372 <dc:comment> | 1498 <dc:comment> |
1373 SHOW REFERENCE CURVE | 1499 SHOW REFERENCE CURVE |
1374 </dc:comment> | 1500 </dc:comment> |
1375 | 1501 |
1376 <dc:if test="dc:contains($artifact-outs, 'reference_curve')"> | 1502 |
1503 <dc:macro name="reference-curves"> | |
1377 <reference_curves> | 1504 <reference_curves> |
1378 <dc:elements> | 1505 <dc:elements> |
1379 <dc:context> | 1506 <dc:context> |
1380 <dc:statement> | 1507 <dc:call-macro name="user-range"> |
1381 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1382 FROM master_artifacts m | |
1383 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1384 AND EXISTS ( | |
1385 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1386 </dc:statement> | |
1387 <dc:elements> | |
1388 <dc:context> | 1508 <dc:context> |
1389 <dc:statement> | 1509 <dc:statement> |
1390 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1510 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1391 FROM outs as o, facets as f, artifacts as a | 1511 FROM outs as o, facets as f, artifacts as a |
1392 WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1512 WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1399 <dc:attribute name="ids" value="${aid}"/> | 1519 <dc:attribute name="ids" value="${aid}"/> |
1400 <dc:attribute name="out" value="reference_curve"/> | 1520 <dc:attribute name="out" value="reference_curve"/> |
1401 </dc:element> | 1521 </dc:element> |
1402 </dc:elements> | 1522 </dc:elements> |
1403 </dc:context> | 1523 </dc:context> |
1404 </dc:elements> | 1524 </dc:call-macro> |
1405 </dc:context> | 1525 </dc:context> |
1406 </dc:elements> | 1526 </dc:elements> |
1407 </reference_curves> | 1527 </reference_curves> |
1408 </dc:if> | 1528 </dc:macro> |
1409 | 1529 |
1410 <dc:comment> | 1530 <dc:comment> |
1411 SHOW COMPUTED DISCHARGE CURVES | 1531 SHOW COMPUTED DISCHARGE CURVES |
1412 </dc:comment> | 1532 </dc:comment> |
1413 | 1533 |
1414 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> | 1534 <dc:macro name="computed-discharge-curve"> |
1415 <computed_discharge_curves> | 1535 <computed_discharge_curves> |
1416 <dc:elements> | 1536 <dc:elements> |
1417 <dc:context> | 1537 <dc:context> |
1418 <dc:statement> | 1538 <dc:call-macro name="range-filter"> |
1419 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1420 FROM master_artifacts m | |
1421 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1422 AND EXISTS ( | |
1423 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1424 </dc:statement> | |
1425 <dc:elements> | |
1426 <dc:context> | 1539 <dc:context> |
1427 <dc:statement> | 1540 <dc:statement> |
1428 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1541 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1429 FROM outs as o, facets as f, artifacts as a | 1542 FROM outs as o, facets as f, artifacts as a |
1430 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1543 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1437 <dc:attribute name="ids" value="${aid}"/> | 1550 <dc:attribute name="ids" value="${aid}"/> |
1438 <dc:attribute name="out" value="computed_discharge_curve"/> | 1551 <dc:attribute name="out" value="computed_discharge_curve"/> |
1439 </dc:element> | 1552 </dc:element> |
1440 </dc:elements> | 1553 </dc:elements> |
1441 </dc:context> | 1554 </dc:context> |
1442 </dc:elements> | 1555 </dc:call-macro> |
1443 </dc:context> | 1556 </dc:context> |
1444 </dc:elements> | 1557 </dc:elements> |
1445 </computed_discharge_curves> | 1558 </computed_discharge_curves> |
1446 </dc:if> | 1559 </dc:macro> |
1447 | 1560 |
1448 <dc:comment> | 1561 <dc:comment> |
1449 CROSS SECTION | 1562 CROSS SECTION |
1450 </dc:comment> | 1563 </dc:comment> |
1451 | 1564 |
1452 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> | 1565 |
1566 <dc:macro name="waterlevels"> | |
1453 <waterlevels> | 1567 <waterlevels> |
1454 <dc:elements> | 1568 <dc:elements> |
1455 <dc:context> | 1569 <dc:context> |
1456 <dc:statement> | 1570 <dc:call-macro name="range-filter"> |
1457 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | 1571 <dc:context> |
1458 FROM master_artifacts m | 1572 <dc:statement> |
1459 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | 1573 SELECT id AS out_id |
1460 AND EXISTS ( | 1574 FROM outs |
1461 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | 1575 WHERE artifact_id = ${a_id} AND name = 'cross_section' |
1462 </dc:statement> | 1576 </dc:statement> |
1463 <dc:elements> | 1577 <dc:elements> |
1464 <dc:context> | 1578 <dc:context> |
1465 <dc:statement> | 1579 <dc:statement> |
1466 SELECT id AS out_id | 1580 SELECT name AS facet_name, num as facet_num, description AS facet_description |
1467 FROM outs | 1581 FROM facets |
1468 WHERE artifact_id = ${a_id} AND name = 'cross_section' | 1582 WHERE out_id = ${out_id} |
1469 </dc:statement> | 1583 ORDER BY num ASC, name DESC |
1470 <dc:elements> | 1584 </dc:statement> |
1471 <dc:context> | 1585 <longitudinal_section_columns> |
1472 <dc:statement> | |
1473 SELECT name AS facet_name, num as facet_num, description AS facet_description | |
1474 FROM facets | |
1475 WHERE out_id = ${out_id} | |
1476 ORDER BY num ASC, name DESC | |
1477 </dc:statement> | |
1478 <longitudinal_section_columns> | |
1479 <dc:attribute name="description" value="${river} ${a_creation}"/> | 1586 <dc:attribute name="description" value="${river} ${a_creation}"/> |
1480 <dc:elements> | 1587 <dc:elements> |
1481 <dc:element name="${facet_name}"> | 1588 <dc:element name="${facet_name}"> |
1482 <dc:attribute name="description" value="${facet_description}"/> | 1589 <dc:attribute name="description" value="${facet_description}"/> |
1483 <dc:attribute name="ids" value="${facet_num}"/> | 1590 <dc:attribute name="ids" value="${facet_num}"/> |
1484 <dc:attribute name="factory" value="winfo"/> | 1591 <dc:attribute name="factory" value="winfo"/> |
1485 <dc:attribute name="artifact-id" value="${a_gid}"/> | 1592 <dc:attribute name="artifact-id" value="${a_gid}"/> |
1486 <dc:attribute name="out" value="cross_section"/> | 1593 <dc:attribute name="out" value="cross_section"/> |
1487 </dc:element> | 1594 </dc:element> |
1488 </dc:elements> | 1595 </dc:elements> |
1489 </longitudinal_section_columns> | 1596 </longitudinal_section_columns> |
1490 </dc:context> | 1597 </dc:context> |
1491 </dc:elements> | 1598 </dc:elements> |
1492 </dc:context> | 1599 </dc:context> |
1493 </dc:elements> | 1600 </dc:call-macro> |
1494 </dc:context> | 1601 </dc:context> |
1495 </dc:elements> | 1602 </dc:elements> |
1496 </waterlevels> | 1603 </waterlevels> |
1497 </dc:if> | 1604 </dc:macro> |
1498 | 1605 |
1499 | 1606 |
1500 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))"> | 1607 <dc:macro name="longitudinal"> |
1501 <waterlevels> | 1608 <waterlevels> |
1502 <dc:elements> | 1609 <dc:elements> |
1503 <dc:context> | 1610 <dc:context> |
1504 <dc:statement> | 1611 <dc:call-macro name="range-filter"> |
1505 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | 1612 <dc:context> |
1506 FROM master_artifacts m | |
1507 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1508 AND EXISTS ( | |
1509 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1510 </dc:statement> | |
1511 <dc:elements> | |
1512 <dc:context> | |
1513 <dc:statement> | 1613 <dc:statement> |
1514 SELECT id AS out_id | 1614 SELECT id AS out_id |
1515 FROM outs | 1615 FROM outs |
1516 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' | 1616 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' |
1517 </dc:statement> | 1617 </dc:statement> |
1536 </dc:elements> | 1636 </dc:elements> |
1537 </longitudinal_section_columns> | 1637 </longitudinal_section_columns> |
1538 </dc:context> | 1638 </dc:context> |
1539 </dc:elements> | 1639 </dc:elements> |
1540 </dc:context> | 1640 </dc:context> |
1541 </dc:elements> | 1641 </dc:call-macro> |
1542 </dc:context> | 1642 </dc:context> |
1543 </dc:elements> | 1643 </dc:elements> |
1544 </waterlevels> | 1644 </waterlevels> |
1545 </dc:if> | 1645 </dc:macro> |
1546 | 1646 |
1547 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> | 1647 |
1648 <dc:macro name="longitudinal-section"> | |
1548 <waterlevels> | 1649 <waterlevels> |
1549 <dc:elements> | 1650 <dc:elements> |
1550 <dc:context> | 1651 <dc:context> |
1551 <dc:statement> | 1652 <dc:call-macro name="range-filter"> |
1552 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1553 FROM master_artifacts m | |
1554 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1555 AND EXISTS ( | |
1556 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1557 </dc:statement> | |
1558 <dc:elements> | |
1559 | |
1560 <dc:context> | 1653 <dc:context> |
1561 <dc:statement> | 1654 <dc:statement> |
1562 SELECT id AS out_id | 1655 SELECT id AS out_id |
1563 FROM outs | 1656 FROM outs |
1564 WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve' | 1657 WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve' |
1585 </dc:elements> | 1678 </dc:elements> |
1586 </waterlevels> | 1679 </waterlevels> |
1587 </dc:context> | 1680 </dc:context> |
1588 </dc:elements> | 1681 </dc:elements> |
1589 </dc:context> | 1682 </dc:context> |
1590 </dc:elements> | 1683 </dc:call-macro> |
1591 </dc:context> | 1684 </dc:context> |
1592 </dc:elements> | 1685 </dc:elements> |
1593 </waterlevels> | 1686 </waterlevels> |
1594 </dc:if> | 1687 </dc:macro> |
1595 | 1688 |
1596 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')"> | 1689 <dc:macro name="delta-wt"> |
1597 <waterlevels> | 1690 <waterlevels> |
1598 <dc:elements> | 1691 <dc:elements> |
1599 <dc:context> | 1692 <dc:context> |
1600 <dc:statement> | 1693 <dc:call-macro name="range-filter"> |
1601 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1602 FROM master_artifacts m | |
1603 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1604 AND EXISTS ( | |
1605 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1606 </dc:statement> | |
1607 <dc:elements> | |
1608 | |
1609 <dc:context> | 1694 <dc:context> |
1610 <dc:statement> | 1695 <dc:statement> |
1611 SELECT id AS out_id | 1696 SELECT id AS out_id |
1612 FROM outs | 1697 FROM outs |
1613 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve' | 1698 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve' |
1633 </dc:elements> | 1718 </dc:elements> |
1634 </waterlevels> | 1719 </waterlevels> |
1635 </dc:context> | 1720 </dc:context> |
1636 </dc:elements> | 1721 </dc:elements> |
1637 </dc:context> | 1722 </dc:context> |
1638 </dc:elements> | 1723 </dc:call-macro> |
1639 </dc:context> | 1724 </dc:context> |
1640 </dc:elements> | 1725 </dc:elements> |
1641 </waterlevels> | 1726 </waterlevels> |
1642 </dc:if> | 1727 </dc:macro> |
1643 | 1728 |
1644 <dc:if test="dc:contains($artifact-outs, 'fix_derivate_curve')"> | 1729 |
1730 <dc:macro name="fix-derivate-curve"> | |
1645 <waterlevels> | 1731 <waterlevels> |
1646 <dc:elements> | 1732 <dc:elements> |
1647 <dc:context> | 1733 <dc:context> |
1648 <dc:statement> | 1734 <dc:call-macro name="range-filter"> |
1649 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1650 FROM master_artifacts m | |
1651 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1652 AND EXISTS ( | |
1653 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1654 </dc:statement> | |
1655 <dc:elements> | |
1656 | |
1657 <dc:context> | 1735 <dc:context> |
1658 <dc:statement> | 1736 <dc:statement> |
1659 SELECT id AS out_id | 1737 SELECT id AS out_id |
1660 FROM outs | 1738 FROM outs |
1661 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve' | 1739 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve' |
1681 </dc:elements> | 1759 </dc:elements> |
1682 </waterlevels> | 1760 </waterlevels> |
1683 </dc:context> | 1761 </dc:context> |
1684 </dc:elements> | 1762 </dc:elements> |
1685 </dc:context> | 1763 </dc:context> |
1686 </dc:elements> | 1764 </dc:call-macro> |
1687 </dc:context> | 1765 </dc:context> |
1688 </dc:elements> | 1766 </dc:elements> |
1689 </waterlevels> | 1767 </waterlevels> |
1690 </dc:if> | 1768 </dc:macro> |
1691 | 1769 |
1692 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> | 1770 |
1771 <dc:macro name="fix-wq-curve"> | |
1693 <waterlevels> | 1772 <waterlevels> |
1694 <dc:elements> | 1773 <dc:elements> |
1695 <dc:context> | 1774 <dc:context> |
1696 <dc:statement> | 1775 <dc:call-macro name="range-filter"> |
1697 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1698 FROM master_artifacts m | |
1699 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1700 AND EXISTS ( | |
1701 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1702 </dc:statement> | |
1703 <dc:elements> | |
1704 | |
1705 <dc:context> | 1776 <dc:context> |
1706 <dc:statement> | 1777 <dc:statement> |
1707 SELECT id AS out_id | 1778 SELECT id AS out_id |
1708 FROM outs | 1779 FROM outs |
1709 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve' | 1780 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve' |
1729 </dc:elements> | 1800 </dc:elements> |
1730 </waterlevels> | 1801 </waterlevels> |
1731 </dc:context> | 1802 </dc:context> |
1732 </dc:elements> | 1803 </dc:elements> |
1733 </dc:context> | 1804 </dc:context> |
1734 </dc:elements> | 1805 </dc:call-macro> |
1735 </dc:context> | 1806 </dc:context> |
1736 </dc:elements> | 1807 </dc:elements> |
1737 </waterlevels> | 1808 </waterlevels> |
1738 </dc:if> | 1809 </dc:macro> |
1739 | 1810 |
1740 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> | 1811 |
1812 <dc:macro name="duration-curve"> | |
1741 <computed_discharge_curves> | 1813 <computed_discharge_curves> |
1742 <dc:elements> | 1814 <dc:elements> |
1743 <dc:context> | 1815 <dc:context> |
1744 <dc:statement> | 1816 <dc:call-macro name="range-filter"> |
1745 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1746 FROM master_artifacts m | |
1747 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1748 AND EXISTS ( | |
1749 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1750 </dc:statement> | |
1751 <dc:elements> | |
1752 <dc:context> | 1817 <dc:context> |
1753 <dc:statement> | 1818 <dc:statement> |
1754 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1819 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1755 FROM outs as o, facets as f, artifacts as a | 1820 FROM outs as o, facets as f, artifacts as a |
1756 WHERE (f.name = 'duration_curve.q' or f.name = 'duration_curve.w') and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1821 WHERE (f.name = 'duration_curve.q' or f.name = 'duration_curve.w') and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1763 <dc:attribute name="ids" value="${aid}"/> | 1828 <dc:attribute name="ids" value="${aid}"/> |
1764 <dc:attribute name="out" value="duration_curve"/> | 1829 <dc:attribute name="out" value="duration_curve"/> |
1765 </dc:element> | 1830 </dc:element> |
1766 </dc:elements> | 1831 </dc:elements> |
1767 </dc:context> | 1832 </dc:context> |
1768 </dc:elements> | 1833 </dc:call-macro> |
1769 </dc:context> | 1834 </dc:context> |
1770 </dc:elements> | 1835 </dc:elements> |
1771 </computed_discharge_curves> | 1836 </computed_discharge_curves> |
1772 </dc:if> | 1837 </dc:macro> |
1838 | |
1773 <dc:comment> | 1839 <dc:comment> |
1774 WATERLEVELS - ONLY SHOW Ws | 1840 WATERLEVELS - ONLY SHOW Ws |
1775 </dc:comment> | 1841 </dc:comment> |
1776 | 1842 |
1777 <!-- TODO doesnt work nicely for fix/wq-diags. --> | 1843 <!-- TODO doesnt work nicely for fix/wq-diags. --> |
1778 <dc:if test="dc:contains($artifact-outs, 'waterlevels') or (dc:contains($artifact-outs, 'fix_wq_curve'))"> | 1844 |
1845 <dc:macro name="waterlevel-fix"> | |
1779 <waterlevels> | 1846 <waterlevels> |
1780 <dc:elements> | 1847 <dc:elements> |
1781 <dc:context> | 1848 <dc:context> |
1782 <dc:statement> | 1849 <dc:call-macro name="range-filter"> |
1783 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1784 FROM master_artifacts m | |
1785 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1786 AND EXISTS ( | |
1787 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1788 </dc:statement> | |
1789 <dc:elements> | |
1790 | |
1791 <dc:context> | 1850 <dc:context> |
1792 <dc:statement> | 1851 <dc:statement> |
1793 SELECT id AS out_id | 1852 SELECT id AS out_id |
1794 FROM outs | 1853 FROM outs |
1795 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' | 1854 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' |
1815 </dc:elements> | 1874 </dc:elements> |
1816 </waterlevels> | 1875 </waterlevels> |
1817 </dc:context> | 1876 </dc:context> |
1818 </dc:elements> | 1877 </dc:elements> |
1819 </dc:context> | 1878 </dc:context> |
1820 </dc:elements> | 1879 </dc:call-macro> |
1821 </dc:context> | 1880 </dc:context> |
1822 </dc:elements> | 1881 </dc:elements> |
1823 </waterlevels> | 1882 </waterlevels> |
1824 </dc:if> | 1883 </dc:macro> |
1825 | 1884 |
1826 <dc:comment> | 1885 <dc:comment> |
1827 SHOW FLOODMAPS | 1886 SHOW FLOODMAPS |
1828 </dc:comment> | 1887 </dc:comment> |
1829 | 1888 |
1830 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')"> | 1889 |
1890 <dc:macro name="flood-map"> | |
1831 <floodmap> | 1891 <floodmap> |
1832 <dc:elements> | 1892 <dc:elements> |
1833 <dc:context> | 1893 <dc:context> |
1834 <dc:statement> | 1894 <dc:call-macro name="range-filter"> |
1835 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1836 FROM master_artifacts m | |
1837 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1838 AND EXISTS ( | |
1839 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1840 </dc:statement> | |
1841 <dc:elements> | |
1842 <dc:context> | 1895 <dc:context> |
1843 <dc:statement> | 1896 <dc:statement> |
1844 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1897 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1845 FROM outs as o, facets as f, artifacts as a | 1898 FROM outs as o, facets as f, artifacts as a |
1846 WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1899 WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1853 <dc:attribute name="ids" value="${aid}"/> | 1906 <dc:attribute name="ids" value="${aid}"/> |
1854 <dc:attribute name="out" value="floodmap"/> | 1907 <dc:attribute name="out" value="floodmap"/> |
1855 </dc:element> | 1908 </dc:element> |
1856 </dc:elements> | 1909 </dc:elements> |
1857 </dc:context> | 1910 </dc:context> |
1858 </dc:elements> | 1911 </dc:call-macro> |
1859 </dc:context> | 1912 </dc:context> |
1860 </dc:elements> | 1913 </dc:elements> |
1861 </floodmap> | 1914 </floodmap> |
1862 </dc:if> | 1915 </dc:macro> |
1863 | 1916 |
1864 <dc:comment> | 1917 <dc:comment> |
1865 MINFO bedheight difference | 1918 MINFO bedheight difference |
1866 </dc:comment> | 1919 </dc:comment> |
1867 | 1920 |
1868 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year') or dc:contains($artifact-outs, 'bed_difference_height_year')"> | 1921 <dc:macro name="bed-difference"> |
1869 <fix_longitudinal_section_curve> | 1922 <fix_longitudinal_section_curve> |
1870 <dc:elements> | 1923 <dc:elements> |
1871 <dc:context> | 1924 <dc:context> |
1872 <dc:statement> | 1925 <dc:call-macro name="range-filter"> |
1873 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1874 FROM master_artifacts m | |
1875 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1876 AND EXISTS ( | |
1877 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1878 </dc:statement> | |
1879 <dc:elements> | |
1880 <dc:context> | 1926 <dc:context> |
1881 <dc:statement> | 1927 <dc:statement> |
1882 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1928 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1883 FROM outs as o, facets as f, artifacts as a | 1929 FROM outs as o, facets as f, artifacts as a |
1884 WHERE (f.name = 'fix_sector_average_ls_0' or f.name = 'fix_sector_average_ls_1' or f.name = 'fix_sector_average_ls_2' | 1930 WHERE (f.name = 'fix_sector_average_ls_0' or f.name = 'fix_sector_average_ls_1' or f.name = 'fix_sector_average_ls_2' |
1896 <dc:attribute name="out" value="fix_longitudinal_section_curve"/> | 1942 <dc:attribute name="out" value="fix_longitudinal_section_curve"/> |
1897 </dc:element> | 1943 </dc:element> |
1898 </dc:elements> | 1944 </dc:elements> |
1899 </fix_longitudinal_section_curve> | 1945 </fix_longitudinal_section_curve> |
1900 </dc:context> | 1946 </dc:context> |
1901 </dc:elements> | 1947 </dc:call-macro> |
1902 </dc:context> | 1948 </dc:context> |
1903 </dc:elements> | 1949 </dc:elements> |
1904 </fix_longitudinal_section_curve> | 1950 </fix_longitudinal_section_curve> |
1905 </dc:if> | 1951 </dc:macro> |
1906 | 1952 |
1907 <dc:comment> | 1953 <dc:comment> |
1908 MINFO bedheight middle | 1954 MINFO bedheight middle |
1909 </dc:comment> | 1955 </dc:comment> |
1910 | 1956 |
1911 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> | 1957 <dc:macro name="bed-height"> |
1912 <fix_vollmer_wq_curve> | 1958 <fix_vollmer_wq_curve> |
1913 <dc:elements> | 1959 <dc:elements> |
1914 <dc:context> | 1960 <dc:context> |
1915 <dc:statement> | 1961 <dc:call-macro name="range-filter"> |
1916 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1917 FROM master_artifacts m | |
1918 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1919 AND EXISTS ( | |
1920 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1921 </dc:statement> | |
1922 <dc:elements> | |
1923 <dc:context> | 1962 <dc:context> |
1924 <dc:statement> | 1963 <dc:statement> |
1925 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1964 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1926 FROM outs as o, facets as f, artifacts as a | 1965 FROM outs as o, facets as f, artifacts as a |
1927 WHERE (f.name = 'longitudinal_section.w' or f.name = 'heightmarks_points') | 1966 WHERE (f.name = 'longitudinal_section.w' or f.name = 'heightmarks_points') |
1938 <dc:attribute name="out" value="longitudinal_section"/> | 1977 <dc:attribute name="out" value="longitudinal_section"/> |
1939 </dc:element> | 1978 </dc:element> |
1940 </dc:elements> | 1979 </dc:elements> |
1941 </fix_vollmer_wq_curve> | 1980 </fix_vollmer_wq_curve> |
1942 </dc:context> | 1981 </dc:context> |
1943 </dc:elements> | 1982 </dc:call-macro> |
1944 </dc:context> | 1983 </dc:context> |
1945 </dc:elements> | 1984 </dc:elements> |
1946 </fix_vollmer_wq_curve> | 1985 </fix_vollmer_wq_curve> |
1986 </dc:macro> | |
1987 | |
1988 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))"> | |
1989 <dc:call-macro name="longitudinal"/> | |
1947 </dc:if> | 1990 </dc:if> |
1991 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')"> | |
1992 <dc:call-macro name="delta-wt"/> | |
1993 </dc:if> | |
1994 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))"> | |
1995 <dc:call-macro name="differences"/> | |
1996 </dc:if> | |
1997 <dc:if test="dc:contains($artifact-outs, 'reference_curve')"> | |
1998 <dc:call-macro name="reference-curves"/> | |
1999 </dc:if> | |
2000 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> | |
2001 <dc:call-macro name="computed-discharge-curve"/> | |
2002 </dc:if> | |
2003 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> | |
2004 <dc:call-macro name="waterlevels"/> | |
2005 </dc:if> | |
2006 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> | |
2007 <dc:call-macro name="longitudinal-section"/> | |
2008 </dc:if> | |
2009 <dc:if test="dc:contains($artifact-outs, 'fix_derivate_curve')"> | |
2010 <dc:call-macro name="fix-derivate-curve"/> | |
2011 </dc:if> | |
2012 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> | |
2013 <dc:call-macro name="fix-wq-curve"/> | |
2014 </dc:if> | |
2015 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> | |
2016 <dc:call-macro name="duration-curve"/> | |
2017 </dc:if> | |
2018 <dc:if test="dc:contains($artifact-outs, 'waterlevels') or (dc:contains($artifact-outs, 'fix_wq_curve'))"> | |
2019 <dc:call-macro name="waterlevels-fix"/> | |
2020 </dc:if> | |
2021 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')"> | |
2022 <dc:call-macro name="flood-map"/> | |
2023 </dc:if> | |
2024 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year') or dc:contains($artifact-outs, 'bed_difference_height_year')"> | |
2025 <dc:call-macro name="bed-difference"/> | |
2026 </dc:if> | |
2027 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> | |
2028 <dc:call-macro name="bed-height"/> | |
2029 </dc:if> | |
1948 | 2030 |
1949 </dc:context> | 2031 </dc:context> |
2032 </dc:call-macro> | |
2033 | |
1950 </old_calculations> | 2034 </old_calculations> |
1951 | 2035 |
1952 | 2036 |
1953 <dc:comment> | 2037 <dc:comment> |
1954 Include System specific part when 'load-system' is in parameters. | 2038 Include System specific part when 'load-system' is in parameters. |