Mercurial > dive4elements > river
comparison flys-artifacts/doc/conf/meta-data.xml @ 5015:86e79fbb8fa3 dc-km-filter-rr
Added km filter to dc-config.
* Use a new macro to get the current range.
* Use min/max km to filter dc data.
* Extracted new macro in user part.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 19 Feb 2013 10:46:41 +0100 |
parents | 065a78d65007 |
children | cad911029c9d |
comparison
equal
deleted
inserted
replaced
4994:63617e142dfe | 5015:86e79fbb8fa3 |
---|---|
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')"> |
707 </dc:if> | 813 </dc:if> |
708 <dc:comment> | 814 <dc:comment> |
709 MINFO bedheight middle | 815 MINFO bedheight middle |
710 </dc:comment> | 816 </dc:comment> |
711 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> | 817 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> |
712 <soundings_width> | 818 <dc:call-macro name="sounding-width"/> |
713 <dc:context> | |
714 <dc:statement> | |
715 SELECT id AS bedh_id, | |
716 year AS bedh_year, | |
717 description AS bedh_descr | |
718 FROM bed_height_single WHERE river_id = ${river_id} | |
719 </dc:statement> | |
720 <dc:elements> | |
721 <height> | |
722 <dc:attribute name="factory" value="bedheight"/> | |
723 <dc:attribute name="ids" value="bedheight-singlevalues-${bedh_id}-${bedh_year}"/> | |
724 <dc:attribute name="description" value="${bedh_descr}"/> | |
725 </height> | |
726 </dc:elements> | |
727 </dc:context> | |
728 </soundings_width> | |
729 </dc:if> | 819 </dc:if> |
730 <dc:comment comment="--- non-recommendations---"/> | 820 <dc:comment comment="--- non-recommendations---"/> |
731 </dc:otherwise> | 821 </dc:otherwise> |
732 </dc:choose> | 822 </dc:choose> |
733 | 823 |
1316 ------------------ | 1406 ------------------ |
1317 </dc:comment> | 1407 </dc:comment> |
1318 <dc:when test="dc:contains($parameters, 'user-id')"> | 1408 <dc:when test="dc:contains($parameters, 'user-id')"> |
1319 | 1409 |
1320 | 1410 |
1321 <old_calculations> | 1411 <old_calculations> |
1322 <dc:context connection="user"> | 1412 <!-- <dc:macro name="load-user">--> |
1323 <dc:comment> | 1413 <dc:call-macro name="user-range"> |
1324 Get the user and collection-id. | 1414 <dc:context connection="user"> |
1325 </dc:comment> | 1415 <dc:comment> |
1326 <dc:statement> | 1416 Get the user and collection-id. |
1417 </dc:comment> | |
1418 <dc:statement> | |
1327 SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name | 1419 SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name |
1328 FROM collections c JOIN users u ON c.user_id = u.id | 1420 FROM collections c JOIN users u ON c.user_id = u.id |
1329 WHERE u.gid = CAST(${user-id} AS uuid) | 1421 WHERE u.gid = CAST(${user-id} AS uuid) |
1330 ORDER BY c.creation DESC | 1422 ORDER BY c.creation DESC |
1331 </dc:statement> | 1423 </dc:statement> |
1332 | 1424 |
1425 | |
1426 <dc:macro name="range-filter"> | |
1427 <dc:statement> | |
1428 SELECT m.id AS a_id, | |
1429 m.state AS a_state, | |
1430 m.gid AS a_gid, | |
1431 m.creation AS a_creation, | |
1432 COALESCE(ld_mode, '') AS ld_m, | |
1433 COALESCE(ld_locations, '') AS ld_l, | |
1434 COALESCE(ld_from, '') AS ld_f, | |
1435 COALESCE(ld_to, '') AS ld_t | |
1436 FROM master_artifacts_range m | |
1437 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1438 AND EXISTS ( | |
1439 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1440 </dc:statement> | |
1441 <dc:elements> | |
1442 <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/> | |
1443 <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/> | |
1444 <dc:if test="($from >= $fromkm and $from <= $tokm) or ($to <= $tokm and $to >= $fromkm) or ($from <= $fromkm and $to >= $tokm)"> | |
1445 <dc:macro-body/> | |
1446 </dc:if> | |
1447 </dc:elements> | |
1448 </dc:macro> | |
1449 | |
1333 <!-- OFFICIAL LINES --> | 1450 <!-- OFFICIAL LINES --> |
1334 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')"> | 1451 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')"> |
1335 <dc:comment comment=".wst -------------------------------"/> | 1452 <dc:comment comment=".wst -------------------------------"/> |
1336 <officiallines> | 1453 <officiallines> |
1337 <dc:elements> | 1454 <dc:elements> |
1338 <dc:context> | 1455 <dc:context> |
1339 <dc:statement> | 1456 <dc:statement> |
1340 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 | 1457 SELECT m.id AS a_id, |
1341 FROM master_artifacts m, artifact_data ardg, artifact_data arv | 1458 m.state AS a_state, |
1342 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' | 1459 m.gid AS a_gid, |
1343 AND EXISTS ( | 1460 m.creation AS a_creation, |
1344 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | 1461 ardg.v AS gaugy, |
1462 arv.v AS wqsingle | |
1463 FROM master_artifacts m, | |
1464 artifact_data ardg, | |
1465 artifact_data arv | |
1466 WHERE m.collection_id = ${collection_id} | |
1467 AND m.gid = CAST(${artifact-id} AS uuid) | |
1468 AND ardg.artifact_id = m.id | |
1469 AND ardg.k = 'ld_gaugename' | |
1470 AND arv.artifact_id = m.id | |
1471 AND arv.k = 'wq_single' | |
1472 AND EXISTS ( | |
1473 SELECT id | |
1474 FROM artifact_data ad | |
1475 WHERE ad.artifact_id = m.id | |
1476 AND k = 'river' | |
1477 AND v = ${river}) | |
1345 </dc:statement> | 1478 </dc:statement> |
1346 <dc:elements> | 1479 <dc:elements> |
1347 <dc:context connection="system"> | 1480 <dc:context connection="system"> |
1348 <dc:statement> | 1481 <dc:statement> |
1349 SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval | 1482 SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval |
1367 | 1500 |
1368 <dc:comment> | 1501 <dc:comment> |
1369 SHOW W-DIFFERENCES | 1502 SHOW W-DIFFERENCES |
1370 </dc:comment> | 1503 </dc:comment> |
1371 | 1504 |
1372 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))"> | 1505 <dc:macro name="differences"> |
1373 <differences> | 1506 <differences> |
1374 <dc:elements> | 1507 <dc:elements> |
1375 <dc:context> | 1508 <dc:context> |
1376 <dc:statement> | 1509 <dc:call-macro name="range-filter"> |
1377 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1378 FROM master_artifacts m | |
1379 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1380 AND EXISTS ( | |
1381 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1382 </dc:statement> | |
1383 <dc:elements> | |
1384 <dc:context> | 1510 <dc:context> |
1385 <dc:statement> | 1511 <dc:statement> |
1386 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1512 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1387 FROM outs as o, facets as f, artifacts as a | 1513 FROM outs as o, facets as f, artifacts as a |
1388 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1514 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1395 <dc:attribute name="ids" value="${aid}"/> | 1521 <dc:attribute name="ids" value="${aid}"/> |
1396 <dc:attribute name="out" value="w_differences"/> | 1522 <dc:attribute name="out" value="w_differences"/> |
1397 </dc:element> | 1523 </dc:element> |
1398 </dc:elements> | 1524 </dc:elements> |
1399 </dc:context> | 1525 </dc:context> |
1400 </dc:elements> | 1526 </dc:call-macro> |
1401 </dc:context> | 1527 </dc:context> |
1402 </dc:elements> | 1528 </dc:elements> |
1403 </differences> | 1529 </differences> |
1404 </dc:if> | 1530 </dc:macro> |
1405 | 1531 |
1406 <dc:comment> | 1532 <dc:comment> |
1407 SHOW REFERENCE CURVE | 1533 SHOW REFERENCE CURVE |
1408 </dc:comment> | 1534 </dc:comment> |
1409 | 1535 |
1410 <dc:if test="dc:contains($artifact-outs, 'reference_curve')"> | 1536 |
1537 <dc:macro name="reference-curves"> | |
1411 <reference_curves> | 1538 <reference_curves> |
1412 <dc:elements> | 1539 <dc:elements> |
1413 <dc:context> | 1540 <dc:context> |
1414 <dc:statement> | 1541 <dc:call-macro name="user-range"> |
1415 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1416 FROM master_artifacts m | |
1417 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1418 AND EXISTS ( | |
1419 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1420 </dc:statement> | |
1421 <dc:elements> | |
1422 <dc:context> | 1542 <dc:context> |
1423 <dc:statement> | 1543 <dc:statement> |
1424 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1544 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1425 FROM outs as o, facets as f, artifacts as a | 1545 FROM outs as o, facets as f, artifacts as a |
1426 WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1546 WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1433 <dc:attribute name="ids" value="${aid}"/> | 1553 <dc:attribute name="ids" value="${aid}"/> |
1434 <dc:attribute name="out" value="reference_curve"/> | 1554 <dc:attribute name="out" value="reference_curve"/> |
1435 </dc:element> | 1555 </dc:element> |
1436 </dc:elements> | 1556 </dc:elements> |
1437 </dc:context> | 1557 </dc:context> |
1438 </dc:elements> | 1558 </dc:call-macro> |
1439 </dc:context> | 1559 </dc:context> |
1440 </dc:elements> | 1560 </dc:elements> |
1441 </reference_curves> | 1561 </reference_curves> |
1442 </dc:if> | 1562 </dc:macro> |
1443 | 1563 |
1444 <dc:comment> | 1564 <dc:comment> |
1445 SHOW COMPUTED DISCHARGE CURVES | 1565 SHOW COMPUTED DISCHARGE CURVES |
1446 </dc:comment> | 1566 </dc:comment> |
1447 | 1567 |
1448 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> | 1568 <dc:macro name="computed-discharge-curve"> |
1449 <computed_discharge_curves> | 1569 <computed_discharge_curves> |
1450 <dc:elements> | 1570 <dc:elements> |
1451 <dc:context> | 1571 <dc:context> |
1452 <dc:statement> | 1572 <dc:call-macro name="range-filter"> |
1453 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1454 FROM master_artifacts m | |
1455 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1456 AND EXISTS ( | |
1457 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1458 </dc:statement> | |
1459 <dc:elements> | |
1460 <dc:context> | 1573 <dc:context> |
1461 <dc:statement> | 1574 <dc:statement> |
1462 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1575 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1463 FROM outs as o, facets as f, artifacts as a | 1576 FROM outs as o, facets as f, artifacts as a |
1464 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1577 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1471 <dc:attribute name="ids" value="${aid}"/> | 1584 <dc:attribute name="ids" value="${aid}"/> |
1472 <dc:attribute name="out" value="computed_discharge_curve"/> | 1585 <dc:attribute name="out" value="computed_discharge_curve"/> |
1473 </dc:element> | 1586 </dc:element> |
1474 </dc:elements> | 1587 </dc:elements> |
1475 </dc:context> | 1588 </dc:context> |
1476 </dc:elements> | 1589 </dc:call-macro> |
1477 </dc:context> | 1590 </dc:context> |
1478 </dc:elements> | 1591 </dc:elements> |
1479 </computed_discharge_curves> | 1592 </computed_discharge_curves> |
1480 </dc:if> | 1593 </dc:macro> |
1481 | 1594 |
1482 <dc:comment> | 1595 <dc:comment> |
1483 CROSS SECTION | 1596 CROSS SECTION |
1484 </dc:comment> | 1597 </dc:comment> |
1485 | 1598 |
1486 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> | 1599 |
1600 <dc:macro name="waterlevels"> | |
1487 <waterlevels> | 1601 <waterlevels> |
1488 <dc:elements> | 1602 <dc:elements> |
1489 <dc:context> | 1603 <dc:context> |
1490 <dc:statement> | 1604 <dc:call-macro name="range-filter"> |
1491 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | 1605 <dc:context> |
1492 FROM master_artifacts m | 1606 <dc:statement> |
1493 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | 1607 SELECT id AS out_id |
1494 AND EXISTS ( | 1608 FROM outs |
1495 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | 1609 WHERE artifact_id = ${a_id} AND name = 'cross_section' |
1496 </dc:statement> | 1610 </dc:statement> |
1497 <dc:elements> | 1611 <dc:elements> |
1498 <dc:context> | 1612 <dc:context> |
1499 <dc:statement> | 1613 <dc:statement> |
1500 SELECT id AS out_id | 1614 SELECT name AS facet_name, num as facet_num, description AS facet_description |
1501 FROM outs | 1615 FROM facets |
1502 WHERE artifact_id = ${a_id} AND name = 'cross_section' | 1616 WHERE out_id = ${out_id} |
1503 </dc:statement> | 1617 ORDER BY num ASC, name DESC |
1504 <dc:elements> | 1618 </dc:statement> |
1505 <dc:context> | 1619 <longitudinal_section_columns> |
1506 <dc:statement> | |
1507 SELECT name AS facet_name, num as facet_num, description AS facet_description | |
1508 FROM facets | |
1509 WHERE out_id = ${out_id} | |
1510 ORDER BY num ASC, name DESC | |
1511 </dc:statement> | |
1512 <longitudinal_section_columns> | |
1513 <dc:attribute name="description" value="${river} ${a_creation}"/> | 1620 <dc:attribute name="description" value="${river} ${a_creation}"/> |
1514 <dc:elements> | 1621 <dc:elements> |
1515 <dc:element name="${facet_name}"> | 1622 <dc:element name="${facet_name}"> |
1516 <dc:attribute name="description" value="${facet_description}"/> | 1623 <dc:attribute name="description" value="${facet_description}"/> |
1517 <dc:attribute name="ids" value="${facet_num}"/> | 1624 <dc:attribute name="ids" value="${facet_num}"/> |
1518 <dc:attribute name="factory" value="winfo"/> | 1625 <dc:attribute name="factory" value="winfo"/> |
1519 <dc:attribute name="artifact-id" value="${a_gid}"/> | 1626 <dc:attribute name="artifact-id" value="${a_gid}"/> |
1520 <dc:attribute name="out" value="cross_section"/> | 1627 <dc:attribute name="out" value="cross_section"/> |
1521 </dc:element> | 1628 </dc:element> |
1522 </dc:elements> | 1629 </dc:elements> |
1523 </longitudinal_section_columns> | 1630 </longitudinal_section_columns> |
1524 </dc:context> | 1631 </dc:context> |
1525 </dc:elements> | 1632 </dc:elements> |
1526 </dc:context> | 1633 </dc:context> |
1527 </dc:elements> | 1634 </dc:call-macro> |
1528 </dc:context> | 1635 </dc:context> |
1529 </dc:elements> | 1636 </dc:elements> |
1530 </waterlevels> | 1637 </waterlevels> |
1531 </dc:if> | 1638 </dc:macro> |
1532 | 1639 |
1533 | 1640 |
1534 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))"> | 1641 <dc:macro name="longitudinal"> |
1535 <waterlevels> | 1642 <waterlevels> |
1536 <dc:elements> | 1643 <dc:elements> |
1537 <dc:context> | 1644 <dc:context> |
1538 <dc:statement> | 1645 <dc:call-macro name="range-filter"> |
1539 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | 1646 <dc:context> |
1540 FROM master_artifacts m | |
1541 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1542 AND EXISTS ( | |
1543 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1544 </dc:statement> | |
1545 <dc:elements> | |
1546 <dc:context> | |
1547 <dc:statement> | 1647 <dc:statement> |
1548 SELECT id AS out_id | 1648 SELECT id AS out_id |
1549 FROM outs | 1649 FROM outs |
1550 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' | 1650 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' |
1551 </dc:statement> | 1651 </dc:statement> |
1570 </dc:elements> | 1670 </dc:elements> |
1571 </longitudinal_section_columns> | 1671 </longitudinal_section_columns> |
1572 </dc:context> | 1672 </dc:context> |
1573 </dc:elements> | 1673 </dc:elements> |
1574 </dc:context> | 1674 </dc:context> |
1575 </dc:elements> | 1675 </dc:call-macro> |
1576 </dc:context> | 1676 </dc:context> |
1577 </dc:elements> | 1677 </dc:elements> |
1578 </waterlevels> | 1678 </waterlevels> |
1579 </dc:if> | 1679 </dc:macro> |
1580 | 1680 |
1581 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> | 1681 |
1682 <dc:macro name="longitudinal-section"> | |
1582 <waterlevels> | 1683 <waterlevels> |
1583 <dc:elements> | 1684 <dc:elements> |
1584 <dc:context> | 1685 <dc:context> |
1585 <dc:statement> | 1686 <dc:call-macro name="range-filter"> |
1586 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1587 FROM master_artifacts m | |
1588 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1589 AND EXISTS ( | |
1590 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1591 </dc:statement> | |
1592 <dc:elements> | |
1593 | |
1594 <dc:context> | 1687 <dc:context> |
1595 <dc:statement> | 1688 <dc:statement> |
1596 SELECT id AS out_id | 1689 SELECT id AS out_id |
1597 FROM outs | 1690 FROM outs |
1598 WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve' | 1691 WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve' |
1619 </dc:elements> | 1712 </dc:elements> |
1620 </waterlevels> | 1713 </waterlevels> |
1621 </dc:context> | 1714 </dc:context> |
1622 </dc:elements> | 1715 </dc:elements> |
1623 </dc:context> | 1716 </dc:context> |
1624 </dc:elements> | 1717 </dc:call-macro> |
1625 </dc:context> | 1718 </dc:context> |
1626 </dc:elements> | 1719 </dc:elements> |
1627 </waterlevels> | 1720 </waterlevels> |
1628 </dc:if> | 1721 </dc:macro> |
1629 | 1722 |
1630 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')"> | 1723 <dc:macro name="delta-wt"> |
1631 <waterlevels> | 1724 <waterlevels> |
1632 <dc:elements> | 1725 <dc:elements> |
1633 <dc:context> | 1726 <dc:context> |
1634 <dc:statement> | 1727 <dc:call-macro name="range-filter"> |
1635 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1636 FROM master_artifacts m | |
1637 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1638 AND EXISTS ( | |
1639 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1640 </dc:statement> | |
1641 <dc:elements> | |
1642 | |
1643 <dc:context> | 1728 <dc:context> |
1644 <dc:statement> | 1729 <dc:statement> |
1645 SELECT id AS out_id | 1730 SELECT id AS out_id |
1646 FROM outs | 1731 FROM outs |
1647 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve' | 1732 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve' |
1667 </dc:elements> | 1752 </dc:elements> |
1668 </waterlevels> | 1753 </waterlevels> |
1669 </dc:context> | 1754 </dc:context> |
1670 </dc:elements> | 1755 </dc:elements> |
1671 </dc:context> | 1756 </dc:context> |
1672 </dc:elements> | 1757 </dc:call-macro> |
1673 </dc:context> | 1758 </dc:context> |
1674 </dc:elements> | 1759 </dc:elements> |
1675 </waterlevels> | 1760 </waterlevels> |
1676 </dc:if> | 1761 </dc:macro> |
1677 | 1762 |
1678 <dc:if test="dc:contains($artifact-outs, 'fix_derivate_curve')"> | 1763 |
1764 <dc:macro name="fix-derivate-curve"> | |
1679 <waterlevels> | 1765 <waterlevels> |
1680 <dc:elements> | 1766 <dc:elements> |
1681 <dc:context> | 1767 <dc:context> |
1682 <dc:statement> | 1768 <dc:call-macro name="range-filter"> |
1683 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1684 FROM master_artifacts m | |
1685 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1686 AND EXISTS ( | |
1687 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1688 </dc:statement> | |
1689 <dc:elements> | |
1690 | |
1691 <dc:context> | 1769 <dc:context> |
1692 <dc:statement> | 1770 <dc:statement> |
1693 SELECT id AS out_id | 1771 SELECT id AS out_id |
1694 FROM outs | 1772 FROM outs |
1695 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve' | 1773 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve' |
1715 </dc:elements> | 1793 </dc:elements> |
1716 </waterlevels> | 1794 </waterlevels> |
1717 </dc:context> | 1795 </dc:context> |
1718 </dc:elements> | 1796 </dc:elements> |
1719 </dc:context> | 1797 </dc:context> |
1720 </dc:elements> | 1798 </dc:call-macro> |
1721 </dc:context> | 1799 </dc:context> |
1722 </dc:elements> | 1800 </dc:elements> |
1723 </waterlevels> | 1801 </waterlevels> |
1724 </dc:if> | 1802 </dc:macro> |
1725 | 1803 |
1726 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> | 1804 |
1805 <dc:macro name="fix-wq-curve"> | |
1727 <waterlevels> | 1806 <waterlevels> |
1728 <dc:elements> | 1807 <dc:elements> |
1729 <dc:context> | 1808 <dc:context> |
1730 <dc:statement> | 1809 <dc:call-macro name="range-filter"> |
1731 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1732 FROM master_artifacts m | |
1733 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1734 AND EXISTS ( | |
1735 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1736 </dc:statement> | |
1737 <dc:elements> | |
1738 | |
1739 <dc:context> | 1810 <dc:context> |
1740 <dc:statement> | 1811 <dc:statement> |
1741 SELECT id AS out_id | 1812 SELECT id AS out_id |
1742 FROM outs | 1813 FROM outs |
1743 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve' | 1814 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve' |
1763 </dc:elements> | 1834 </dc:elements> |
1764 </waterlevels> | 1835 </waterlevels> |
1765 </dc:context> | 1836 </dc:context> |
1766 </dc:elements> | 1837 </dc:elements> |
1767 </dc:context> | 1838 </dc:context> |
1768 </dc:elements> | 1839 </dc:call-macro> |
1769 </dc:context> | 1840 </dc:context> |
1770 </dc:elements> | 1841 </dc:elements> |
1771 </waterlevels> | 1842 </waterlevels> |
1772 </dc:if> | 1843 </dc:macro> |
1773 | 1844 |
1774 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> | 1845 |
1846 <dc:macro name="duration-curve"> | |
1775 <computed_discharge_curves> | 1847 <computed_discharge_curves> |
1776 <dc:elements> | 1848 <dc:elements> |
1777 <dc:context> | 1849 <dc:context> |
1778 <dc:statement> | 1850 <dc:call-macro name="range-filter"> |
1779 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1780 FROM master_artifacts m | |
1781 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1782 AND EXISTS ( | |
1783 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1784 </dc:statement> | |
1785 <dc:elements> | |
1786 <dc:context> | 1851 <dc:context> |
1787 <dc:statement> | 1852 <dc:statement> |
1788 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1853 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1789 FROM outs as o, facets as f, artifacts as a | 1854 FROM outs as o, facets as f, artifacts as a |
1790 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} | 1855 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} |
1797 <dc:attribute name="ids" value="${aid}"/> | 1862 <dc:attribute name="ids" value="${aid}"/> |
1798 <dc:attribute name="out" value="duration_curve"/> | 1863 <dc:attribute name="out" value="duration_curve"/> |
1799 </dc:element> | 1864 </dc:element> |
1800 </dc:elements> | 1865 </dc:elements> |
1801 </dc:context> | 1866 </dc:context> |
1802 </dc:elements> | 1867 </dc:call-macro> |
1803 </dc:context> | 1868 </dc:context> |
1804 </dc:elements> | 1869 </dc:elements> |
1805 </computed_discharge_curves> | 1870 </computed_discharge_curves> |
1806 </dc:if> | 1871 </dc:macro> |
1872 | |
1807 <dc:comment> | 1873 <dc:comment> |
1808 WATERLEVELS - ONLY SHOW Ws | 1874 WATERLEVELS - ONLY SHOW Ws |
1809 </dc:comment> | 1875 </dc:comment> |
1810 | 1876 |
1811 <!-- TODO doesnt work nicely for fix/wq-diags. --> | 1877 <!-- TODO doesnt work nicely for fix/wq-diags. --> |
1812 <dc:if test="dc:contains($artifact-outs, 'waterlevels') or (dc:contains($artifact-outs, 'fix_wq_curve'))"> | 1878 |
1879 <dc:macro name="waterlevel-fix"> | |
1813 <waterlevels> | 1880 <waterlevels> |
1814 <dc:elements> | 1881 <dc:elements> |
1815 <dc:context> | 1882 <dc:context> |
1816 <dc:statement> | 1883 <dc:call-macro name="range-filter"> |
1817 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1818 FROM master_artifacts m | |
1819 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1820 AND EXISTS ( | |
1821 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1822 </dc:statement> | |
1823 <dc:elements> | |
1824 | |
1825 <dc:context> | 1884 <dc:context> |
1826 <dc:statement> | 1885 <dc:statement> |
1827 SELECT id AS out_id | 1886 SELECT id AS out_id |
1828 FROM outs | 1887 FROM outs |
1829 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' | 1888 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' |
1849 </dc:elements> | 1908 </dc:elements> |
1850 </waterlevels> | 1909 </waterlevels> |
1851 </dc:context> | 1910 </dc:context> |
1852 </dc:elements> | 1911 </dc:elements> |
1853 </dc:context> | 1912 </dc:context> |
1854 </dc:elements> | 1913 </dc:call-macro> |
1855 </dc:context> | 1914 </dc:context> |
1856 </dc:elements> | 1915 </dc:elements> |
1857 </waterlevels> | 1916 </waterlevels> |
1858 </dc:if> | 1917 </dc:macro> |
1859 | 1918 |
1860 <dc:comment> | 1919 <dc:comment> |
1861 SHOW FLOODMAPS | 1920 SHOW FLOODMAPS |
1862 </dc:comment> | 1921 </dc:comment> |
1863 | 1922 |
1864 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')"> | 1923 |
1924 <dc:macro name="flood-map"> | |
1865 <floodmap> | 1925 <floodmap> |
1866 <dc:elements> | 1926 <dc:elements> |
1867 <dc:context> | 1927 <dc:context> |
1868 <dc:statement> | 1928 <dc:call-macro name="range-filter"> |
1869 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1870 FROM master_artifacts m | |
1871 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1872 AND EXISTS ( | |
1873 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1874 </dc:statement> | |
1875 <dc:elements> | |
1876 <dc:context> | 1929 <dc:context> |
1877 <dc:statement> | 1930 <dc:statement> |
1878 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1931 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1879 FROM outs as o, facets as f, artifacts as a | 1932 FROM outs as o, facets as f, artifacts as a |
1880 WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} | 1933 WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} |
1887 <dc:attribute name="ids" value="${aid}"/> | 1940 <dc:attribute name="ids" value="${aid}"/> |
1888 <dc:attribute name="out" value="floodmap"/> | 1941 <dc:attribute name="out" value="floodmap"/> |
1889 </dc:element> | 1942 </dc:element> |
1890 </dc:elements> | 1943 </dc:elements> |
1891 </dc:context> | 1944 </dc:context> |
1892 </dc:elements> | 1945 </dc:call-macro> |
1893 </dc:context> | 1946 </dc:context> |
1894 </dc:elements> | 1947 </dc:elements> |
1895 </floodmap> | 1948 </floodmap> |
1896 </dc:if> | 1949 </dc:macro> |
1897 | 1950 |
1898 <dc:comment> | 1951 <dc:comment> |
1899 MINFO bedheight difference | 1952 MINFO bedheight difference |
1900 </dc:comment> | 1953 </dc:comment> |
1901 | 1954 |
1902 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year') or dc:contains($artifact-outs, 'bed_difference_height_year')"> | 1955 <dc:macro name="bed-difference"> |
1903 <fix_longitudinal_section_curve> | 1956 <fix_longitudinal_section_curve> |
1904 <dc:elements> | 1957 <dc:elements> |
1905 <dc:context> | 1958 <dc:context> |
1906 <dc:statement> | 1959 <dc:call-macro name="range-filter"> |
1907 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1908 FROM master_artifacts m | |
1909 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1910 AND EXISTS ( | |
1911 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1912 </dc:statement> | |
1913 <dc:elements> | |
1914 <dc:context> | 1960 <dc:context> |
1915 <dc:statement> | 1961 <dc:statement> |
1916 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1962 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1917 FROM outs as o, facets as f, artifacts as a | 1963 FROM outs as o, facets as f, artifacts as a |
1918 WHERE (f.name = 'fix_sector_average_ls_0' or f.name = 'fix_sector_average_ls_1' or f.name = 'fix_sector_average_ls_2' | 1964 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 <dc:attribute name="out" value="fix_longitudinal_section_curve"/> | 1976 <dc:attribute name="out" value="fix_longitudinal_section_curve"/> |
1931 </dc:element> | 1977 </dc:element> |
1932 </dc:elements> | 1978 </dc:elements> |
1933 </fix_longitudinal_section_curve> | 1979 </fix_longitudinal_section_curve> |
1934 </dc:context> | 1980 </dc:context> |
1935 </dc:elements> | 1981 </dc:call-macro> |
1936 </dc:context> | 1982 </dc:context> |
1937 </dc:elements> | 1983 </dc:elements> |
1938 </fix_longitudinal_section_curve> | 1984 </fix_longitudinal_section_curve> |
1939 </dc:if> | 1985 </dc:macro> |
1940 | 1986 |
1941 <dc:comment> | 1987 <dc:comment> |
1942 MINFO bedheight middle | 1988 MINFO bedheight middle |
1943 </dc:comment> | 1989 </dc:comment> |
1944 | 1990 |
1945 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> | 1991 <dc:macro name="bed-height"> |
1946 <fix_vollmer_wq_curve> | 1992 <fix_vollmer_wq_curve> |
1947 <dc:elements> | 1993 <dc:elements> |
1948 <dc:context> | 1994 <dc:context> |
1949 <dc:statement> | 1995 <dc:call-macro name="range-filter"> |
1950 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation | |
1951 FROM master_artifacts m | |
1952 WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) | |
1953 AND EXISTS ( | |
1954 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) | |
1955 </dc:statement> | |
1956 <dc:elements> | |
1957 <dc:context> | 1996 <dc:context> |
1958 <dc:statement> | 1997 <dc:statement> |
1959 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description | 1998 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description |
1960 FROM outs as o, facets as f, artifacts as a | 1999 FROM outs as o, facets as f, artifacts as a |
1961 WHERE (f.name = 'longitudinal_section.w' or f.name = 'heightmarks_points') | 2000 WHERE (f.name = 'longitudinal_section.w' or f.name = 'heightmarks_points') |
1972 <dc:attribute name="out" value="longitudinal_section"/> | 2011 <dc:attribute name="out" value="longitudinal_section"/> |
1973 </dc:element> | 2012 </dc:element> |
1974 </dc:elements> | 2013 </dc:elements> |
1975 </fix_vollmer_wq_curve> | 2014 </fix_vollmer_wq_curve> |
1976 </dc:context> | 2015 </dc:context> |
1977 </dc:elements> | 2016 </dc:call-macro> |
1978 </dc:context> | 2017 </dc:context> |
1979 </dc:elements> | 2018 </dc:elements> |
1980 </fix_vollmer_wq_curve> | 2019 </fix_vollmer_wq_curve> |
2020 </dc:macro> | |
2021 | |
2022 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))"> | |
2023 <dc:call-macro name="longitudinal"/> | |
1981 </dc:if> | 2024 </dc:if> |
2025 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')"> | |
2026 <dc:call-macro name="delta-wt"/> | |
2027 </dc:if> | |
2028 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))"> | |
2029 <dc:call-macro name="differences"/> | |
2030 </dc:if> | |
2031 <dc:if test="dc:contains($artifact-outs, 'reference_curve')"> | |
2032 <dc:call-macro name="reference-curves"/> | |
2033 </dc:if> | |
2034 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> | |
2035 <dc:call-macro name="computed-discharge-curve"/> | |
2036 </dc:if> | |
2037 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> | |
2038 <dc:call-macro name="waterlevels"/> | |
2039 </dc:if> | |
2040 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> | |
2041 <dc:call-macro name="longitudinal-section"/> | |
2042 </dc:if> | |
2043 <dc:if test="dc:contains($artifact-outs, 'fix_derivate_curve')"> | |
2044 <dc:call-macro name="fix-derivate-curve"/> | |
2045 </dc:if> | |
2046 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> | |
2047 <dc:call-macro name="fix-wq-curve"/> | |
2048 </dc:if> | |
2049 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> | |
2050 <dc:call-macro name="duration-curve"/> | |
2051 </dc:if> | |
2052 <dc:if test="dc:contains($artifact-outs, 'waterlevels') or (dc:contains($artifact-outs, 'fix_wq_curve'))"> | |
2053 <dc:call-macro name="waterlevels-fix"/> | |
2054 </dc:if> | |
2055 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')"> | |
2056 <dc:call-macro name="flood-map"/> | |
2057 </dc:if> | |
2058 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year') or dc:contains($artifact-outs, 'bed_difference_height_year')"> | |
2059 <dc:call-macro name="bed-difference"/> | |
2060 </dc:if> | |
2061 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> | |
2062 <dc:call-macro name="bed-height"/> | |
2063 </dc:if> | |
1982 | 2064 |
1983 </dc:context> | 2065 </dc:context> |
2066 </dc:call-macro> | |
2067 | |
1984 </old_calculations> | 2068 </old_calculations> |
1985 | 2069 |
1986 | 2070 |
1987 <dc:comment> | 2071 <dc:comment> |
1988 Include System specific part when 'load-system' is in parameters. | 2072 Include System specific part when 'load-system' is in parameters. |