comparison flys-artifacts/doc/conf/meta-data.xml @ 5528:33d735f5433e

Merged.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 02 Apr 2013 08:58:24 +0200
parents 3badc699af0e
children 52876daf97b0
comparison
equal deleted inserted replaced
5527:6dbc111e9aec 5528:33d735f5433e
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 1 <?xml version="1.0" encoding="UTF-8"?>
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:comment> 4 <dc:comment>
5 Statement to load data from wsts. 5 Statement to load data from wsts.
6 </dc:comment> 6 </dc:comment>
34 SELECT COALESCE(ld_mode, '') AS ldm, 34 SELECT COALESCE(ld_mode, '') AS ldm,
35 COALESCE(ld_locations, '') AS ldl, 35 COALESCE(ld_locations, '') AS ldl,
36 COALESCE(ld_from, '') AS ldf, 36 COALESCE(ld_from, '') AS ldf,
37 COALESCE(ld_to, '') AS ldt 37 COALESCE(ld_to, '') AS ldt
38 FROM master_artifacts_range 38 FROM master_artifacts_range
39 WHERE gid = CAST(${artifact-id} as uuid) 39 WHERE gid = CAST(${artifact-id} AS uuid)
40 </dc:statement> 40 </dc:statement>
41 <dc:elements> 41 <dc:for-each>
42 <dc:variable name="fromkm" type="number" expr="dc:fromValue($ldm, $ldl, $ldf)"/> 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)"/> 43 <dc:variable name="tokm" type="number" expr="dc:toValue($ldm, $ldl, $ldt)"/>
44 <dc:macro-body/> 44 <dc:macro-body/>
45 </dc:elements> 45 </dc:for-each>
46 </dc:context> 46 </dc:context>
47 </dc:when> 47 </dc:when>
48 <dc:otherwise> 48 <dc:otherwise>
49 <dc:variable name="fromkm" type="number" expr="dc:fromValue('', '', '')"/> 49 <dc:variable name="fromkm" type="number" expr="dc:fromValue('', '', '')"/>
50 <dc:variable name="tokm" type="number" expr="dc:toValue('', '', '')"/> 50 <dc:variable name="tokm" type="number" expr="dc:toValue('', '', '')"/>
57 System part. Load data for the given river. 57 System part. Load data for the given river.
58 </dc:comment> 58 </dc:comment>
59 <dc:macro name="load-system"> 59 <dc:macro name="load-system">
60 <dc:context connection="system"> 60 <dc:context connection="system">
61 <dc:statement> 61 <dc:statement>
62 SELECT id AS river_id, name as river_name FROM rivers 62 SELECT id AS river_id, name AS river_name FROM rivers
63 WHERE lower(name) LIKE lower(${river}) 63 WHERE lower(name) LIKE lower(${river})
64 </dc:statement> 64 </dc:statement>
65 <dc:elements> 65 <dc:for-each>
66 66
67 <dc:comment> 67 <dc:comment>
68 Base-data macros (mostly data imported from wst-files). 68 Base-data macros (mostly data imported from wst-files).
69 </dc:comment> 69 </dc:comment>
70 <dc:macro name="basedata_0"> 70 <dc:macro name="basedata_0">
75 <dc:statement> 75 <dc:statement>
76 SELECT id AS prot_id, 76 SELECT id AS prot_id,
77 description AS prot_description 77 description AS prot_description
78 FROM wsts WHERE kind = 0 AND river_id = ${river_id} 78 FROM wsts WHERE kind = 0 AND river_id = ${river_id}
79 </dc:statement> 79 </dc:statement>
80 <dc:elements> 80 <dc:for-each>
81 <basedata> 81 <basedata name="{$prot_description}">
82 <dc:attribute name="name" value="${prot_description}"/>
83 <dc:context> 82 <dc:context>
84 <dc:call-macro name="SQL-wst_columns_statement"/> 83 <dc:call-macro name="SQL-wst_columns_statement"/>
85 <dc:elements> 84 <dc:for-each>
86 <column> 85 <column name="{$prot_column_name}"
87 <dc:attribute name="name" value="${prot_column_name}"/> 86 ids="base_data-wstv-{$prot_rel_pos}-{$prot_id}"
88 <dc:attribute name="ids" value="base_data-wstv-${prot_rel_pos}-${prot_id}"/> 87 factory="staticwkms"
89 <dc:attribute name="factory" value="staticwkms"/> 88 info="{$info} [km {$deffrom} - {$defto}]"/>
90 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 89 </dc:for-each>
91 </column>
92 </dc:elements>
93 </dc:context> 90 </dc:context>
94 </basedata> 91 </basedata>
95 </dc:elements> 92 </dc:for-each>
96 </dc:context> 93 </dc:context>
97 </basedata> 94 </basedata>
98 </dc:call-macro> 95 </dc:call-macro>
99 </dc:macro> 96 </dc:macro>
100 97
106 <dc:statement> 103 <dc:statement>
107 SELECT id AS prot_id, 104 SELECT id AS prot_id,
108 description AS prot_description 105 description AS prot_description
109 FROM wsts WHERE kind = 0 AND river_id = ${river_id} 106 FROM wsts WHERE kind = 0 AND river_id = ${river_id}
110 </dc:statement> 107 </dc:statement>
111 <dc:elements> 108 <dc:for-each>
112 <basedata> 109 <basedata name="{$prot_description}">
113 <dc:attribute name="name" value="${prot_description}"/>
114 <dc:context> 110 <dc:context>
115 <dc:call-macro name="SQL-wst_columns_statement"/> 111 <dc:call-macro name="SQL-wst_columns_statement"/>
116 <dc:elements> 112 <dc:for-each>
117 <column> 113 <column name="{$prot_column_name}"
118 <dc:attribute name="name" value="${prot_column_name}"/> 114 ids="base_data-wstv-{$prot_rel_pos}-{$prot_id}"
119 <dc:attribute name="ids" value="base_data-wstv-${prot_rel_pos}-${prot_id}"/> 115 factory="wqinterpol"
120 <dc:attribute name="factory" value="wqinterpol"/> 116 info="{$info} [km {$deffrom} - {$defto}]"/>
121 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 117 </dc:for-each>
122 </column>
123 </dc:elements>
124 </dc:context> 118 </dc:context>
125 </basedata> 119 </basedata>
126 </dc:elements> 120 </dc:for-each>
127 </dc:context> 121 </dc:context>
128 </basedata> 122 </basedata>
129 </dc:call-macro> 123 </dc:call-macro>
130 </dc:macro> 124 </dc:macro>
131 125
137 <dc:statement> 131 <dc:statement>
138 SELECT id AS prot_id, 132 SELECT id AS prot_id,
139 description AS prot_description 133 description AS prot_description
140 FROM wsts WHERE kind = 1 AND river_id = ${river_id} 134 FROM wsts WHERE kind = 1 AND river_id = ${river_id}
141 </dc:statement> 135 </dc:statement>
142 <dc:elements> 136 <dc:for-each>
143 <additional> 137 <additional name="{$prot_description}">
144 <dc:attribute name="name" value="${prot_description}"/>
145 <dc:context> 138 <dc:context>
146 <dc:call-macro name="SQL-wst_columns_statement"/> 139 <dc:call-macro name="SQL-wst_columns_statement"/>
147 <dc:elements> 140 <dc:for-each>
148 <column> 141 <column name="{$prot_column_name}"
149 <dc:attribute name="name" value="${prot_column_name}"/> 142 ids="additionalsmarks-wstv-{$prot_rel_pos}-{$prot_id}"
150 <dc:attribute name="ids" value="additionalsmarks-wstv-${prot_rel_pos}-${prot_id}"/> 143 factory="staticwkms"
151 <dc:attribute name="factory" value="staticwkms"/> 144 info="{$info} [km {$deffrom} - {$defto}]"/>
152 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 145 </dc:for-each>
153 </column> 146 </dc:context></additional>
154 </dc:elements> 147 </dc:for-each>
155 </dc:context>
156 </additional>
157 </dc:elements>
158 </dc:context> 148 </dc:context>
159 </additionals> 149 </additionals>
160 </dc:call-macro> 150 </dc:call-macro>
161 </dc:macro> 151 </dc:macro>
162 152
168 <dc:statement> 158 <dc:statement>
169 SELECT id AS prot_id, 159 SELECT id AS prot_id,
170 description AS prot_description 160 description AS prot_description
171 FROM wsts WHERE kind = 1 AND river_id = ${river_id} 161 FROM wsts WHERE kind = 1 AND river_id = ${river_id}
172 </dc:statement> 162 </dc:statement>
173 <dc:elements> 163 <dc:for-each>
174 <additional> 164 <additional name="{$prot_description}">
175 <dc:attribute name="name" value="${prot_description}"/>
176 <dc:context> 165 <dc:context>
177 <dc:call-macro name="SQL-wst_columns_statement"/> 166 <dc:call-macro name="SQL-wst_columns_statement"/>
178 <dc:elements> 167 <dc:for-each>
179 <column> 168 <column name="{$prot_column_name}"
180 <dc:attribute name="name" value="${prot_column_name}"/> 169 ids="additionals-wstv-{$prot_rel_pos}-{$prot_id}"
181 <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/> 170 factory="staticwkms"
182 <dc:attribute name="factory" value="staticwkms"/> 171 info="{$info} [km {$deffrom} - {$defto}]"/>
183 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 172 </dc:for-each>
184 </column>
185 </dc:elements>
186 </dc:context> 173 </dc:context>
187 </additional> 174 </additional>
188 </dc:elements> 175 </dc:for-each>
189 </dc:context> 176 </dc:context>
190 </additionals> 177 </additionals>
191 </dc:call-macro> 178 </dc:call-macro>
192 </dc:macro> 179 </dc:macro>
193 180
199 <dc:statement> 186 <dc:statement>
200 SELECT id AS prot_id, 187 SELECT id AS prot_id,
201 description AS prot_description 188 description AS prot_description
202 FROM wsts WHERE kind = 1 AND river_id = ${river_id} 189 FROM wsts WHERE kind = 1 AND river_id = ${river_id}
203 </dc:statement> 190 </dc:statement>
204 <dc:elements> 191 <dc:for-each>
205 <relativepoint> 192 <relativepoint name="{$prot_description}">
206 <dc:attribute name="name" value="${prot_description}"/>
207 <dc:context> 193 <dc:context>
208 <dc:call-macro name="SQL-wst_columns_statement"/> 194 <dc:call-macro name="SQL-wst_columns_statement"/>
209 <dc:elements> 195 <dc:for-each>
210 <column> 196 <column name="{$prot_column_name}"
211 <dc:attribute name="name" value="${prot_column_name}"/> 197 ids="additionals-wstv-{$prot_rel_pos}-{$prot_id}"
212 <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/> 198 factory="staticwkms"
213 <dc:attribute name="factory" value="staticwkms"/> 199 info="{$info} [km {$deffrom} - {$defto}]"/>
214 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 200 </dc:for-each>
215 </column>
216 </dc:elements>
217 </dc:context> 201 </dc:context>
218 </relativepoint> 202 </relativepoint>
219 </dc:elements> 203 </dc:for-each>
220 </dc:context> 204 </dc:context>
221 </additionals> 205 </additionals>
222 </dc:call-macro> 206 </dc:call-macro>
223 </dc:macro> 207 </dc:macro>
224 208
229 <dc:statement> 213 <dc:statement>
230 SELECT id AS prot_id, 214 SELECT id AS prot_id,
231 description AS prot_description 215 description AS prot_description
232 FROM wsts WHERE kind = 2 AND river_id = ${river_id} 216 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
233 </dc:statement> 217 </dc:statement>
234 <dc:elements> 218 <dc:for-each>
235 <fixation> 219 <fixation name="{$prot_description}">
236 <dc:attribute name="name" value="${prot_description}"/> 220 <!--dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/--><dc:context>
237 <!--dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/-->
238 <dc:context>
239 <dc:call-macro name="SQL-wst_columns_statement"/> 221 <dc:call-macro name="SQL-wst_columns_statement"/>
240 <dc:elements> 222 <dc:for-each>
241 <column> 223 <column name="{$prot_column_name}"
242 <dc:attribute name="name" value="${prot_column_name}"/> 224 ids="fixations-wstv-{$prot_rel_pos}-{$prot_id}"
243 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> 225 factory="wqinterpol"
244 <dc:attribute name="factory" value="wqinterpol"/> 226 info="{$info} [km {$deffrom} - {$defto}]"/>
245 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 227 </dc:for-each>
246 </column>
247 </dc:elements>
248 </dc:context> 228 </dc:context>
249 </fixation> 229 </fixation>
250 </dc:elements> 230 </dc:for-each>
251 </dc:context> 231 </dc:context>
252 </fixations> 232 </fixations>
253 </dc:call-macro> 233 </dc:call-macro>
254 </dc:macro> 234 </dc:macro>
255 235
260 <dc:statement> 240 <dc:statement>
261 SELECT id AS prot_id, 241 SELECT id AS prot_id,
262 description AS prot_description 242 description AS prot_description
263 FROM wsts WHERE kind = 2 AND river_id = ${river_id} 243 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
264 </dc:statement> 244 </dc:statement>
265 <dc:elements> 245 <dc:for-each>
266 <fixation> 246 <fixation name="{$prot_description}">
267 <dc:attribute name="name" value="${prot_description}"/>
268 <dc:context> 247 <dc:context>
269 <dc:call-macro name="SQL-wst_columns_statement"/> 248 <dc:call-macro name="SQL-wst_columns_statement"/>
270 <dc:elements> 249 <dc:for-each>
271 <column> 250 <column name="{$prot_column_name}"
272 <dc:attribute name="name" value="${prot_column_name}"/> 251 ids="fixations-wstv-{$prot_rel_pos}-{$prot_id}"
273 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> 252 factory="wqinterpol"
274 <dc:attribute name="factory" value="wqinterpol"/> 253 info="{$info} [km {$deffrom} - {$defto}]"/>
275 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 254 </dc:for-each>
276 </column>
277 </dc:elements>
278 </dc:context> 255 </dc:context>
279 </fixation> 256 </fixation>
280 </dc:elements> 257 </dc:for-each>
281 </dc:context> 258 </dc:context>
282 </fixations> 259 </fixations>
283 </dc:call-macro> 260 </dc:call-macro>
284 </dc:macro> 261 </dc:macro>
285 262
290 <dc:statement> 267 <dc:statement>
291 SELECT id AS prot_id, 268 SELECT id AS prot_id,
292 description AS prot_description 269 description AS prot_description
293 FROM wsts WHERE kind = 2 AND river_id = ${river_id} 270 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
294 </dc:statement> 271 </dc:statement>
295 <dc:elements> 272 <dc:for-each>
296 <fixation> 273 <fixation name="{$prot_description}">
297 <dc:attribute name="name" value="${prot_description}"/>
298 <dc:context> 274 <dc:context>
299 <dc:call-macro name="SQL-wst_columns_statement"/> 275 <dc:call-macro name="SQL-wst_columns_statement"/>
300 <dc:elements> 276 <dc:for-each>
301 <column> 277 <column name="{$prot_column_name}"
302 <dc:attribute name="name" value="${prot_column_name}"/> 278 ids="fixations-wstv-{$prot_rel_pos}-{$prot_id}"
303 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> 279 factory="staticwkms"
304 <dc:attribute name="factory" value="staticwkms"/> 280 info="{$info} [km {$deffrom} - {$defto}]"/>
305 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 281 </dc:for-each>
306 </column>
307 </dc:elements>
308 </dc:context> 282 </dc:context>
309 </fixation> 283 </fixation>
310 </dc:elements> 284 </dc:for-each>
311 </dc:context> 285 </dc:context>
312 </fixations> 286 </fixations>
313 </dc:call-macro> 287 </dc:call-macro>
314 </dc:macro> 288 </dc:macro>
315 289
320 <dc:statement> 294 <dc:statement>
321 SELECT id AS prot_id, 295 SELECT id AS prot_id,
322 description AS prot_description 296 description AS prot_description
323 FROM wsts WHERE kind = 2 AND river_id = ${river_id} 297 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
324 </dc:statement> 298 </dc:statement>
325 <dc:elements> 299 <dc:for-each>
326 <relativepoint> 300 <relativepoint name="{$prot_description}">
327 <dc:attribute name="name" value="${prot_description}"/>
328 <dc:context> 301 <dc:context>
329 <dc:call-macro name="SQL-wst_columns_statement"/> 302 <dc:call-macro name="SQL-wst_columns_statement"/>
330 <dc:elements> 303 <dc:for-each>
331 <column> 304 <column name="{$prot_column_name}"
332 <dc:attribute name="name" value="${prot_column_name}"/> 305 ids="fixations-wstv-{$prot_rel_pos}-{$prot_id}"
333 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/> 306 factory="staticwkms"
334 <dc:attribute name="factory" value="staticwkms"/> 307 info="{$info} [km {$deffrom} - {$defto}]"/>
335 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 308 </dc:for-each>
336 </column>
337 </dc:elements>
338 </dc:context> 309 </dc:context>
339 </relativepoint> 310 </relativepoint>
340 </dc:elements> 311 </dc:for-each>
341 </dc:context> 312 </dc:context>
342 </fixations> 313 </fixations>
343 </dc:call-macro> 314 </dc:call-macro>
344 </dc:macro> 315 </dc:macro>
345 316
351 <dc:statement> 322 <dc:statement>
352 SELECT id AS prot_id, 323 SELECT id AS prot_id,
353 description AS prot_description 324 description AS prot_description
354 FROM wsts WHERE kind = 3 AND river_id = ${river_id} 325 FROM wsts WHERE kind = 3 AND river_id = ${river_id}
355 </dc:statement> 326 </dc:statement>
356 <dc:elements> 327 <dc:for-each>
357 <official> 328 <official name="{$prot_description}">
358 <dc:attribute name="name" value="${prot_description}"/>
359 <dc:context> 329 <dc:context>
360 <dc:call-macro name="SQL-wst_columns_statement"/> 330 <dc:call-macro name="SQL-wst_columns_statement"/>
361 <dc:elements> 331 <dc:for-each>
362 <column> 332 <column name="{$prot_column_name}"
363 <dc:attribute name="name" value="${prot_column_name}"/> 333 ids="additionals-wstv-{$prot_rel_pos}-{$prot_id}"
364 <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/> 334 factory="staticwqkms"
365 <dc:attribute name="factory" value="staticwqkms"/> 335 info="{$info} [km {$deffrom} - {$defto}]"/>
366 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 336 </dc:for-each>
367 </column>
368 </dc:elements>
369 </dc:context> 337 </dc:context>
370 </official> 338 </official>
371 </dc:elements> 339 </dc:for-each>
372 </dc:context> 340 </dc:context>
373 </officiallines> 341 </officiallines>
374 </dc:call-macro> 342 </dc:call-macro>
375 </dc:macro> 343 </dc:macro>
376 344
381 <dc:statement> 349 <dc:statement>
382 SELECT id AS prot_id, 350 SELECT id AS prot_id,
383 description AS prot_description 351 description AS prot_description
384 FROM wsts WHERE kind = 4 AND river_id = ${river_id} 352 FROM wsts WHERE kind = 4 AND river_id = ${river_id}
385 </dc:statement> 353 </dc:statement>
386 <dc:elements> 354 <dc:for-each>
387 <relativepoint> 355 <relativepoint name="{$prot_description}">
388 <dc:attribute name="name" value="${prot_description}"/>
389 <dc:context> 356 <dc:context>
390 <dc:call-macro name="SQL-wst_columns_statement"/> 357 <dc:call-macro name="SQL-wst_columns_statement"/>
391 <dc:elements> 358 <dc:for-each>
392 <column> 359 <column name="{$prot_column_name}"
393 <dc:attribute name="name" value="${prot_column_name}"/> 360 ids="heightmarks_points-wstv-{$prot_rel_pos}-{$prot_id}"
394 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/> 361 factory="staticwkms"
395 <dc:attribute name="factory" value="staticwkms"/> 362 info="{$info} [km {$deffrom} - {$defto}]"/>
396 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 363 </dc:for-each>
397 </column>
398 </dc:elements>
399 </dc:context> 364 </dc:context>
400 </relativepoint> 365 </relativepoint>
401 </dc:elements> 366 </dc:for-each>
402 </dc:context> 367 </dc:context>
403 </heightmarks> 368 </heightmarks>
404 </dc:call-macro> 369 </dc:call-macro>
405 </dc:macro> 370 </dc:macro>
406 371
411 <dc:statement> 376 <dc:statement>
412 SELECT id AS prot_id, 377 SELECT id AS prot_id,
413 description AS prot_description 378 description AS prot_description
414 FROM wsts WHERE kind = 4 AND river_id = ${river_id} 379 FROM wsts WHERE kind = 4 AND river_id = ${river_id}
415 </dc:statement> 380 </dc:statement>
416 <dc:elements> 381 <dc:for-each>
417 <heightmark> 382 <heightmark name="{$prot_description}">
418 <dc:attribute name="name" value="${prot_description}"/>
419 <dc:context> 383 <dc:context>
420 <dc:call-macro name="SQL-wst_columns_statement"/> 384 <dc:call-macro name="SQL-wst_columns_statement"/>
421 <dc:elements> 385 <dc:for-each>
422 <column> 386 <column name="{$prot_column_name}"
423 <dc:attribute name="name" value="${prot_column_name}"/> 387 ids="heightmarks_points-wstv-{$prot_rel_pos}-{$prot_id}"
424 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/> 388 factory="staticwkms"
425 <dc:attribute name="factory" value="staticwkms"/> 389 info="{$info} [km {$deffrom} - {$defto}]"/>
426 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 390 </dc:for-each>
427 </column>
428 </dc:elements>
429 </dc:context> 391 </dc:context>
430 </heightmark> 392 </heightmark>
431 </dc:elements> 393 </dc:for-each>
432 </dc:context> 394 </dc:context>
433 </heightmarks> 395 </heightmarks>
434 </dc:call-macro> 396 </dc:call-macro>
435 </dc:macro> 397 </dc:macro>
436 398
441 <dc:statement> 403 <dc:statement>
442 SELECT id AS prot_id, 404 SELECT id AS prot_id,
443 description AS prot_description 405 description AS prot_description
444 FROM wsts WHERE kind = 4 AND river_id = ${river_id} 406 FROM wsts WHERE kind = 4 AND river_id = ${river_id}
445 </dc:statement> 407 </dc:statement>
446 <dc:elements> 408 <dc:for-each>
447 <heightmark> 409 <heightmark name="{$prot_description}"><dc:context>
448 <dc:attribute name="name" value="${prot_description}"/>
449 <dc:context>
450 <dc:call-macro name="SQL-wst_columns_statement"/> 410 <dc:call-macro name="SQL-wst_columns_statement"/>
451 <dc:elements> 411 <dc:for-each>
452 <column> 412 <column name="{$prot_column_name}"
453 <dc:attribute name="name" value="${prot_column_name}"/> 413 ids="heightmarks_annotations-wstv-{$prot_rel_pos}-{$prot_id}"
454 <dc:attribute name="ids" value="heightmarks_annotations-wstv-${prot_rel_pos}-${prot_id}"/> 414 factory="wqinterpol"
455 <dc:attribute name="factory" value="wqinterpol"/> 415 info="{$info} [km {$deffrom} - {$defto}]"/>
456 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 416 </dc:for-each>
457 </column>
458 </dc:elements>
459 </dc:context> 417 </dc:context>
460 </heightmark> 418 </heightmark>
461 </dc:elements> 419 </dc:for-each>
462 </dc:context> 420 </dc:context>
463 </heightmarks> 421 </heightmarks>
464 </dc:call-macro> 422 </dc:call-macro>
465 </dc:macro> 423 </dc:macro>
466 424
467 <dc:macro name="basedata_5_flood-protections_relative_points"> 425 <dc:macro name="basedata_5_flood-protections_relative_points">
468 <dc:call-macro name="user-range"> 426 <dc:call-macro name="user-range">
469 <flood_protections> 427 <flood_protections id="flood-protections-{$river_id}">
470 <dc:attribute name="id" value="flood-protections-${river_id}"/>
471 <dc:context connection="system"> 428 <dc:context connection="system">
472 <dc:statement> 429 <dc:statement>
473 SELECT id AS prot_id, 430 SELECT id AS prot_id,
474 description AS prot_description 431 description AS prot_description
475 FROM wsts WHERE kind = 5 AND river_id = ${river_id} 432 FROM wsts WHERE kind = 5 AND river_id = ${river_id}
476 </dc:statement> 433 </dc:statement>
477 <dc:elements> 434 <dc:for-each>
478 <relativepoint> 435 <relativepoint name="{$prot_description}"
479 <dc:attribute name="name" value="${prot_description}"/> 436 db-id="{$prot_id}"
480 <dc:attribute name="db-id" value="${prot_id}"/> 437 factory="staticwkms">
481 <dc:attribute name="factory" value="staticwkms"/> 438 <columns>
482 <columns>
483 <dc:context> 439 <dc:context>
484 <dc:call-macro name="SQL-wst_columns_statement"/> 440 <dc:call-macro name="SQL-wst_columns_statement"/>
485 <dc:elements> 441 <dc:for-each>
486 <column> 442 <column name="{$prot_column_name}"
487 <dc:attribute name="name" value="${prot_column_name}"/> 443 ids="flood_protection-wstv-{$prot_rel_pos}-{$prot_id}"
488 <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/> 444 factory="staticwkms"
489 <dc:attribute name="factory" value="staticwkms"/> 445 info="{$info} [km {$deffrom} - {$defto}]"/>
490 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 446 </dc:for-each>
491 </column>
492 </dc:elements>
493 </dc:context> 447 </dc:context>
494 </columns> 448 </columns>
495 </relativepoint> 449 </relativepoint>
496 </dc:elements> 450 </dc:for-each>
497 </dc:context> 451 </dc:context></flood_protections>
498 </flood_protections>
499 </dc:call-macro> 452 </dc:call-macro>
500 </dc:macro> 453 </dc:macro>
501 454
502 <dc:macro name="basedata_5_flood-protections"> 455 <dc:macro name="basedata_5_flood-protections">
503 <dc:call-macro name="user-range"> 456 <dc:call-macro name="user-range">
504 <flood_protections> 457 <flood_protections id="flood-protections-{$river_id}">
505 <dc:attribute name="id" value="flood-protections-${river_id}"/>
506 <dc:context connection="system"> 458 <dc:context connection="system">
507 <dc:statement> 459 <dc:statement>
508 SELECT id AS prot_id, 460 SELECT id AS prot_id,
509 description AS prot_description 461 description AS prot_description
510 FROM wsts WHERE kind = 5 AND river_id = ${river_id} 462 FROM wsts WHERE kind = 5 AND river_id = ${river_id}
511 </dc:statement> 463 </dc:statement>
512 <dc:elements> 464 <dc:for-each>
513 <flood_protection> 465 <flood_protection name="{$prot_description}"
514 <dc:attribute name="name" value="${prot_description}"/> 466 db-id="{$prot_id}"
515 <dc:attribute name="db-id" value="${prot_id}"/> 467 factory="staticwkms">
516 <dc:attribute name="factory" value="staticwkms"/>
517 <dc:context> 468 <dc:context>
518 <dc:call-macro name="SQL-wst_columns_statement"/> 469 <dc:call-macro name="SQL-wst_columns_statement"/>
519 <dc:elements> 470 <dc:for-each>
520 <column> 471 <column name="{$prot_column_name}"
521 <dc:attribute name="name" value="${prot_column_name}"/> 472 ids="flood_protection-wstv-{$prot_rel_pos}-{$prot_id}"
522 <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/> 473 factory="staticwkms"
523 <dc:attribute name="factory" value="staticwkms"/> 474 info="{$info} [km {$deffrom} - {$defto}]"/>
524 <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/> 475 </dc:for-each>
525 </column>
526 </dc:elements>
527 </dc:context> 476 </dc:context>
528 </flood_protection> 477 </flood_protection>
529 </dc:elements> 478 </dc:for-each>
530 </dc:context> 479 </dc:context>
531 </flood_protections> 480 </flood_protections>
532 </dc:call-macro> 481 </dc:call-macro>
533 </dc:macro> 482 </dc:macro>
534 483
535 <dc:macro name="mainvalues"> 484 <dc:macro name="mainvalues">
536 <mainvalue> 485 <mainvalue factory="mainvalue" ids="{$river_id}"/>
537 <dc:attribute name="factory" value="mainvalue"/> 486 <wmainvalue factory="mainvalue" ids="{$river_id}:w"/>
538 <dc:attribute name="ids" value="${river_id}"/> 487 <qmainvalue factory="mainvalue" ids="{$river_id}:q"/>
539 </mainvalue>
540 <wmainvalue>
541 <dc:attribute name="factory" value="mainvalue"/>
542 <dc:attribute name="ids" value="${river_id}:w"/>
543 </wmainvalue>
544 <qmainvalue>
545 <dc:attribute name="factory" value="mainvalue"/>
546 <dc:attribute name="ids" value="${river_id}:q"/>
547 </qmainvalue>
548 </dc:macro> 488 </dc:macro>
549 489
550 <dc:macro name="qsectors"> 490 <dc:macro name="qsectors">
551 <qsector> 491 <qsector factory="qsectors" ids="{$river_id}"/>
552 <dc:attribute name="factory" value="qsectors"/>
553 <dc:attribute name="ids" value="${river_id}"/>
554 </qsector>
555 </dc:macro> 492 </dc:macro>
556 493
557 <dc:macro name="annotations"> 494 <dc:macro name="annotations">
558 <annotation> 495 <annotation factory="annotations" ids="{$river_id}"/>
559 <dc:attribute name="factory" value="annotations"/>
560 <dc:attribute name="ids" value="${river_id}"/>
561 </annotation>
562 </dc:macro> 496 </dc:macro>
563 497
564 <dc:macro name="annotations_per_type"> 498 <dc:macro name="annotations_per_type">
565 <annotations> 499 <annotations>
566 <dc:context> 500 <dc:context>
567 <annotation> 501 <annotation name="all_annotations" factory="annotations" ids="{$river_id}"/>
568 <dc:attribute name="name" value="all_annotations"/>
569 <dc:attribute name="factory" value="annotations"/>
570 <dc:attribute name="ids" value="${river_id}"/>
571 </annotation>
572 <dc:statement> 502 <dc:statement>
573 SELECT id AS anno_id, 503 SELECT id AS anno_id,
574 name AS anno_description 504 name AS anno_description
575 FROM annotation_types 505 FROM annotation_types
576 </dc:statement> 506 </dc:statement>
577 <dc:elements> 507 <dc:for-each>
578 <annotation> 508 <annotation name="{$anno_description}"
579 <dc:attribute name="name" value="${anno_description}"/> 509 factory="annotations"
580 <dc:attribute name="factory" value="annotations"/> 510 ids="{$river_id}:{$anno_description}"/>
581 <dc:attribute name="ids" value="${river_id}:${anno_description}"/> 511 </dc:for-each>
582 </annotation>
583 </dc:elements>
584 </dc:context> 512 </dc:context>
585 </annotations> 513 </annotations>
586 </dc:macro> 514 </dc:macro>
587 515
588 <dc:macro name="cross_sections"> 516 <dc:macro name="cross_sections">
589 <dc:call-macro name="user-range"> 517 <dc:call-macro name="user-range">
590 <cross_sections> 518 <cross_sections id="flood-protections-{$river_id}">
591 <dc:attribute name="id" value="flood-protections-${river_id}"/>
592 <dc:context connection="system"> 519 <dc:context connection="system">
593 <dc:statement> 520 <dc:statement>
594 SELECT DISTINCT 521 SELECT DISTINCT
595 cs.id AS prot_id, 522 cs.id AS prot_id,
596 cs.description AS prot_description 523 cs.description AS prot_description
597 FROM cross_sections cs 524 FROM cross_sections cs
598 JOIN cross_section_lines csl ON csl.cross_section_id = cs.id 525 JOIN cross_section_lines csl ON csl.cross_section_id = cs.id
599 WHERE cs.river_id = ${river_id} 526 WHERE cs.river_id = ${river_id}
600 AND csl.km BETWEEN ${fromkm} AND ${tokm} 527 AND csl.km BETWEEN ${fromkm} AND ${tokm}
601 </dc:statement> 528 </dc:statement>
602 <dc:elements> 529 <dc:for-each>
603 <cross_section> 530 <cross_section name="{$prot_description}"
604 <dc:attribute name="name" value="${prot_description}"/> 531 ids="{$prot_id}"
605 <dc:attribute name="ids" value="${prot_id}"/> 532 factory="crosssections"/>
606 <dc:attribute name="factory" value="crosssections"/> 533 </dc:for-each>
607 </cross_section>
608 </dc:elements>
609 </dc:context> 534 </dc:context>
610 </cross_sections> 535 </cross_sections>
611 </dc:call-macro> 536 </dc:call-macro>
612 </dc:macro> 537 </dc:macro>
613 538
614 <dc:macro name="hyks"> 539 <dc:macro name="hyks">
615 <dc:call-macro name="user-range"> 540 <dc:call-macro name="user-range">
616 <hyks> 541 <hyks id="hyk-{$river_id}">
617 <dc:attribute name="id" value="hyk-${river_id}"/>
618 <dc:context connection="system"> 542 <dc:context connection="system">
619 <dc:statement> 543 <dc:statement>
620 SELECT DISTINCT 544 SELECT DISTINCT
621 h.id AS hyk_id, 545 h.id AS hyk_id,
622 h.description AS hyk_description 546 h.description AS hyk_description
623 FROM hyks h 547 FROM hyks h
624 JOIN hyk_entries he ON he.hyk_id = h.id 548 JOIN hyk_entries he ON he.hyk_id = h.id
625 WHERE river_id = ${river_id} 549 WHERE river_id = ${river_id}
626 AND he.km BETWEEN ${fromkm} AND ${tokm} 550 AND he.km BETWEEN ${fromkm} AND ${tokm}
627 </dc:statement> 551 </dc:statement>
628 <dc:elements> 552 <dc:for-each>
629 <hyk> 553 <hyk name="{$hyk_description}" ids="{$hyk_id}" factory="hyk"/>
630 <dc:attribute name="name" value="${hyk_description}"/> 554 </dc:for-each>
631 <dc:attribute name="ids" value="${hyk_id}"/> 555 </dc:context></hyks>
632 <dc:attribute name="factory" value="hyk"/>
633 </hyk>
634 </dc:elements>
635 </dc:context>
636 </hyks>
637 </dc:call-macro> 556 </dc:call-macro>
638 </dc:macro> 557 </dc:macro>
639 558
640 <dc:macro name="flow_velocity_measurements"> 559 <dc:macro name="flow_velocity_measurements">
641 <dc:call-macro name="user-range"> 560 <dc:call-macro name="user-range">
642 <flowvelocitymeasurement> 561 <flowvelocitymeasurement>
643 <dc:context connection="system"> 562 <dc:context connection="system">
644 <dc:statement> 563 <dc:statement>
645 SELECT id AS fvmid, 564 SELECT id AS fvmid,
646 description AS fvmd 565 description AS fvmd
647 FROM flow_velocity_measurements WHERE river_id = ${river_id} 566 FROM flow_velocity_measurements WHERE river_id = ${river_id}
648 </dc:statement> 567 </dc:statement>
649 <dc:elements> 568 <dc:for-each>
650 <flow_velocity_measurement> 569 <flow_velocity_measurement name="{$fvmd}"
651 <dc:attribute name="name" value="${fvmd}"/> 570 ids="{$fvmid}"
652 <dc:attribute name="ids" value="${fvmid}"/> 571 factory="flowvelocity">
653 <dc:attribute name="factory" value="flowvelocity"/>
654 <dc:context> 572 <dc:context>
655 <dc:statement> 573 <dc:statement>
656 SELECT id, description, station, datetime, v, w, q 574 SELECT id, description, station, datetime, v, w, q
657 FROM flow_velocity_measure_values 575 FROM flow_velocity_measure_values
658 WHERE measurements_id = ${fvmid} 576 WHERE measurements_id = ${fvmid}
659 AND station BETWEEN ${fromkm} AND ${tokm} 577 AND station BETWEEN ${fromkm} AND ${tokm}
660 </dc:statement> 578 </dc:statement>
661 <dc:elements> 579 <dc:for-each>
662 <measurement_value> 580 <measurement_value name="{$id}-{$description}-{$station}-{$datetime}"
663 <dc:attribute name="name" value="${id}-${description}-${station}-${datetime}"/> 581 ids="{$id}"
664 <dc:attribute name="ids" value="${id}"/> 582 factory="flowvelocity"/>
665 <dc:attribute name="factory" value="flowvelocity"/> 583 </dc:for-each>
666 </measurement_value>
667 </dc:elements>
668 </dc:context> 584 </dc:context>
669 </flow_velocity_measurement> 585 </flow_velocity_measurement>
670 </dc:elements> 586 </dc:for-each>
671 </dc:context> 587 </dc:context>
672 </flowvelocitymeasurement> 588 </flowvelocitymeasurement>
673 </dc:call-macro> 589 </dc:call-macro>
674 </dc:macro> 590 </dc:macro>
675 591
676 <dc:macro name="sounding-width"> 592 <dc:macro name="sounding-width">
677 <soundings_width> 593 <soundings_width>
678 <dc:context> 594 <dc:context>
680 SELECT id AS bedh_id, 596 SELECT id AS bedh_id,
681 year AS bedh_year, 597 year AS bedh_year,
682 description AS bedh_descr 598 description AS bedh_descr
683 FROM bed_height_single WHERE river_id = ${river_id} 599 FROM bed_height_single WHERE river_id = ${river_id}
684 </dc:statement> 600 </dc:statement>
685 <dc:elements> 601 <dc:for-each>
686 <height> 602 <height factory="bedheight"
687 <dc:attribute name="factory" value="bedheight"/> 603 ids="bedheight-singlevalues-{$bedh_id}-{$bedh_year}"
688 <dc:attribute name="ids" value="bedheight-singlevalues-${bedh_id}-${bedh_year}"/> 604 description="{$bedh_descr}"/>
689 <dc:attribute name="description" value="${bedh_descr}"/> 605 </dc:for-each>
690 </height>
691 </dc:elements>
692 </dc:context> 606 </dc:context>
693 </soundings_width> 607 </soundings_width>
694 </dc:macro> 608 </dc:macro>
695 609
696 <dc:macro name="longitudinal-section-prototype"> 610 <dc:macro name="longitudinal-section-prototype">
822 </dc:if> 736 </dc:if>
823 <dc:comment comment="--- non-recommendations---"/> 737 <dc:comment comment="--- non-recommendations---"/>
824 </dc:otherwise> 738 </dc:otherwise>
825 </dc:choose> 739 </dc:choose>
826 740
827
828 <dc:if test="dc:contains($artifact-outs, 'waterlevels')"> 741 <dc:if test="dc:contains($artifact-outs, 'waterlevels')">
829 742
830 <!-- base data --> 743 <!-- base data -->
831 <dc:call-macro name="basedata_0"/> 744 <dc:call-macro name="basedata_0"/>
832 745
841 754
842 <!-- flood protection --> 755 <!-- flood protection -->
843 <dc:call-macro name="basedata_5_flood-protections"/> 756 <dc:call-macro name="basedata_5_flood-protections"/>
844 757
845 </dc:if> 758 </dc:if>
846 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and (dc:contains($parameters, 'recommended'))"> 759
847 <!--dc:call-macro name="basedata_2_fixations_wst"/--> 760 <dc:comment><!-- XXX: Why is this taken out?
848 </dc:if> 761 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and (dc:contains($parameters, 'recommended'))">
762 <dc:call-macro name="basedata_2_fixations_wst"/>
763 </dc:if>
764 -->
765 </dc:comment>
849 766
850 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and not (dc:contains($parameters, 'recommended'))"> 767 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and not (dc:contains($parameters, 'recommended'))">
851 <discharge_table_nn> 768 <discharge_table_nn>
852 <discharge_table_gauge> 769 <discharge_table_gauge>
853 <dc:context> 770 <dc:context>
854 <dc:statement> 771 <dc:statement>
855 SELECT id AS gauge_id, 772 SELECT id AS gauge_id,
856 name AS gauge_name 773 name AS gauge_name
857 FROM gauges WHERE river_id = ${river_id} 774 FROM gauges WHERE river_id = ${river_id}
858 </dc:statement> 775 </dc:statement>
859 <dc:elements> 776 <dc:for-each>
860 <gauge> 777 <gauge name="{$gauge_name}"
861 <dc:attribute name="name" value="${gauge_name}"/> 778 db-id="{$gauge_id}"
862 <dc:attribute name="db-id" value="${gauge_id}"/> 779 factory="gaugedischarge"
863 <dc:attribute name="factory" value="gaugedischarge"/> 780 from="{$g_start}"
864 <dc:attribute name="from" value="${g_start}"/> 781 to="{$g_stop}"
865 <dc:attribute name="to" value="${g_stop}"/> 782 ids="{$gauge_name}"/>
866 <dc:attribute name="ids" value="${gauge_name}"/> 783 <dc:comment>
867 </gauge>
868 <!-- 784 <!--
869 <gauge> 785 <gauge>
870 <dc:attribute name="name" value="${gauge_name}"/> 786 <dc:attribute name="name" value="${gauge_name}"/>
871 <dc:attribute name="db-id" value="${gauge_id}"/> 787 <dc:attribute name="db-id" value="${gauge_id}"/>
872 <dc:context> 788 <dc:context>
877 ti.stop_time AS g_stop 793 ti.stop_time AS g_stop
878 FROM discharge_tables d JOIN time_intervals ti 794 FROM discharge_tables d JOIN time_intervals ti
879 ON d.time_interval_id = ti.id 795 ON d.time_interval_id = ti.id
880 WHERE d.gauge_id = ${gauge_id} AND d.kind = 1 796 WHERE d.gauge_id = ${gauge_id} AND d.kind = 1
881 </dc:statement> 797 </dc:statement>
882 <dc:elements> 798 <dc:for-each>
883 <historical> 799 <historical>
884 <dc:attribute name="name" value="${gauge_desc}"/> 800 <dc:attribute name="name" value="${gauge_desc}"/>
885 <dc:attribute name="factory" value="gaugedischarge"/> 801 <dc:attribute name="factory" value="gaugedischarge"/>
886 <dc:attribute name="from" value="${g_start}"/> 802 <dc:attribute name="from" value="${g_start}"/>
887 <dc:attribute name="to" value="${g_stop}"/> 803 <dc:attribute name="to" value="${g_stop}"/>
888 <dc:attribute name="ids" value="${discharge_id}-${g_start}-${g_stop}"/> 804 <dc:attribute name="ids" value="${discharge_id}-${g_start}-${g_stop}"/>
889 </historical> 805 </historical>
890 </dc:elements> 806 </dc:for-each>
891 </dc:context> 807 </dc:context>
892 </gauge> 808 </gauge>
893 --> 809 -->
894 </dc:elements> 810 </dc:comment>
895 </dc:context> 811 </dc:for-each>
896 </discharge_table_gauge> 812 </dc:context>
897 813 </discharge_table_gauge>
898 </discharge_table_nn> 814 </discharge_table_nn>
899 815
900 <dc:call-macro name="basedata_2_fixations_wst"/> 816 <dc:call-macro name="basedata_2_fixations_wst"/>
901 817
902 <dc:call-macro name="basedata_5_flood-protections"/> 818 <dc:call-macro name="basedata_5_flood-protections"/>
903 819
912 <dc:call-macro name="mainvalues"/> 828 <dc:call-macro name="mainvalues"/>
913 </computed_discharge_curve> 829 </computed_discharge_curve>
914 </dc:if> 830 </dc:if>
915 831
916 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve') and not (dc:contains($parameters, 'recommended'))"> 832 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve') and not (dc:contains($parameters, 'recommended'))">
917 <discharge_table_nn> 833 <discharge_table_nn>
918 <discharge_table_gauge> 834 <discharge_table_gauge>
835 <dc:context>
836 <dc:statement>
837 SELECT id AS gauge_id,
838 name AS gauge_name
839 FROM gauges WHERE river_id = ${river_id}
840 </dc:statement>
841 <dc:for-each>
842 <gauge name="{$gauge_name}"
843 db-id="{$gauge_id}"
844 factory="gaugedischarge"
845 from="{$g_start}"
846 to="{$g_stop}"
847 ids="{$gauge_name}"/>
848 </dc:for-each>
849 </dc:context>
850 </discharge_table_gauge>
851 </discharge_table_nn>
852 </dc:if>
853
854 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'floodmap-hws')">
855 <floodmap>
856 <dc:choose>
857 <dc:when test="dc:contains($parameters, 'recommended')">
858 <dc:call-macro name="flood-map-recommended"/>
859 </dc:when>
860 <dc:when test="dc:contains($parameters, 'dem')">
861 <dc:call-macro name="flood-map-dem"/>
862 </dc:when>
863 <dc:otherwise>
864 <dc:call-macro name="flood-map-complete"/>
865 </dc:otherwise>
866 </dc:choose>
867 </floodmap>
868
869 <dc:if test="dc:contains($parameters, 'hws')">
870 <hws>
871 <dc:call-macro name="flood-map-hws-lines"/>
872 <dc:call-macro name="flood-map-hws-points"/>
873 </hws>
874 </dc:if>
875
876 <dc:macro name="flood-map-recommended">
877 <dc:comment>
878 FIXME: Following two macros look identical to me.
879 </dc:comment>
880 <kilometrage>
881 <riveraxis factory="riveraxis" ids="{$river_id}"/>
882 </kilometrage>
883 <rastermap>
884 <background factory="wmsbackground" ids="{$river_id}"/>
885 </rastermap>
886 </dc:macro>
887
888 <dc:macro name="flood-map-dem">
889 <dems>
890 <dc:context>
891 <dc:statement>
892 SELECT d.id AS dem_id,
893 r.a AS dem_lower,
894 r.b AS dem_upper,
895 d.name AS name,
896 d.projection || ' | ' || t.start_time || ' - ' || t.stop_time AS info
897 FROM dem d
898 JOIN ranges r ON d.range_id = r.id
899 JOIN time_intervals t ON d.time_interval_id = t.id
900 WHERE d.river_id = ${river_id}
901 </dc:statement>
902 <dc:for-each>
903 <dem factory="demfactory" ids="{$dem_id}" name="{$name}" info="{$info}"/>
904 </dc:for-each>
905 </dc:context>
906 </dems>
907 </dc:macro>
908
909 <dc:macro name="filter_hws_ddg">
910 <dc:macro name="durchlass_damm_graben">
911 <dc:macro name="ddg_factory">
912 <dc:for-each>
913 <hws factory="hwsfactory" name="{$hws_name}"/>
914 </dc:for-each>
915 </dc:macro>
916
917 <dc:filter expr="$kws_kind=1">
918 <dc:if test="dc:has-result()">
919 <Durchlass><dc:call-macro name="ddg_factory"/></Durchlass>
920 </dc:if>
921 </dc:filter>
922
923 <dc:filter expr="$kws_kind=2">
924 <dc:if test="dc:has-result()">
925 <Damm><dc:call-macro name="ddg_factory"/></Damm>
926 </dc:if>
927 </dc:filter>
928
929 <dc:filter expr="$kws_kind=3">
930 <dc:if test="dc:has-result()">
931 <Graben><dc:call-macro name="ddg_factory"/></Graben>
932 </dc:if>
933 </dc:filter>
934 </dc:macro>
935
936 <dc:filter expr="$hws_official=1">
937 <dc:if test="dc:has-result()">
938 <official>
939 <dc:call-macro name="durchlass_damm_graben"/>
940 </official>
941 </dc:if>
942 </dc:filter>
943
944 <dc:filter expr="$hws_official=0">
945 <dc:if test="dc:has-result()">
946 <inofficial>
947 <dc:call-macro name="durchlass_damm_graben"/>
948 </inofficial>
949 </dc:if>
950 </dc:filter>
951 </dc:macro>
952
953 <dc:macro name="flood-map-hws-lines">
954 <dc:context>
955 <dc:statement>
956 SELECT DISTINCT
957 name AS hws_name,
958 official AS hws_official,
959 kind_id AS hws_kind
960 FROM hws_lines
961 WHERE river_id = ${river_id}
962 </dc:statement>
963 <dc:if test="dc:has-result()">
964 <lines>
965 <dc:call-macro name="filter_hws_ddg"/>
966 </lines>
967 </dc:if>
968 </dc:context>
969 </dc:macro>
970
971 <dc:macro name="flood-map-hws-points">
972 <dc:context>
973 <dc:statement>
974 SELECT DISTINCT
975 name AS hws_name,
976 official AS hws_official,
977 kind_id AS hws_kind
978 FROM hws_points
979 WHERE river_id = ${river_id}
980 </dc:statement>
981 <dc:if test="dc:has-result()">
982 <points>
983 <dc:call-macro name="filter_hws_ddg"/>
984 </points>
985 </dc:if>
986 </dc:context>
987 </dc:macro>
988
989 <dc:macro name="flood-map-km">
990 <dc:context>
991 <dc:statement>
992 SELECT count(*) AS km_exists
993 FROM river_axes_km WHERE river_id = ${river_id}
994 </dc:statement>
995 <dc:for-each>
996 <dc:if test="$km_exists&gt;0">
997 <kilometrage factory="wmskmfactory" ids="{$river_id}"/>
998 </dc:if>
999 </dc:for-each>
1000 </dc:context>
1001 </dc:macro>
1002
1003 <dc:macro name="flood-map-qps">
1004 <dc:context>
1005 <dc:comment>Grab only the actual first</dc:comment>
1006 <dc:statement>
1007 SELECT DISTINCT
1008 cs.kind_id AS kind_id,
1009 ck.name AS kind_name
1010 FROM cross_section_tracks cs
1011 JOIN cross_section_track_kinds ck on cs.kind_id = ck.id
1012 WHERE river_id = ${river_id}
1013 AND kind_id=1
1014 </dc:statement>
1015 <dc:if test="dc:has-result()">
1016 <dc:for-each>
1017 <actual description="{$kind_name}"
1018 factory="wmsqpsfactory"
1019 ids="{$river_id};{$kind_name};{$kind_id}"/>
1020 </dc:for-each>
1021 </dc:if>
1022 </dc:context>
1023 <dc:context>
1024 <dc:comment>Now the other tracks</dc:comment>
1025 <dc:statement>
1026 SELECT DISTINCT
1027 cs.kind_id AS kind_id,
1028 ck.name AS kind_name,
1029 cs.name AS layer_name
1030 FROM cross_section_tracks cs
1031 JOIN cross_section_track_kinds ck on cs.kind_id = ck.id
1032 WHERE river_id = ${river_id}
1033 AND kind_id=0
1034 </dc:statement>
1035 <dc:if test="dc:has-result()">
1036 <other>
1037 <dc:for-each>
1038 <misc-qps description="{$layer_name}"
1039 factory="wmsqpsfactory"
1040 ids="{$river_id};{$layer_name};{$kind_id}"/>
1041 </dc:for-each>
1042 </other>
1043 </dc:if>
1044 </dc:context>
1045 </dc:macro>
1046
1047 <dc:macro name="flood-map-riveraxis">
1048 <dc:context>
1049 <dc:statement>
1050 SELECT DISTINCT
1051 ax.kind_id AS kind_id,
1052 ak.name AS kind_name
1053 FROM river_axes ax
1054 JOIN axis_kinds ak on ax.kind_id = ak.id
1055 WHERE river_id = ${river_id}
1056 AND kind_id=1
1057 </dc:statement>
1058 <dc:if test="dc:has-result()">
1059 <dc:for-each>
1060 <actual description="{$kind_name}"
1061 ids="{$river_id};{$kind_name};{$kind_id}"
1062 factory="riveraxis"/>
1063 </dc:for-each>
1064 </dc:if>
1065 </dc:context>
1066 <dc:context>
1067 <dc:statement>
1068 SELECT DISTINCT
1069 ak.name AS kind_name,
1070 ax.kind_id AS kind_id,
1071 ax.name AS layer_name
1072 FROM river_axes ax
1073 JOIN axis_kinds ak on ax.kind_id = ak.id
1074 WHERE river_id = ${river_id}
1075 AND kind_id &lt;&gt; 1
1076 </dc:statement>
1077 <dc:if test="dc:has-result()">
1078 <other>
1079 <dc:for-each>
1080 <misc-axis description="{$layer_name}"
1081 ids="{$river_id};{$layer_name};{$kind_id}"
1082 factory="riveraxis"/>
1083 </dc:for-each>
1084 </other>
1085 </dc:if>
1086 </dc:context>
1087 </dc:macro>
1088
1089 <dc:macro name="flood-map-hydr-boundaries-state">
1090 <dc:context>
1091 <dc:statement>
1092 SELECT DISTINCT
1093 name
1094 FROM hydr_boundaries
1095 WHERE river_id = ${river_id}
1096 AND kind = 2
1097 </dc:statement>
1098 <dc:for-each>
1099 <line factory="wmshydrboundariesfactory"
1100 ids="{$river_id};{$name};2"
1101 name="{$name}"/>
1102 </dc:for-each>
1103 </dc:context>
1104 <dc:context>
1105 <dc:statement>
1106 SELECT DISTINCT
1107 name
1108 FROM hydr_boundaries_poly
1109 WHERE river_id = ${river_id}
1110 AND kind = 2
1111 </dc:statement>
1112 <dc:for-each>
1113 <line factory="wmshydrboundariespolyfactory"
1114 ids="{$river_id};{$name};2"
1115 name="{$name}"/>
1116 </dc:for-each>
1117 </dc:context>
1118 </dc:macro>
1119
1120 <dc:macro name="flood-map-hydr-boundaries-lines">
1121 <dc:context>
1122 <dc:statement>
1123 SELECT DISTINCT
1124 name
1125 FROM hydr_boundaries
1126 WHERE river_id = ${river_id}
1127 AND kind = 1
1128 </dc:statement>
1129 <dc:comment> What about all other line kinds?</dc:comment>
1130 <dc:if test="dc:has-result()">
1131 <lines>
1132 <dc:for-each>
1133 <line factory="wmshydrboundariesfactory"
1134 ids="{$river_id};{$name};1"
1135 name="{$name}"/>
1136 </dc:for-each>
1137 </lines>
1138 </dc:if>
1139 </dc:context>
1140 </dc:macro>
1141
1142 <dc:macro name="flood-map-hydr-boundaries-poly">
1143 <dc:context>
1144 <dc:statement>
1145 SELECT DISTINCT
1146 b.sectie AS sectie_id,
1147 sk.name AS sectie
1148 FROM hydr_boundaries_poly b
1149 JOIN sectie_kinds sk ON b.sectie = sk.id
1150 WHERE b.river_id = ${river_id}
1151 AND b.kind = 1
1152 </dc:statement>
1153 <dc:if test="dc:has-result()">
1154 <sobek_areas>
1155 <dc:for-each>
1156 <boundary name="{$sectie}"
1157 factory="wmshydrboundariespolyfactory"
1158 ids="{$river_id};{$sectie};1;{$sectie_id};-1"/>
1159 </dc:for-each>
1160 </sobek_areas>
1161 </dc:if>
1162 </dc:context>
1163 <dc:context>
1164 <dc:statement>
1165 SELECT DISTINCT
1166 b.sobek AS sobek_id,
1167 sk.name AS sobek
1168 FROM hydr_boundaries_poly b
1169 JOIN sobek_kinds sk ON b.sobek = sk.id
1170 WHERE b.river_id = ${river_id}
1171 AND b.kind = 1
1172 </dc:statement>
1173 <dc:if test="dc:has-result()">
1174 <sobek_flooded>
1175 <dc:for-each>
1176 <boundary name="{$sobek}"
1177 factory="wmshydrboundariespolyfactory"
1178 ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/>
1179 </dc:for-each>
1180 </sobek_flooded>
1181 </dc:if>
1182 </dc:context>
1183 </dc:macro>
1184
1185 <dc:macro name="flood-map-hydr-boundaries">
1186 <bfg_model>
1187 <areas>
1188 <dc:call-macro name="flood-map-hydr-boundaries-poly"/>
1189 </areas>
1190 <dc:call-macro name="flood-map-hydr-boundaries-lines"/>
1191 </bfg_model>
1192 <federal>
1193 <dc:call-macro name="flood-map-hydr-boundaries-state"/>
1194 </federal>
1195 </dc:macro>
1196
1197 <dc:macro name="flood-map-floodplain">
1198 <dc:context>
1199 <dc:statement>
1200 SELECT DISTINCT
1201 fp.kind_id AS kind_id,
1202 flk.name AS kind_name
1203 FROM floodplain fp
1204 JOIN floodplain_kinds flk on fp.kind_id = flk.id
1205 WHERE river_id = ${river_id}
1206 AND kind_id=1
1207 </dc:statement>
1208 <dc:if test="dc:has-result()">
1209 <dc:for-each>
1210 <floody factory="wmsfloodplainfactory"
1211 description="{$kind_name}"
1212 ids="{$river_id};{$kind_name};{$kind_id}"/>
1213 </dc:for-each>
1214 </dc:if>
1215 </dc:context>
1216 <dc:context>
1217 <dc:statement>
1218 SELECT DISTINCT
1219 flk.name AS kind_name,
1220 fp.kind_id AS kind_id,
1221 fp.name AS layer_name
1222 FROM floodplain fp
1223 JOIN floodplain_kinds flk on fp.kind_id = flk.id
1224 WHERE river_id = ${river_id}
1225 AND kind_id &lt;&gt; 1
1226 </dc:statement>
1227 <dc:if test="dc:has-result()">
1228 <other>
1229 <dc:for-each>
1230 <floody factory="wmsfloodplainfactory"
1231 description="{$layer_name}"
1232 ids="{$river_id};{$layer_name};{$kind_id}"/>
1233 </dc:for-each>
1234 </other>
1235 </dc:if>
1236 </dc:context>
1237 </dc:macro>
1238
1239 <dc:macro name="hwslines_by_kind">
1240 <dc:comment>
1241 Call from a context where fed_name hws_kind hws_name and river_id is
1242 availble
1243 </dc:comment>
1244
1245 <dc:macro name="hwslines_by_kind_factory">
1246 <dc:for-each>
1247 <hws factory="wmshwslinesfactory"
1248 ids="{$river_id};{$hws_name}"
1249 name="{$hws_name}"/>
1250 </dc:for-each>
1251 </dc:macro>
1252
1253 <dc:filter expr="$hws_kind=1">
1254 <dc:if test="dc:has-result()">
1255 <Durchlass>
1256 <dc:call-macro name="hwslines_by_kind_factory"/>
1257 </Durchlass>
1258 </dc:if>
1259 </dc:filter>
1260
1261 <dc:filter expr="$hws_kind=2">
1262 <dc:if test="dc:has-result()">
1263 <Damm>
1264 <dc:call-macro name="hwslines_by_kind_factory"/>
1265 </Damm>
1266 </dc:if>
1267 </dc:filter>
1268
1269 <dc:filter expr="$hws_kind=3">
1270 <dc:if test="dc:has-result()">
1271 <Graben>
1272 <dc:call-macro name="hwslines_by_kind_factory"/>
1273 </Graben>
1274 </dc:if>
1275 </dc:filter>
1276 </dc:macro>
1277
1278 <dc:macro name="hwslines">
1279 <hws_lines>
1280 <official>
919 <dc:context> 1281 <dc:context>
920 <dc:statement> 1282 <dc:statement>
921 SELECT id AS gauge_id, 1283 SELECT DISTINCT
922 name AS gauge_name 1284 fs.name AS fed_name,
923 FROM gauges WHERE river_id = ${river_id} 1285 fs.id AS fed_id
1286 FROM hws_lines hws
1287 JOIN fed_states fs ON hws.fed_state_id = fs.id
1288 WHERE river_id = ${river_id}
1289 AND hws.official=1
924 </dc:statement> 1290 </dc:statement>
925 <dc:elements> 1291 <dc:for-each>
926 <gauge> 1292 <dc:context>
927 <dc:attribute name="name" value="${gauge_name}"/> 1293 <dc:statement>
928 <dc:attribute name="db-id" value="${gauge_id}"/> 1294 SELECT DISTINCT
929 <dc:attribute name="factory" value="gaugedischarge"/> 1295 name AS hws_name,
930 <dc:attribute name="from" value="${g_start}"/> 1296 kind_id AS hws_kind
931 <dc:attribute name="to" value="${g_stop}"/> 1297 FROM hws_lines
932 <dc:attribute name="ids" value="${gauge_name}"/> 1298 WHERE river_id = ${river_id}
933 </gauge> 1299 AND official=1
934 </dc:elements> 1300 AND fed_state_id = ${fed_id} ORDER BY name
1301 </dc:statement>
1302 <fedstate description="{$fed_name}">
1303 <dc:call-macro name="hwslines_by_kind"/>
1304 </fedstate>
1305 </dc:context>
1306 </dc:for-each>
935 </dc:context> 1307 </dc:context>
936 </discharge_table_gauge>
937 </discharge_table_nn>
938 </dc:if>
939
940 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'floodmap-hws')">
941 <floodmap>
942 <dc:choose>
943 <dc:when test="dc:contains($parameters, 'recommended')">
944 <dc:call-macro name="flood-map-recommended"/>
945 </dc:when>
946 <dc:when test="dc:contains($parameters, 'dem')">
947 <dc:call-macro name="flood-map-dem"/>
948 </dc:when>
949 <dc:otherwise>
950 <dc:call-macro name="flood-map-complete"/>
951 </dc:otherwise>
952 </dc:choose>
953 </floodmap>
954 <dc:if test="dc:contains($parameters, 'hws')">
955 <hws>
956 <dc:call-macro name="flood-map-hws-lines" />
957 <dc:call-macro name="flood-map-hws-points" />
958 </hws>
959 </dc:if>
960
961 <dc:macro name="flood-map-recommended">
962 <dc:comment>
963 FIXME: Following two macros look identical to me.
964 </dc:comment>
965 <kilometrage>
966 <riveraxis>
967 <dc:attribute name="factory" value="riveraxis"/>
968 <dc:attribute name="ids" value="${river_id}"/>
969 </riveraxis>
970 </kilometrage>
971 <rastermap>
972 <background>
973 <dc:attribute name="factory" value="wmsbackground"/>
974 <dc:attribute name="ids" value="${river_id}"/>
975 </background>
976 </rastermap>
977 </dc:macro>
978 <dc:macro name="flood-map-dem">
979 <dems>
980 <dc:context> 1308 <dc:context>
981 <dc:statement> 1309 <dc:statement>
982 SELECT d.id AS dem_id, 1310 SELECT distinct
983 r.a AS dem_lower, 1311 name AS hws_name,
984 r.b AS dem_upper, 1312 kind_id AS hws_kind
985 d.name AS name, 1313 FROM hws_lines
986 d.projection || ' | ' || t.start_time || ' - ' || t.stop_time AS info 1314 WHERE river_id = ${river_id}
987 FROM dem d 1315 AND official=1
988 JOIN ranges r ON d.range_id = r.id 1316 AND fed_state_id IS NULL
989 JOIN time_intervals t ON d.time_interval_id = t.id 1317 ORDER BY name
990 WHERE d.river_id = ${river_id}
991 </dc:statement> 1318 </dc:statement>
992 <dc:elements> 1319 <hws_fed_unknown>
993 <dem> 1320 <dc:call-macro name="hwslines_by_kind"/>
994 <dc:attribute name="factory" value="demfactory"/> 1321 </hws_fed_unknown>
995 <dc:attribute name="ids" value="${dem_id}"/>
996 <dc:attribute name="name" value="${name}"/>
997 <dc:attribute name="info" value="${info}"/>
998 </dem>
999 </dc:elements>
1000 </dc:context> 1322 </dc:context>
1001 </dems> 1323 </official>
1002 </dc:macro> 1324 <inofficial>
1003 <dc:macro name="flood-map-hws-lines">
1004 <dc:context>
1005 <dc:statement>
1006 SELECT DISTINCT
1007 name AS hws_name,
1008 official AS hws_official,
1009 kind_id AS hws_kind
1010 FROM hws_lines
1011 WHERE river_id = ${river_id}
1012 </dc:statement>
1013 <lines>
1014 <official>
1015 <Durchlass>
1016 <dc:elements filter="$hws_kind=1 and $hws_official=1">
1017 <hws>
1018 <dc:attribute name="factory" value="hwsfactory"/>
1019 <dc:attribute name="name" value="${hws_name}"/>
1020 </hws>
1021 </dc:elements>
1022 </Durchlass>
1023 <Damm>
1024 <dc:elements filter="$hws_kind=2 and $hws_official=1">
1025 <hws>
1026 <dc:attribute name="factory" value="hwsfactory"/>
1027 <dc:attribute name="name" value="${hws_name}"/>
1028 </hws>
1029 </dc:elements>
1030 </Damm>
1031 <Graben>
1032 <dc:elements filter="$hws_kind=3 and $hws_official=1">
1033 <hws>
1034 <dc:attribute name="factory" value="hwsfactory"/>
1035 <dc:attribute name="name" value="${hws_name}"/>
1036 </hws>
1037 </dc:elements>
1038 </Graben>
1039 </official>
1040 <inofficial>
1041 <Durchlass>
1042 <dc:elements filter="$hws_kind=1 and $hws_official=0">
1043 <hws>
1044 <dc:attribute name="factory" value="hwsfactory"/>
1045 <dc:attribute name="name" value="${hws_name}"/>
1046 </hws>
1047 </dc:elements>
1048 </Durchlass>
1049 <Damm>
1050 <dc:elements filter="$hws_kind=2 and $hws_official=0">
1051 <hws>
1052 <dc:attribute name="factory" value="hwsfactory"/>
1053 <dc:attribute name="name" value="${hws_name}"/>
1054 </hws>
1055 </dc:elements>
1056 </Damm>
1057 <Graben>
1058 <dc:elements filter="$hws_kind=3 and $hws_official=0">
1059 <hws>
1060 <dc:attribute name="factory" value="hwsfactory"/>
1061 <dc:attribute name="name" value="${hws_name}"/>
1062 </hws>
1063 </dc:elements>
1064 </Graben>
1065 </inofficial>
1066 </lines>
1067 </dc:context>
1068 </dc:macro>
1069 <dc:macro name="flood-map-hws-points">
1070 <dc:context>
1071 <dc:statement>
1072 SELECT DISTINCT
1073 name AS hws_points_name,
1074 official AS hws_points_official,
1075 kind_id AS hws_points_kind
1076 FROM hws_points
1077 WHERE river_id = ${river_id}
1078 </dc:statement>
1079 <points>
1080 <official>
1081 <Durchlass>
1082 <dc:elements filter="$hws_points_kind=1 and $hws_points_official=1">
1083 <hws>
1084 <dc:attribute name="factory" value="hwsfactory"/>
1085 <dc:attribute name="name" value="${hws_points_name}"/>
1086 </hws>
1087 </dc:elements>
1088 </Durchlass>
1089 <Damm>
1090 <dc:elements filter="$hws_points_kind=2 and $hws_points_official=1">
1091 <hws>
1092 <dc:attribute name="factory" value="hwsfactory"/>
1093 <dc:attribute name="name" value="${hws_points_name}"/>
1094 </hws>
1095 </dc:elements>
1096 </Damm>
1097 <Graben>
1098 <dc:elements filter="$hws_kind=3 and $hws_official=1">
1099 <hws>
1100 <dc:attribute name="factory" value="hwsfactory"/>
1101 <dc:attribute name="name" value="${hws_points_name}"/>
1102 </hws>
1103 </dc:elements>
1104 </Graben>
1105 </official>
1106 <inofficial>
1107 <Durchlass>
1108 <dc:elements filter="$hws_points_kind=1 and $hws_points_official=0">
1109 <hws>
1110 <dc:attribute name="factory" value="hwsfactory"/>
1111 <dc:attribute name="name" value="${hws_points_name}"/>
1112 </hws>
1113 </dc:elements>
1114 </Durchlass>
1115 <Damm>
1116 <dc:elements filter="$hws_points_kind=2 and $hws_points_official=0">
1117 <hws>
1118 <dc:attribute name="factory" value="hwsfactory"/>
1119 <dc:attribute name="name" value="${hws_points_name}"/>
1120 </hws>
1121 </dc:elements>
1122 </Damm>
1123 <Graben>
1124 <dc:elements filter="$hws_points_kind=3 and $hws_points_official=0">
1125 <hws>
1126 <dc:attribute name="factory" value="hwsfactory"/>
1127 <dc:attribute name="name" value="${hws_points_name}"/>
1128 </hws>
1129 </dc:elements>
1130 </Graben>
1131 </inofficial>
1132 </points>
1133 </dc:context>
1134 </dc:macro>
1135 <dc:macro name="flood-map-km">
1136 <dc:context>
1137 <dc:statement>
1138 SELECT count(*) as km_exists
1139 FROM river_axes_km WHERE river_id = ${river_id}
1140 </dc:statement>
1141 <dc:elements>
1142 <dc:if test="$km_exists>0">
1143 <kilometrage>
1144 <dc:attribute name="factory" value="wmskmfactory"/>
1145 <dc:attribute name="ids" value="${river_id}"/>
1146 </kilometrage>
1147 </dc:if>
1148 </dc:elements>
1149 </dc:context>
1150 </dc:macro>
1151 <dc:macro name="flood-map-qps">
1152 <dc:context>
1153 <dc:comment>Grab only the actual first</dc:comment>
1154 <dc:statement>
1155 SELECT DISTINCT
1156 cs.kind_id as kind_id,
1157 ck.name as kind_name
1158 FROM cross_section_tracks cs
1159 JOIN cross_section_track_kinds ck on cs.kind_id = ck.id
1160 WHERE river_id = ${river_id}
1161 AND kind_id=1
1162 </dc:statement>
1163 <dc:if test="dc:has-result()">
1164 <dc:elements>
1165 <actual>
1166 <dc:attribute name="description" value="${kind_name}"/>
1167 <dc:attribute name="factory" value="wmsqpsfactory"/>
1168 <dc:attribute name="ids" value="${river_id};${kind_name};${kind_id}"/>
1169 </actual>
1170 </dc:elements>
1171 </dc:if>
1172 </dc:context>
1173 <dc:context>
1174 <dc:comment>Now the other tracks</dc:comment>
1175 <dc:statement>
1176 SELECT DISTINCT
1177 cs.kind_id as kind_id,
1178 ck.name as kind_name,
1179 cs.name as layer_name
1180 FROM cross_section_tracks cs
1181 JOIN cross_section_track_kinds ck on cs.kind_id = ck.id
1182 WHERE river_id = ${river_id}
1183 AND kind_id=0
1184 </dc:statement>
1185 <dc:if test="dc:has-result()">
1186 <other>
1187 <dc:elements>
1188 <misc-qps>
1189 <dc:attribute name="description" value="${layer_name}"/>
1190 <dc:attribute name="factory" value="wmsqpsfactory"/>
1191 <dc:attribute name="ids" value="${river_id};${layer_name};${kind_id}"/>
1192 </misc-qps>
1193 </dc:elements>
1194 </other>
1195 </dc:if>
1196 </dc:context>
1197 </dc:macro>
1198 <dc:macro name="flood-map-riveraxis">
1199 <dc:context>
1200 <dc:statement>
1201 SELECT DISTINCT
1202 ax.kind_id as kind_id,
1203 ak.name as kind_name
1204 FROM river_axes ax
1205 JOIN axis_kinds ak on ax.kind_id = ak.id
1206 WHERE river_id = ${river_id}
1207 AND kind_id=1
1208 </dc:statement>
1209 <dc:if test="dc:has-result()">
1210 <dc:elements>
1211 <actual factory="riveraxis">
1212 <dc:attribute name="description" value="${kind_name}"/>
1213 <dc:attribute name="ids" value="${river_id};${kind_name};${kind_id}"/>
1214 </actual>
1215 </dc:elements>
1216 </dc:if>
1217 </dc:context>
1218 <dc:context>
1219 <dc:statement>
1220 SELECT DISTINCT
1221 ak.name as kind_name,
1222 ax.kind_id as kind_id,
1223 ax.name as layer_name
1224 FROM river_axes ax
1225 JOIN axis_kinds ak on ax.kind_id = ak.id
1226 WHERE river_id = ${river_id}
1227 AND kind_id &lt;&gt; 1
1228 </dc:statement>
1229 <dc:if test="dc:has-result()">
1230 <other>
1231 <dc:elements>
1232 <misc-axis factory="riveraxis">
1233 <dc:attribute name="description" value="${layer_name}"/>
1234 <dc:attribute name="ids" value="${river_id};${layer_name};${kind_id}"/>
1235 </misc-axis>
1236 </dc:elements>
1237 </other>
1238 </dc:if>
1239 </dc:context>
1240 </dc:macro>
1241 <dc:macro name="flood-map-hydr-boundaries">
1242 <hydr_boundaries_lines>
1243 <dc:call-macro name="flood-map-hydr-boundaries-lines"/>
1244 </hydr_boundaries_lines>
1245 <hydr_boundaries_polygons>
1246 <dc:call-macro name="flood-map-hydr-boundaries-poly"/>
1247 </hydr_boundaries_polygons>
1248 </dc:macro>
1249 <dc:macro name="flood-map-hydr-boundaries-lines">
1250 <bfg>
1251 <dc:context> 1325 <dc:context>
1252 <dc:statement> 1326 <dc:statement>
1253 SELECT count(*) as km_exists, name as name 1327 SELECT DISTINCT
1254 FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 1 GROUP BY name 1328 fs.name AS fed_name,
1329 fs.id AS fed_id
1330 FROM hws_lines hws
1331 JOIN fed_states fs ON hws.fed_state_id = fs.id
1332 WHERE river_id = ${river_id}
1333 AND hws.official=0
1255 </dc:statement> 1334 </dc:statement>
1256 <dc:elements> 1335 <dc:for-each>
1257 <dc:if test="$km_exists>0"> 1336 <dc:context>
1258 <hydrboundary> 1337 <dc:statement>
1259 <dc:attribute name="factory" value="wmshydrboundariesfactory"/> 1338 SELECT DISTINCT
1260 <dc:attribute name="ids" value="${river_id};${name}"/> 1339 name AS hws_name,
1261 <dc:attribute name="name" value="${name}"/> 1340 kind_id AS hws_kind
1262 </hydrboundary> 1341 FROM hws_lines
1263 </dc:if> 1342 WHERE river_id = ${river_id}
1264 </dc:elements> 1343 AND official=0
1344 AND fed_state_id = ${fed_id} ORDER BY name
1345 </dc:statement>
1346 <fedstate description="{$fed_name}">
1347 <dc:call-macro name="hwslines_by_kind"/>
1348 </fedstate>
1349 </dc:context>
1350 </dc:for-each>
1265 </dc:context> 1351 </dc:context>
1266 </bfg>
1267 <land>
1268 <dc:context> 1352 <dc:context>
1269 <dc:statement> 1353 <dc:statement>
1270 SELECT count(*) as km_exists, name as name 1354 SELECT distinct
1271 FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 2 GROUP BY name 1355 name AS hws_name,
1356 kind_id AS hws_kind
1357 FROM hws_lines
1358 WHERE river_id = ${river_id}
1359 AND official=0
1360 AND fed_state_id IS NULL ORDER BY name
1272 </dc:statement> 1361 </dc:statement>
1273 <dc:elements> 1362 <hws_fed_unknown>
1274 <dc:if test="$km_exists>0"> 1363 <dc:call-macro name="hwslines_by_kind"/>
1275 <hydrboundary> 1364 </hws_fed_unknown>
1276 <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
1277 <dc:attribute name="ids" value="${river_id};${name}"/>
1278 <dc:attribute name="name" value="${name}"/>
1279 </hydrboundary>
1280 </dc:if>
1281 </dc:elements>
1282 </dc:context> 1365 </dc:context>
1283 </land> 1366 </inofficial>
1367 </hws_lines>
1368 </dc:macro>
1369
1370 <dc:macro name="hwspoints_by_kind">
1371 <dc:comment>
1372 Call from a context where fed_name hws_kind hws_name and river_id is
1373 availble
1374 </dc:comment>
1375
1376 <dc:macro name="hwspoints_by_kind_factory">
1377 <dc:for-each>
1378 <hws factory="wmshwspointsfactory"
1379 ids="{$river_id};{$hws_name}"
1380 name="{$hws_name}"/>
1381 </dc:for-each>
1284 </dc:macro> 1382 </dc:macro>
1285 <dc:macro name="flood-map-hydr-boundaries-poly"> 1383
1286 <bfg> 1384 <dc:filter expr="$hws_kind=1">
1385 <dc:if test="dc:has-result()">
1386 <Durchlass>
1387 <dc:call-macro name="hwspoints_by_kind_factory"/>
1388 </Durchlass>
1389 </dc:if>
1390 </dc:filter>
1391
1392 <dc:filter expr="$hws_kind=2">
1393 <dc:if test="dc:has-result()">
1394 <Damm>
1395 <dc:call-macro name="hwspoints_by_kind_factory"/>
1396 </Damm>
1397 </dc:if>
1398 </dc:filter>
1399
1400 <dc:filter expr="$hws_kind=3">
1401 <dc:if test="dc:has-result()">
1402 <Graben>
1403 <dc:call-macro name="hwspoints_by_kind_factory"/>
1404 </Graben>
1405 </dc:if>
1406 </dc:filter>
1407 </dc:macro>
1408
1409 <dc:macro name="hwspoints">
1410 <hws_points>
1411 <official>
1287 <dc:context> 1412 <dc:context>
1288 <dc:statement> 1413 <dc:statement>
1289 SELECT count(*) as km_exists, name as name 1414 SELECT DISTINCT
1290 FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 1 GROUP BY name 1415 fs.name AS fed_name,
1416 fs.id AS fed_id
1417 FROM hws_points hws
1418 JOIN fed_states fs ON hws.fed_state_id = fs.id
1419 WHERE river_id = ${river_id}
1420 AND hws.official=1
1291 </dc:statement> 1421 </dc:statement>
1292 <dc:elements> 1422 <dc:for-each>
1293 <dc:if test="$km_exists>0"> 1423 <dc:context>
1294 <hws> 1424 <dc:statement>
1295 <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/> 1425 SELECT DISTINCT
1296 <dc:attribute name="ids" value="${river_id};${name}"/> 1426 name AS hws_name,
1297 <dc:attribute name="name" value="${name}"/> 1427 kind_id AS hws_kind
1298 </hws> 1428 FROM hws_points
1299 </dc:if> 1429 WHERE river_id = ${river_id}
1300 </dc:elements> 1430 AND official=1
1431 AND fed_state_id = ${fed_id} ORDER BY name
1432 </dc:statement>
1433 <fedstate description="{$fed_name}">
1434 <dc:call-macro name="hwspoints_by_kind"/>
1435 </fedstate>
1436 </dc:context>
1437 </dc:for-each>
1301 </dc:context> 1438 </dc:context>
1302 </bfg>
1303 <land>
1304 <dc:context> 1439 <dc:context>
1305 <dc:statement> 1440 <dc:statement>
1306 SELECT count(*) as km_exists, name as name 1441 SELECT distinct
1307 FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 2 GROUP BY name 1442 name AS hws_name,
1443 kind_id AS hws_kind
1444 FROM hws_points
1445 WHERE river_id = ${river_id}
1446 AND official=1
1447 AND fed_state_id IS NULL
1448 ORDER BY name
1308 </dc:statement> 1449 </dc:statement>
1309 <dc:elements> 1450 <hws_fed_unknown>
1310 <dc:if test="$km_exists>0"> 1451 <dc:call-macro name="hwspoints_by_kind"/>
1311 <hws> 1452 </hws_fed_unknown>
1312 <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
1313 <dc:attribute name="ids" value="${river_id};${name}"/>
1314 <dc:attribute name="name" value="${name}"/>
1315 </hws>
1316 </dc:if>
1317 </dc:elements>
1318 </dc:context> 1453 </dc:context>
1319 </land> 1454 </official>
1320 </dc:macro> 1455 <inofficial>
1321 <dc:macro name="flood-map-floodplain"> 1456 <dc:context>
1322 <dc:context> 1457 <dc:statement>
1323 <dc:statement> 1458 SELECT DISTINCT
1324 SELECT count(*) as km_exists 1459 fs.name AS fed_name,
1325 FROM floodplain WHERE river_id = ${river_id} 1460 fs.id AS fed_id
1326 </dc:statement> 1461 FROM hws_points hws
1327 <dc:elements> 1462 JOIN fed_states fs ON hws.fed_state_id = fs.id
1328 <dc:if test="$km_exists>0"> 1463 WHERE river_id = ${river_id}
1329 <floodplain> 1464 AND hws.official=0
1330 <dc:attribute name="factory" value="wmsfloodplainfactory"/> 1465 </dc:statement>
1331 <dc:attribute name="ids" value="${river_id}"/> 1466 <dc:for-each>
1332 </floodplain> 1467 <dc:context>
1333 </dc:if> 1468 <dc:statement>
1334 </dc:elements> 1469 SELECT DISTINCT
1335 </dc:context> 1470 name AS hws_name,
1336 </dc:macro> 1471 kind_id AS hws_kind
1337 1472 FROM hws_points
1338 <dc:macro name="hwslines_by_kind"> 1473 WHERE river_id = ${river_id}
1339 <dc:comment> 1474 AND official=0
1340 Call from a context where fed_name hws_kind hws_name and river_id is 1475 AND fed_state_id = ${fed_id} ORDER BY name
1341 availble 1476 </dc:statement>
1342 </dc:comment> 1477 <fedstate description="{$fed_name}">
1343 <Durchlass> 1478 <dc:call-macro name="hwspoints_by_kind"/>
1344 <dc:elements filter="$hws_kind=1"> 1479 </fedstate>
1345 <hws> 1480 </dc:context>
1346 <dc:attribute name="factory" value="wmshwslinesfactory"/> 1481 </dc:for-each>
1347 <dc:attribute name="ids" value="${river_id};${hws_name}"/> 1482 </dc:context>
1348 <dc:attribute name="name" value="${hws_name}"/> 1483 <dc:context>
1349 </hws> 1484 <dc:statement>
1350 </dc:elements> 1485 SELECT distinct
1351 </Durchlass> 1486 name AS hws_name,
1352 <Damm> 1487 kind_id AS hws_kind
1353 <dc:elements filter="$hws_kind=2"> 1488 FROM hws_points
1354 <hws> 1489 WHERE river_id = ${river_id}
1355 <dc:attribute name="factory" value="wmshwslinesfactory"/> 1490 AND official=0
1356 <dc:attribute name="ids" value="${river_id};${hws_name}"/> 1491 AND fed_state_id IS NULL ORDER BY name
1357 <dc:attribute name="name" value="${hws_name}"/> 1492 </dc:statement>
1358 </hws> 1493 <hws_fed_unknown>
1359 </dc:elements> 1494 <dc:call-macro name="hwspoints_by_kind"/>
1360 </Damm> 1495 </hws_fed_unknown>
1361 <Graben> 1496 </dc:context>
1362 <dc:elements filter="$hws_kind=3"> 1497 </inofficial>
1363 <hws>
1364 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1365 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1366 <dc:attribute name="name" value="${hws_name}"/>
1367 </hws>
1368 </dc:elements>
1369 </Graben>
1370 </dc:macro>
1371
1372 <dc:macro name="hwslines">
1373 <hws_lines>
1374 <official>
1375 <dc:context>
1376 <dc:statement>
1377 SELECT DISTINCT
1378 fs.name AS fed_name,
1379 fs.id AS fed_id
1380 FROM hws_lines hws
1381 JOIN fed_states fs ON hws.fed_state_id = fs.id
1382 WHERE river_id = ${river_id}
1383 AND hws.official=1
1384 </dc:statement>
1385 <dc:elements>
1386 <dc:context>
1387 <dc:statement>
1388 SELECT DISTINCT
1389 name AS hws_name,
1390 kind_id AS hws_kind
1391 FROM hws_lines
1392 WHERE river_id = ${river_id}
1393 AND official=1
1394 AND fed_state_id = ${fed_id} ORDER BY name
1395 </dc:statement>
1396 <fedstate>
1397 <dc:attribute name="description" value="${fed_name}"/>
1398 <dc:call-macro name="hwslines_by_kind"/>
1399 </fedstate>
1400 </dc:context>
1401 </dc:elements>
1402 </dc:context>
1403 <dc:context>
1404 <dc:statement>
1405 SELECT distinct
1406 name AS hws_name,
1407 kind_id AS hws_kind
1408 FROM hws_lines
1409 WHERE river_id = ${river_id}
1410 AND official=1
1411 AND fed_state_id IS NULL
1412 ORDER BY name
1413 </dc:statement>
1414 <hws_fed_unknown>
1415 <dc:call-macro name="hwslines_by_kind"/>
1416 </hws_fed_unknown>
1417 </dc:context>
1418 </official>
1419 <inofficial>
1420 <dc:context>
1421 <dc:statement>
1422 SELECT DISTINCT
1423 fs.name AS fed_name,
1424 fs.id AS fed_id
1425 FROM hws_lines hws
1426 JOIN fed_states fs ON hws.fed_state_id = fs.id
1427 WHERE river_id = ${river_id}
1428 AND hws.official=0
1429 </dc:statement>
1430 <dc:elements>
1431 <dc:context>
1432 <dc:statement>
1433 SELECT DISTINCT
1434 name AS hws_name,
1435 kind_id AS hws_kind
1436 FROM hws_lines
1437 WHERE river_id = ${river_id}
1438 AND official=0
1439 AND fed_state_id = ${fed_id} ORDER BY name
1440 </dc:statement>
1441 <fedstate>
1442 <dc:attribute name="description" value="${fed_name}"/>
1443 <dc:call-macro name="hwslines_by_kind"/>
1444 </fedstate>
1445 </dc:context>
1446 </dc:elements>
1447 </dc:context>
1448 <dc:context>
1449 <dc:statement>
1450 SELECT distinct
1451 name AS hws_name,
1452 kind_id AS hws_kind
1453 FROM hws_lines
1454 WHERE river_id = ${river_id}
1455 AND official=0
1456 AND fed_state_id IS NULL ORDER BY name
1457 </dc:statement>
1458 <hws_fed_unknown>
1459 <dc:call-macro name="hwslines_by_kind"/>
1460 </hws_fed_unknown>
1461 </dc:context>
1462 </inofficial>
1463 </hws_lines>
1464 </dc:macro>
1465
1466 <dc:macro name="hwspoints_by_kind">
1467 <dc:comment>
1468 Call from a context where fed_name hws_kind hws_name and river_id is
1469 availble
1470 </dc:comment>
1471 <Durchlass>
1472 <dc:elements filter="$hws_kind=1">
1473 <hws>
1474 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1475 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1476 <dc:attribute name="name" value="${hws_name}"/>
1477 </hws>
1478 </dc:elements>
1479 </Durchlass>
1480 <Damm>
1481 <dc:elements filter="$hws_kind=2">
1482 <hws>
1483 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1484 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1485 <dc:attribute name="name" value="${hws_name}"/>
1486 </hws>
1487 </dc:elements>
1488 </Damm>
1489 <Graben>
1490 <dc:elements filter="$hws_kind=3">
1491 <hws>
1492 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1493 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1494 <dc:attribute name="name" value="${hws_name}"/>
1495 </hws>
1496 </dc:elements>
1497 </Graben>
1498 </dc:macro>
1499
1500 <dc:macro name="hwspoints">
1501 <hws_points>
1502 <official>
1503 <dc:context>
1504 <dc:statement>
1505 SELECT DISTINCT
1506 fs.name AS fed_name,
1507 fs.id AS fed_id
1508 FROM hws_points hws
1509 JOIN fed_states fs ON hws.fed_state_id = fs.id
1510 WHERE river_id = ${river_id}
1511 AND hws.official=1
1512 </dc:statement>
1513 <dc:elements>
1514 <dc:context>
1515 <dc:statement>
1516 SELECT DISTINCT
1517 name AS hws_name,
1518 kind_id AS hws_kind
1519 FROM hws_points
1520 WHERE river_id = ${river_id}
1521 AND official=1
1522 AND fed_state_id = ${fed_id} ORDER BY name
1523 </dc:statement>
1524 <fedstate>
1525 <dc:attribute name="description" value="${fed_name}"/>
1526 <dc:call-macro name="hwspoints_by_kind"/>
1527 </fedstate>
1528 </dc:context>
1529 </dc:elements>
1530 </dc:context>
1531 <dc:context>
1532 <dc:statement>
1533 SELECT distinct
1534 name AS hws_name,
1535 kind_id AS hws_kind
1536 FROM hws_points
1537 WHERE river_id = ${river_id}
1538 AND official=1
1539 AND fed_state_id IS NULL
1540 ORDER BY name
1541 </dc:statement>
1542 <hws_fed_unknown>
1543 <dc:call-macro name="hwspoints_by_kind"/>
1544 </hws_fed_unknown>
1545 </dc:context>
1546 </official>
1547 <inofficial>
1548 <dc:context>
1549 <dc:statement>
1550 SELECT DISTINCT
1551 fs.name AS fed_name,
1552 fs.id AS fed_id
1553 FROM hws_points hws
1554 JOIN fed_states fs ON hws.fed_state_id = fs.id
1555 WHERE river_id = ${river_id}
1556 AND hws.official=0
1557 </dc:statement>
1558 <dc:elements>
1559 <dc:context>
1560 <dc:statement>
1561 SELECT DISTINCT
1562 name AS hws_name,
1563 kind_id AS hws_kind
1564 FROM hws_points
1565 WHERE river_id = ${river_id}
1566 AND official=0
1567 AND fed_state_id = ${fed_id} ORDER BY name
1568 </dc:statement>
1569 <fedstate>
1570 <dc:attribute name="description" value="${fed_name}"/>
1571 <dc:call-macro name="hwspoints_by_kind"/>
1572 </fedstate>
1573 </dc:context>
1574 </dc:elements>
1575 </dc:context>
1576 <dc:context>
1577 <dc:statement>
1578 SELECT distinct
1579 name AS hws_name,
1580 kind_id AS hws_kind
1581 FROM hws_points
1582 WHERE river_id = ${river_id}
1583 AND official=0
1584 AND fed_state_id IS NULL ORDER BY name
1585 </dc:statement>
1586 <hws_fed_unknown>
1587 <dc:call-macro name="hwspoints_by_kind"/>
1588 </hws_fed_unknown>
1589 </dc:context>
1590 </inofficial>
1591 </hws_points> 1498 </hws_points>
1592 </dc:macro> 1499 </dc:macro>
1593 1500
1594 <dc:macro name="flood-map-buildings"> 1501 <dc:macro name="flood-map-buildings">
1595 <dc:context> 1502 <dc:context>
1600 FROM buildings b 1507 FROM buildings b
1601 JOIN building_kinds bk ON b.kind_id = bk.id 1508 JOIN building_kinds bk ON b.kind_id = bk.id
1602 WHERE b.river_id = ${river_id} 1509 WHERE b.river_id = ${river_id}
1603 AND b.kind_id &lt;&gt; 0 1510 AND b.kind_id &lt;&gt; 0
1604 </dc:statement> 1511 </dc:statement>
1605 <dc:elements> 1512 <dc:for-each>
1606 <buildings> 1513 <buildings description="{$building_kind}"
1607 <dc:attribute name="description" value="${building_kind}"/> 1514 factory="wmsbuildingsfactory"
1608 <dc:attribute name="factory" value="wmsbuildingsfactory"/> 1515 ids="{$river_id};{$building_kind};{$building_kind_id}"/>
1609 <dc:attribute name="ids" value="${river_id};${building_kind};${building_kind_id}"/> 1516 </dc:for-each>
1610 </buildings>
1611 </dc:elements>
1612 </dc:context> 1517 </dc:context>
1613 <dc:context> 1518 <dc:context>
1614 <dc:statement> 1519 <dc:statement>
1615 SELECT DISTINCT 1520 SELECT DISTINCT
1616 b.kind_id AS building_kind_id, 1521 b.kind_id AS building_kind_id,
1620 JOIN building_kinds bk ON b.kind_id = bk.id 1525 JOIN building_kinds bk ON b.kind_id = bk.id
1621 WHERE river_id = ${river_id} 1526 WHERE river_id = ${river_id}
1622 AND kind_id = 0 OR 1527 AND kind_id = 0 OR
1623 kind_id IS NULL 1528 kind_id IS NULL
1624 </dc:statement> 1529 </dc:statement>
1625 <dc:elements> 1530 <dc:for-each>
1626 <dc:element name="${building_kind}"> 1531 <dc:element name="${building_kind}">
1627 <dc:elements> 1532 <dc:for-each>
1628 <buildings> 1533 <buildings description="{$building_name}"
1629 <dc:attribute name="description" value="${building_name}"/> 1534 factory="wmsbuildingsfactory"
1630 <dc:attribute name="factory" value="wmsbuildingsfactory"/> 1535 ids="{$river_id};{$building_name}"/>
1631 <dc:attribute name="ids" value="${river_id};${building_name}"/> 1536 </dc:for-each>
1632 </buildings>
1633 </dc:elements>
1634 </dc:element> 1537 </dc:element>
1635 </dc:elements> 1538 </dc:for-each>
1636 </dc:context> 1539 </dc:context>
1637 <dc:context> 1540 <dc:context>
1638 <dc:statement> 1541 <dc:statement>
1639 SELECT DISTINCT 1542 SELECT DISTINCT
1640 j.kind_id AS jetty_kind_id, 1543 j.kind_id AS jetty_kind_id,
1643 JOIN jetty_kinds jk ON j.kind_id = jk.id 1546 JOIN jetty_kinds jk ON j.kind_id = jk.id
1644 WHERE river_id = ${river_id} 1547 WHERE river_id = ${river_id}
1645 </dc:statement> 1548 </dc:statement>
1646 <dc:if test="dc:has-result()"> 1549 <dc:if test="dc:has-result()">
1647 <jetties> 1550 <jetties>
1648 <dc:elements> 1551 <dc:for-each>
1649 <jetty> 1552 <jetty description="{$jetty_kind}"
1650 <dc:attribute name="description" value="${jetty_kind}"/> 1553 factory="wmsjettiesfactory"
1651 <dc:attribute name="factory" value="wmsjettiesfactory"/> 1554 ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/>
1652 <dc:attribute name="ids" value="${river_id};${jetty_kind};${jetty_kind_id}"/> 1555 </dc:for-each>
1653 </jetty>
1654 </dc:elements>
1655 </jetties> 1556 </jetties>
1656 </dc:if> 1557 </dc:if>
1657 </dc:context> 1558 </dc:context>
1658 </dc:macro> 1559 </dc:macro>
1659 <dc:macro name="flood-map-fixpoints"> 1560
1660 <dc:context> 1561 <dc:macro name="flood-map-fixpoints">
1661 <dc:statement> 1562 <dc:context>
1662 SELECT count(*) as km_exists, name as name 1563 <dc:statement>
1663 FROM fixpoints WHERE river_id = ${river_id} GROUP BY name 1564 SELECT count(*) AS km_exists, name AS name
1664 </dc:statement> 1565 FROM fixpoints WHERE river_id = ${river_id} GROUP BY name
1665 <dc:elements> 1566 </dc:statement>
1666 <dc:if test="$km_exists>0"> 1567 <dc:for-each>
1667 <fixpoint> 1568 <dc:if test="$km_exists&gt;0">
1668 <dc:attribute name="factory" value="wmsfixpointsfactory"/> 1569 <fixpoint factory="wmsfixpointsfactory"
1669 <dc:attribute name="ids" value="${river_id};${name}"/> 1570 ids="{$river_id};{$name}"
1670 <dc:attribute name="name" value="${name}"/> 1571 name="{$name}"/>
1671 </fixpoint> 1572 </dc:if>
1672 </dc:if> 1573 </dc:for-each>
1673 </dc:elements> 1574 </dc:context>
1674 </dc:context> 1575 </dc:macro>
1675 </dc:macro> 1576
1676 <dc:macro name="flood-map-gaugelocations"> 1577 <dc:macro name="flood-map-gaugelocations">
1677 <dc:context> 1578 <dc:attribute name="factory" value="externalwmsfactory"/>
1678 <dc:statement> 1579 <dc:attribute name="ids" value="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelonline-Pegelpunkte"/>
1679 SELECT count(*) as km_exists, name as name 1580 </dc:macro>
1680 FROM gauge_location WHERE river_id = ${river_id} GROUP BY name 1581
1681 </dc:statement> 1582 <dc:macro name="flood-map-uesk">
1682 <dc:elements> 1583 <uesk>
1683 <dc:if test="$km_exists>0"> 1584 <calculations>
1684 <gaugelocation> 1585 <current>
1685 <dc:attribute name="factory" value="wmsgaugelocationfactory"/> 1586 <bfg>
1686 <dc:attribute name="ids" value="${river_id};${name}"/> 1587 <dc:context>
1687 <dc:attribute name="name" value="${name}"/> 1588 <dc:statement>
1688 </gaugelocation> 1589 SELECT count(*) AS uesg_exist, name AS name
1689 </dc:if> 1590 FROM floodmaps
1690 </dc:elements> 1591 WHERE river_id = ${river_id} AND kind = 111
1691 </dc:context> 1592 GROUP BY name, kind
1692 </dc:macro> 1593 </dc:statement>
1693 <dc:macro name="flood-map-uesk"> 1594 <dc:for-each>
1694 <uesk> 1595 <dc:if test="$uesg_exist&gt;0">
1695 <calculations> 1596 <floodmaps factory="wmsfloodmapsfactory"
1696 <current> 1597 ids="{$river_id};{$name}"
1697 <bfg> 1598 name="{$name}"/>
1698 <dc:context> 1599 </dc:if>
1699 <dc:statement> 1600 </dc:for-each>
1700 SELECT count(*) as uesg_exist, name as name 1601 </dc:context>
1701 FROM floodmaps 1602 </bfg>
1702 WHERE river_id = ${river_id} AND kind = 111 1603 <land>
1703 GROUP BY name, kind 1604 <dc:context>
1704 </dc:statement> 1605 <dc:statement>
1705 <dc:elements> 1606 SELECT count(*) AS uesg_exist, name AS name
1706 <dc:if test="$uesg_exist>0"> 1607 FROM floodmaps
1707 <floodmaps> 1608 WHERE river_id = ${river_id} AND kind = 112
1708 <dc:attribute name="factory" value="wmsfloodmapsfactory"/> 1609 GROUP BY name, kind
1709 <dc:attribute name="ids" value="${river_id};${name}"/> 1610 </dc:statement>
1710 <dc:attribute name="name" value="${name}"/> 1611 <dc:for-each>
1711 </floodmaps> 1612 <dc:if test="$uesg_exist&gt;0">
1712 </dc:if> 1613 <floodmaps factory="wmsfloodmapsfactory"
1713 </dc:elements> 1614 ids="{$river_id};{$name}"
1714 </dc:context> 1615 name="{$name}"/>
1715 </bfg> 1616 </dc:if>
1716 <land> 1617 </dc:for-each>
1717 <dc:context> 1618 </dc:context>
1718 <dc:statement> 1619 </land>
1719 SELECT count(*) as uesg_exist, name as name 1620 </current>
1720 FROM floodmaps 1621 <potentiel>
1721 WHERE river_id = ${river_id} AND kind = 112 1622 <bfg>
1722 GROUP BY name, kind 1623 <dc:context>
1723 </dc:statement> 1624 <dc:statement>
1724 <dc:elements> 1625 SELECT count(*) AS uesg_exist, name AS name
1725 <dc:if test="$uesg_exist>0"> 1626 FROM floodmaps
1726 <floodmaps> 1627 WHERE river_id = ${river_id} AND kind = 121
1727 <dc:attribute name="factory" value="wmsfloodmapsfactory"/> 1628 GROUP BY name, kind
1728 <dc:attribute name="ids" value="${river_id};${name}"/> 1629 </dc:statement>
1729 <dc:attribute name="name" value="${name}"/> 1630 <dc:for-each>
1730 </floodmaps> 1631 <dc:if test="$uesg_exist&gt;0">
1731 </dc:if> 1632 <floodmaps factory="wmsfloodmapsfactory"
1732 </dc:elements> 1633 ids="{$river_id};{$name}"
1733 </dc:context> 1634 name="{$name}"/>
1734 </land> 1635 </dc:if>
1735 </current> 1636 </dc:for-each>
1736 <potentiel> 1637 </dc:context>
1737 <bfg> 1638 </bfg>
1738 <dc:context> 1639 <land>
1739 <dc:statement> 1640 <dc:context>
1740 SELECT count(*) as uesg_exist, name as name 1641 <dc:statement>
1741 FROM floodmaps 1642 SELECT count(*) AS uesg_exist, name AS name
1742 WHERE river_id = ${river_id} AND kind = 121 1643 FROM floodmaps
1743 GROUP BY name, kind 1644 WHERE river_id = ${river_id} AND kind = 122
1744 </dc:statement> 1645 GROUP BY name, kind
1745 <dc:elements> 1646 </dc:statement>
1746 <dc:if test="$uesg_exist>0"> 1647 <dc:for-each>
1747 <floodmaps> 1648 <dc:if test="$uesg_exist&gt;0">
1748 <dc:attribute name="factory" value="wmsfloodmapsfactory"/> 1649 <floodmaps factory="wmsfloodmapsfactory"
1749 <dc:attribute name="ids" value="${river_id};${name}"/> 1650 ids="{$river_id};{$name}"
1750 <dc:attribute name="name" value="${name}"/> 1651 name="{$name}"/>
1751 </floodmaps> 1652 </dc:if>
1752 </dc:if> 1653 </dc:for-each>
1753 </dc:elements> 1654 </dc:context>
1754 </dc:context> 1655 </land>
1755 </bfg> 1656 </potentiel>
1756 <land> 1657 </calculations>
1757 <dc:context> 1658 </uesk>
1758 <dc:statement> 1659 </dc:macro>
1759 SELECT count(*) as uesg_exist, name as name 1660
1760 FROM floodmaps 1661 <dc:macro name="flood-map-catchments">
1761 WHERE river_id = ${river_id} AND kind = 122 1662 <dc:attribute name="factory" value="externalwmsfactory"/>
1762 GROUP BY name, kind 1663 <dc:attribute name="ids" value="http://geoportal.bafg.de/wmsproxy/INSPIRE/DrainageBasin;HY.PHYSICALWATERS.CATCHMENTS;Einzugsgebiet"/>
1763 </dc:statement> 1664 </dc:macro>
1764 <dc:elements> 1665
1765 <dc:if test="$uesg_exist>0"> 1666 <dc:macro name="flood-map-routing">
1766 <floodmaps> 1667 <qps>
1767 <dc:attribute name="factory" value="wmsfloodmapsfactory"/> 1668 <dc:call-macro name="flood-map-qps"/>
1768 <dc:attribute name="ids" value="${river_id};${name}"/> 1669 </qps>
1769 <dc:attribute name="name" value="${name}"/> 1670 <dc:call-macro name="flood-map-fixpoints"/>
1770 </floodmaps> 1671 <dc:call-macro name="flood-map-km"/>
1771 </dc:if> 1672 <axis>
1772 </dc:elements> 1673 <dc:call-macro name="flood-map-riveraxis"/>
1773 </dc:context> 1674 </axis>
1774 </land> 1675 </dc:macro>
1775 </potentiel> 1676
1776 </calculations> 1677 <dc:macro name="flood-map-complete">
1777 </uesk> 1678 <buildings>
1778 </dc:macro> 1679 <dc:call-macro name="flood-map-buildings"/>
1779 1680 </buildings>
1780 <dc:macro name="flood-map-catchments"> 1681 <catchments>
1781 <dc:attribute name="factory" value="externalwmsfactory"/> 1682 <dc:call-macro name="flood-map-catchments"/>
1782 <dc:attribute name="ids" value="http://geoportal.bafg.de/wmsproxy/INSPIRE/DrainageBasin;HY.PHYSICALWATERS.CATCHMENTS;Einzugsgebiet"/> 1683 </catchments>
1783 </dc:macro> 1684 <dc:comment><!-- TODO: HW-Marken --></dc:comment>
1784 1685 <hws>
1785 <dc:macro name="flood-map-routing"> 1686 <dc:call-macro name="hwslines"/>
1786 <qps> 1687 <dc:call-macro name="hwspoints"/>
1787 <dc:call-macro name="flood-map-qps"/> 1688 </hws>
1788 </qps> 1689 <route_data>
1789 <dc:call-macro name="flood-map-fixpoints"/> 1690 <dc:call-macro name="flood-map-routing"/>
1790 <dc:call-macro name="flood-map-km"/> 1691 </route_data>
1791 <axis> 1692 <hydrboundaries>
1792 <dc:call-macro name="flood-map-riveraxis"/> 1693 <dc:call-macro name="flood-map-floodplain"/>
1793 </axis> 1694 <dc:call-macro name="flood-map-hydr-boundaries"/>
1794 </dc:macro> 1695 </hydrboundaries>
1795 1696 <dc:call-macro name="flood-map-uesk"/>
1796 <dc:macro name="flood-map-complete"> 1697 <gaugelocations>
1797 <buildings> 1698 <dc:call-macro name="flood-map-gaugelocations"/>
1798 <dc:call-macro name="flood-map-buildings"/> 1699 </gaugelocations>
1799 </buildings> 1700 <background factory="wmsbackground" ids="{$river_id}"/>
1800 <catchments> 1701 </dc:macro>
1801 <dc:call-macro name="flood-map-catchments"/> 1702
1802 </catchments>
1803 <!-- TODO: HW-Marken -->
1804 <hws>
1805 <dc:call-macro name="hwslines"/>
1806 <dc:call-macro name="hwspoints"/>
1807 </hws>
1808 <route_data>
1809 <dc:call-macro name="flood-map-routing"/>
1810 </route_data>
1811 <hydrboundaries>
1812 <dc:call-macro name="flood-map-hydr-boundaries"/>
1813 <dc:call-macro name="flood-map-floodplain"/>
1814 </hydrboundaries>
1815 <dc:call-macro name="flood-map-uesk"/>
1816 <gaugelocations>
1817 <dc:call-macro name="flood-map-gaugelocations"/>
1818 </gaugelocations>
1819 <background>
1820 <dc:attribute name="factory" value="wmsbackground"/>
1821 <dc:attribute name="ids" value="${river_id}"/>
1822 </background>
1823 </dc:macro>
1824 </dc:if> 1703 </dc:if>
1704
1825 <dc:if test="dc:contains($artifact-outs, 'minfo-heights')"> 1705 <dc:if test="dc:contains($artifact-outs, 'minfo-heights')">
1826 <dc:call-macro name="minfo-heights"/> 1706 <dc:call-macro name="minfo-heights"/>
1827 <dc:macro name="minfo-heights"> 1707 <dc:macro name="minfo-heights">
1828 <bedheights> 1708 <bedheights>
1829 <dc:call-macro name="bed-heights-single"/> 1709 <dc:call-macro name="bed-heights-single"/>
1834 <dc:if test="dc:contains($artifact-outs, 'minfo-heights-epoch')"> 1714 <dc:if test="dc:contains($artifact-outs, 'minfo-heights-epoch')">
1835 <bedheights> 1715 <bedheights>
1836 <dc:call-macro name="bed-heights-epoch"/> 1716 <dc:call-macro name="bed-heights-epoch"/>
1837 </bedheights> 1717 </bedheights>
1838 </dc:if> 1718 </dc:if>
1719
1839 <dc:macro name="bed-heights-single"> 1720 <dc:macro name="bed-heights-single">
1840 <single> 1721 <single>
1841 <dc:context> 1722 <dc:context>
1842 <dc:statement> 1723 <dc:statement>
1843 SELECT id AS bedh_id, 1724 SELECT id AS bedh_id,
1844 year AS bedh_year, 1725 year AS bedh_year,
1845 description AS bedh_descr 1726 description AS bedh_descr
1846 FROM bed_height_single WHERE river_id = ${river_id} 1727 FROM bed_height_single WHERE river_id = ${river_id}
1847 </dc:statement> 1728 </dc:statement>
1848 <dc:elements> 1729 <dc:for-each>
1849 <height> 1730 <height factory="bedheight"
1850 <dc:attribute name="factory" value="bedheight"/> 1731 ids="bedheight-single-{$bedh_id}-{$bedh_year}"
1851 <dc:attribute name="ids" value="bedheight-single-${bedh_id}-${bedh_year}"/> 1732 description="{$bedh_descr}"/>
1852 <dc:attribute name="description" value="${bedh_descr}"/> 1733 </dc:for-each>
1853 </height>
1854 </dc:elements>
1855 </dc:context> 1734 </dc:context>
1856 </single> 1735 </single>
1857 </dc:macro> 1736 </dc:macro>
1737
1858 <dc:macro name="bed-heights-epoch"> 1738 <dc:macro name="bed-heights-epoch">
1859 <epoch> 1739 <epoch>
1860 <dc:context> 1740 <dc:context>
1861 <dc:statement> 1741 <dc:statement>
1862 SELECT id AS bedh_id, 1742 SELECT id AS bedh_id,
1863 time_interval_id AS bedh_interval_id, 1743 time_interval_id AS bedh_interval_id,
1864 description AS bedh_descr 1744 description AS bedh_descr
1865 FROM bed_height_epoch WHERE river_id = ${river_id} 1745 FROM bed_height_epoch WHERE river_id = ${river_id}
1866 </dc:statement> 1746 </dc:statement>
1867 <dc:elements> 1747 <dc:for-each>
1868 <height> 1748 <height factory="bedheight"
1869 <dc:attribute name="factory" value="bedheight"/> 1749 ids="bedheight-epoch-{$bedh_id}-{$bedh_interval_id}"
1870 <dc:attribute name="ids" value="bedheight-epoch-${bedh_id}-${bedh_interval_id}"/> 1750 description="{$bedh_descr}"/>
1871 <dc:attribute name="description" value="${bedh_descr}"/> 1751 </dc:for-each>
1872 </height>
1873 </dc:elements>
1874 </dc:context> 1752 </dc:context>
1875 </epoch> 1753 </epoch>
1876 </dc:macro> 1754 </dc:macro>
1877 </dc:elements> 1755
1756 </dc:for-each>
1878 </dc:context> 1757 </dc:context>
1879 </dc:macro> 1758 </dc:macro>
1880 1759
1881 <dc:choose> 1760 <dc:choose>
1882 <dc:comment> 1761 <dc:comment>
1883 User specific part 1762 User specific part
1884 ------------------ 1763 ------------------
1885 </dc:comment> 1764 </dc:comment>
1886 <dc:when test="dc:contains($parameters, 'user-id')"> 1765 <dc:when test="dc:contains($parameters, 'user-id')">
1887 1766
1888 1767 <old_calculations>
1889 <old_calculations> 1768
1890 <!-- <dc:macro name="load-user">--> 1769 <dc:comment><!-- <dc:macro name="load-user">--></dc:comment>
1891 <dc:call-macro name="user-range"> 1770 <dc:call-macro name="user-range">
1892 <dc:context connection="user"> 1771 <dc:context connection="user">
1893 <dc:comment> 1772 <dc:comment> Get the user and collection-id. </dc:comment>
1894 Get the user and collection-id. 1773 <dc:statement>
1895 </dc:comment> 1774 SELECT u.id AS user_id, c.id AS collection_id, c.name AS collection_name
1896 <dc:statement> 1775 FROM collections c JOIN users u ON c.user_id = u.id
1897 SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name 1776 WHERE u.gid = CAST(${user-id} AS uuid)
1898 FROM collections c JOIN users u ON c.user_id = u.id 1777 ORDER BY c.creation DESC
1899 WHERE u.gid = CAST(${user-id} AS uuid) 1778 </dc:statement>
1900 ORDER BY c.creation DESC 1779
1901 </dc:statement> 1780 <dc:macro name="range-filter">
1902 1781 <dc:statement>
1903 1782 SELECT m.id AS a_id,
1904 <dc:macro name="range-filter"> 1783 m.state AS a_state,
1905 <dc:statement> 1784 m.gid AS a_gid,
1906 SELECT m.id AS a_id, 1785 m.creation AS a_creation,
1907 m.state AS a_state, 1786 COALESCE(ld_mode, '') AS ld_m,
1908 m.gid AS a_gid, 1787 COALESCE(ld_locations, '') AS ld_l,
1909 m.creation AS a_creation, 1788 COALESCE(ld_from, '') AS ld_f,
1910 COALESCE(ld_mode, '') AS ld_m, 1789 COALESCE(ld_to, '') AS ld_t
1911 COALESCE(ld_locations, '') AS ld_l, 1790 FROM master_artifacts_range m
1912 COALESCE(ld_from, '') AS ld_f, 1791 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid)
1913 COALESCE(ld_to, '') AS ld_t 1792 AND EXISTS (
1914 FROM master_artifacts_range m 1793 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
1915 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid) 1794 </dc:statement>
1916 AND EXISTS ( 1795 <dc:for-each>
1917 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) 1796 <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/>
1918 </dc:statement> 1797 <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/>
1919 <dc:elements> 1798 <dc:if test="($from &gt;= $fromkm and $from &lt;= $tokm) or ($to &lt;= $tokm and $to &gt;= $fromkm) or ($from &lt;= $fromkm and $to &gt;= $tokm)">
1920 <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/> 1799 <dc:macro-body/>
1921 <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/> 1800 </dc:if>
1922 <dc:if test="($from &gt;= $fromkm and $from &lt;= $tokm) or ($to &lt;= $tokm and $to &gt;= $fromkm) or ($from &lt;= $fromkm and $to &gt;= $tokm)"> 1801 </dc:for-each>
1923 <dc:macro-body/> 1802 </dc:macro>
1924 </dc:if> 1803
1925 </dc:elements> 1804 <!-- OFFICIAL LINES -->
1926 </dc:macro> 1805 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')">
1927 1806 <dc:comment comment=".wst -------------------------------"/>
1928 <!-- OFFICIAL LINES --> 1807 <officiallines>
1929 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')"> 1808 <dc:for-each>
1930 <dc:comment comment=".wst -------------------------------"/> 1809 <dc:context>
1931 <officiallines> 1810 <dc:statement>
1932 <dc:elements> 1811 SELECT m.id AS a_id,
1933 <dc:context> 1812 m.state AS a_state,
1934 <dc:statement> 1813 m.gid AS a_gid,
1935 SELECT m.id AS a_id, 1814 m.creation AS a_creation,
1936 m.state AS a_state, 1815 ardg.v AS gaugy,
1937 m.gid AS a_gid, 1816 arv.v AS wqsingle
1938 m.creation AS a_creation, 1817 FROM master_artifacts m,
1939 ardg.v AS gaugy, 1818 artifact_data ardg,
1940 arv.v AS wqsingle 1819 artifact_data arv
1941 FROM master_artifacts m, 1820 WHERE m.collection_id = ${collection_id}
1942 artifact_data ardg, 1821 AND m.gid = CAST(${artifact-id} AS uuid)
1943 artifact_data arv 1822 AND ardg.artifact_id = m.id
1944 WHERE m.collection_id = ${collection_id} 1823 AND ardg.k = 'ld_gaugename'
1945 AND m.gid = CAST(${artifact-id} AS uuid) 1824 AND arv.artifact_id = m.id
1946 AND ardg.artifact_id = m.id 1825 AND arv.k = 'wq_single'
1947 AND ardg.k = 'ld_gaugename' 1826 AND EXISTS (
1948 AND arv.artifact_id = m.id 1827 SELECT id
1949 AND arv.k = 'wq_single' 1828 FROM artifact_data ad
1950 AND EXISTS ( 1829 WHERE ad.artifact_id = m.id
1951 SELECT id 1830 AND k = 'river'
1952 FROM artifact_data ad 1831 AND v = ${river})
1953 WHERE ad.artifact_id = m.id 1832 </dc:statement>
1954 AND k = 'river' 1833 <dc:for-each>
1955 AND v = ${river})
1956 </dc:statement>
1957 <dc:elements>
1958 <dc:context connection="system"> 1834 <dc:context connection="system">
1959 <dc:statement> 1835 <dc:statement>
1960 SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval 1836 SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval
1961 FROM official_q_values ol 1837 FROM official_q_values ol
1962 WHERE ol.value = CAST(${wqsingle} AS NUMERIC(10,2)) AND ol.gauge_name = ${gaugy} 1838 WHERE ol.value = CAST(${wqsingle} AS NUMERIC(10,2)) AND ol.gauge_name = ${gaugy}
1963 </dc:statement> 1839 </dc:statement>
1964 <dc:elements> 1840 <dc:for-each>
1965 <dc:element name="${olname}"> 1841 <dc:element name="${olname}">
1966 <dc:attribute name="name" value="${olname}"/> 1842 <dc:attribute name="name" value="${olname}"/>
1967 <dc:attribute name="ids" value="additionals-wstv-${wstcolpos}-${wstid}"/> 1843 <dc:attribute name="ids" value="additionals-wstv-${wstcolpos}-${wstid}"/>
1968 <dc:attribute name="factory" value="staticwkms"/> 1844 <dc:attribute name="factory" value="staticwkms"/>
1969 </dc:element> 1845 </dc:element>
1970 </dc:elements> 1846 </dc:for-each>
1971 </dc:context> 1847 </dc:context>
1972 </dc:elements> 1848 </dc:for-each>
1973 </dc:context> 1849 </dc:context>
1974 </dc:elements> 1850 </dc:for-each>
1975 </officiallines> 1851 </officiallines>
1976 </dc:if> 1852 </dc:if>
1977 <!-- END OFFICIAL LINES --> 1853 <!-- END OFFICIAL LINES -->
1978 1854
1979 <dc:comment> 1855 <dc:comment>
1980 SHOW W-DIFFERENCES 1856 SHOW W-DIFFERENCES
1981 </dc:comment> 1857 </dc:comment>
1982 1858
1983 <dc:macro name="differences"> 1859 <dc:macro name="differences">
1984 <differences> 1860 <differences>
1985 <dc:elements> 1861 <dc:for-each>
1986 <dc:context> 1862 <dc:context>
1987 <dc:call-macro name="range-filter"> 1863 <dc:call-macro name="range-filter">
1988 <dc:context> 1864 <dc:context>
1989 <dc:statement> 1865 <dc:statement>
1990 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description 1866 SELECT a.gid AS aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description AS facet_description
1991 FROM outs as o, facets as f, artifacts as a 1867 FROM outs AS o, facets AS f, artifacts AS a
1992 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} 1868 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
1993 </dc:statement> 1869 </dc:statement>
1994 <dc:elements> 1870 <dc:for-each>
1995 <dc:element name="${facet_name}"> 1871 <dc:element name="${facet_name}">
1996 <dc:attribute name="description" value="${facet_description}"/> 1872 <dc:attribute name="description" value="${facet_description}"/>
1997 <dc:attribute name="factory" value="winfo"/> 1873 <dc:attribute name="factory" value="winfo"/>
1998 <dc:attribute name="artifact-id" value="${aid}"/> 1874 <dc:attribute name="artifact-id" value="${aid}"/>
1999 <dc:attribute name="ids" value="${aid}"/> 1875 <dc:attribute name="ids" value="${aid}"/>
2000 <dc:attribute name="out" value="w_differences"/> 1876 <dc:attribute name="out" value="w_differences"/>
2001 </dc:element> 1877 </dc:element>
2002 </dc:elements> 1878 </dc:for-each>
2003 </dc:context> 1879 </dc:context>
2004 </dc:call-macro> 1880 </dc:call-macro>
2005 </dc:context> 1881 </dc:context>
2006 </dc:elements> 1882 </dc:for-each>
2007 </differences> 1883 </differences>
2008 </dc:macro> 1884 </dc:macro>
2009 1885
2010 <dc:comment> 1886 <dc:comment>
2011 SHOW REFERENCE CURVE 1887 SHOW REFERENCE CURVE
2012 </dc:comment> 1888 </dc:comment>
2013 1889
2014 1890 <dc:macro name="reference-curves">
2015 <dc:macro name="reference-curves"> 1891 <reference_curves>
2016 <reference_curves> 1892 <dc:for-each>
2017 <dc:elements> 1893 <dc:context>
2018 <dc:context> 1894 <dc:call-macro name="user-range">
2019 <dc:call-macro name="user-range">
2020 <dc:context> 1895 <dc:context>
2021 <dc:statement> 1896 <dc:statement>
2022 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
2023 FROM outs as o, facets as f, artifacts as a 1898 FROM outs AS o, facets AS f, artifacts AS a
2024 WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} 1899 WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
2025 </dc:statement> 1900 </dc:statement>
2026 <dc:elements> 1901 <dc:for-each>
2027 <dc:element name="${facet_name}"> 1902 <dc:element name="${facet_name}">
2028 <dc:attribute name="description" value="${facet_description}"/> 1903 <dc:attribute name="description" value="${facet_description}"/>
2029 <dc:attribute name="factory" value="winfo"/> 1904 <dc:attribute name="factory" value="winfo"/>
2030 <dc:attribute name="artifact-id" value="${aid}"/> 1905 <dc:attribute name="artifact-id" value="${aid}"/>
2031 <dc:attribute name="ids" value="${aid}"/> 1906 <dc:attribute name="ids" value="${aid}"/>
2032 <dc:attribute name="out" value="reference_curve"/> 1907 <dc:attribute name="out" value="reference_curve"/>
2033 </dc:element> 1908 </dc:element>
2034 </dc:elements> 1909 </dc:for-each>
1910 </dc:context>
1911 </dc:call-macro>
1912 </dc:context>
1913 </dc:for-each>
1914 </reference_curves>
1915 </dc:macro>
1916
1917 <dc:comment>
1918 SHOW COMPUTED DISCHARGE CURVES
1919 </dc:comment>
1920
1921 <dc:macro name="computed-discharge-curve">
1922 <computed_discharge_curves>
1923 <dc:for-each>
1924 <dc:context>
1925 <dc:call-macro name="range-filter">
1926 <dc:context>
1927 <dc:statement>
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
1929 FROM outs AS o, facets AS f, artifacts AS a
1930 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
1931 </dc:statement>
1932 <dc:for-each>
1933 <dc:element name="${facet_name}">
1934 <dc:attribute name="description" value="${facet_description}"/>
1935 <dc:attribute name="factory" value="winfo"/>
1936 <dc:attribute name="artifact-id" value="${aid}"/>
1937 <dc:attribute name="ids" value="${aid}"/>
1938 <dc:attribute name="out" value="computed_discharge_curve"/>
1939 </dc:element>
1940 </dc:for-each>
2035 </dc:context> 1941 </dc:context>
2036 </dc:call-macro> 1942 </dc:call-macro>
2037 </dc:context> 1943 </dc:context>
2038 </dc:elements> 1944 </dc:for-each>
2039 </reference_curves> 1945 </computed_discharge_curves>
2040 </dc:macro> 1946 </dc:macro>
2041 1947
2042 <dc:comment> 1948 <dc:comment>
2043 SHOW COMPUTED DISCHARGE CURVES 1949 CROSS SECTION
2044 </dc:comment> 1950 </dc:comment>
2045 1951
2046 <dc:macro name="computed-discharge-curve"> 1952 <dc:macro name="waterlevels">
2047 <computed_discharge_curves> 1953 <waterlevels>
2048 <dc:elements> 1954 <dc:for-each>
2049 <dc:context> 1955 <dc:context>
2050 <dc:call-macro name="range-filter"> 1956 <dc:call-macro name="range-filter">
2051 <dc:context> 1957 <dc:context>
2052 <dc:statement> 1958 <dc:statement>
2053 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description 1959 SELECT id AS out_id
2054 FROM outs as o, facets as f, artifacts as a 1960 FROM outs
2055 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} 1961 WHERE artifact_id = ${a_id} AND name = 'cross_section'
2056 </dc:statement> 1962 </dc:statement>
2057 <dc:elements> 1963 <dc:for-each>
1964 <dc:context>
1965 <dc:statement>
1966 SELECT name AS facet_name, num AS facet_num, description AS facet_description
1967 FROM facets
1968 WHERE out_id = ${out_id}
1969 ORDER BY num ASC, name DESC
1970 </dc:statement>
1971 <longitudinal_section_columns description="{$river} {$a_creation}">
1972 <dc:for-each>
1973 <dc:element name="${facet_name}">
1974 <dc:attribute name="description" value="${facet_description}"/>
1975 <dc:attribute name="ids" value="${facet_num}"/>
1976 <dc:attribute name="factory" value="winfo"/>
1977 <dc:attribute name="artifact-id" value="${a_gid}"/>
1978 <dc:attribute name="out" value="cross_section"/>
1979 </dc:element>
1980 </dc:for-each>
1981 </longitudinal_section_columns>
1982 </dc:context>
1983 </dc:for-each>
1984 </dc:context>
1985 </dc:call-macro>
1986 </dc:context>
1987 </dc:for-each>
1988 </waterlevels>
1989 </dc:macro>
1990
1991 <dc:macro name="longitudinal">
1992 <waterlevels>
1993 <dc:for-each>
1994 <dc:context>
1995 <dc:call-macro name="range-filter">
1996 <dc:context>
1997 <dc:statement>
1998 SELECT id AS out_id
1999 FROM outs
2000 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
2001 </dc:statement>
2002 <dc:for-each>
2003 <dc:context>
2004 <dc:statement>
2005 SELECT name AS facet_name, num AS facet_num, description AS facet_description
2006 FROM facets
2007 WHERE out_id = ${out_id}
2008 ORDER BY num ASC, name DESC
2009 </dc:statement>
2010 <longitudinal_section_columns description="{$river} {$a_creation}">
2011 <dc:for-each>
2012 <dc:element name="${facet_name}">
2013 <dc:attribute name="description" value="${facet_description}"/>
2014 <dc:attribute name="ids" value="${facet_num}"/>
2015 <dc:attribute name="factory" value="winfo"/>
2016 <dc:attribute name="artifact-id" value="${a_gid}"/>
2017 <dc:attribute name="out" value="longitudinal_section"/>
2018 </dc:element>
2019 </dc:for-each>
2020 </longitudinal_section_columns>
2021 </dc:context>
2022 </dc:for-each>
2023 </dc:context>
2024 </dc:call-macro>
2025 </dc:context>
2026 </dc:for-each>
2027 </waterlevels>
2028 </dc:macro>
2029
2030 <dc:macro name="longitudinal-section">
2031 <waterlevels>
2032 <dc:for-each>
2033 <dc:context>
2034 <dc:call-macro name="range-filter">
2035 <dc:context>
2036 <dc:statement>
2037 SELECT id AS out_id
2038 FROM outs
2039 WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve'
2040 </dc:statement>
2041 <dc:for-each>
2042 <dc:context>
2043 <dc:comment><!-- average und deviation ls_0 . ls_1 ...--></dc:comment>
2044 <dc:statement>
2045 SELECT name AS facet_name, num AS facet_num, description AS facet_description
2046 FROM facets
2047 WHERE out_id = ${out_id} AND (
2048 name LIKE 'fix_deviation_ls%' OR
2049 name LIKE 'fix_sector_average_ls%' OR
2050 name LIKE 'fix_analysis_events_ls%' OR
2051 name LIKE 'fix_reference_events_ls%' )
2052 ORDER BY num ASC, name DESC
2053 </dc:statement>
2054 <waterlevels description="{$river} {$a_creation} {$collection_name}">
2055 <dc:for-each>
2056 <dc:element name="${facet_name}">
2057 <dc:attribute name="description" value="${facet_description}"/>
2058 <dc:attribute name="ids" value="${facet_num}"/>
2059 <dc:attribute name="factory" value="fixanalysis"/>
2060 <dc:attribute name="artifact-id" value="${a_gid}"/>
2061 <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
2062 </dc:element>
2063 </dc:for-each>
2064 </waterlevels>
2065 </dc:context>
2066 </dc:for-each>
2067 </dc:context>
2068 </dc:call-macro>
2069 </dc:context>
2070 </dc:for-each>
2071 </waterlevels>
2072 </dc:macro>
2073
2074 <dc:macro name="delta-wt">
2075 <waterlevels>
2076 <dc:for-each>
2077 <dc:context>
2078 <dc:call-macro name="range-filter">
2079 <dc:context>
2080 <dc:statement>
2081 SELECT id AS out_id
2082 FROM outs
2083 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve'
2084 </dc:statement>
2085 <dc:for-each>
2086 <dc:context>
2087 <dc:statement>
2088 SELECT name AS facet_name, num AS facet_num, description AS facet_description
2089 FROM facets
2090 WHERE out_id = ${out_id} and (
2091 name LIKE 'fix_sector_average_dwt%' OR
2092 name LIKE 'fix_deviation_dwt%' OR
2093 name = 'fix_analysis_events_dwt' OR
2094 name = 'fix_reference_events_dwt' OR
2095 name = 'fix_analysis_periods_dwt' )
2096 ORDER BY num ASC, name DESC
2097 </dc:statement>
2098 <waterlevels description="{$river} {$a_creation} {$collection_name}">
2099 <dc:for-each>
2100 <dc:element name="${facet_name}">
2101 <dc:attribute name="description" value="${facet_description}"/>
2102 <dc:attribute name="ids" value="${facet_num}"/>
2103 <dc:attribute name="factory" value="fixanalysis"/>
2104 <dc:attribute name="artifact-id" value="${a_gid}"/>
2105 <dc:attribute name="out" value="fix_deltawt_curve"/>
2106 </dc:element>
2107 </dc:for-each>
2108 </waterlevels>
2109 </dc:context>
2110 </dc:for-each>
2111 </dc:context>
2112 </dc:call-macro>
2113 </dc:context>
2114 </dc:for-each>
2115 </waterlevels>
2116 </dc:macro>
2117
2118 <dc:macro name="fix-derivate-curve">
2119 <waterlevels>
2120 <dc:for-each>
2121 <dc:context>
2122 <dc:call-macro name="range-filter">
2123 <dc:context>
2124 <dc:statement>
2125 SELECT id AS out_id
2126 FROM outs
2127 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve'
2128 </dc:statement>
2129 <dc:for-each>
2130 <dc:context>
2131 <dc:statement>
2132 SELECT name AS facet_name, num AS facet_num, description AS facet_description
2133 FROM facets
2134 WHERE out_id = ${out_id} and name = 'fix_derivate_curve'
2135 ORDER BY num ASC, name DESC
2136 </dc:statement>
2137 <waterlevels description="{$river} {$a_creation} {$collection_name}">
2138 <dc:for-each>
2139 <dc:element name="${facet_name}">
2140 <dc:attribute name="description" value="${facet_description}"/>
2141 <dc:attribute name="ids" value="${facet_num}"/>
2142 <dc:attribute name="factory" value="fixanalysis"/>
2143 <dc:attribute name="artifact-id" value="${a_gid}"/>
2144 <dc:attribute name="out" value="fix_derivate_curve"/>
2145 </dc:element>
2146 </dc:for-each>
2147 </waterlevels>
2148 </dc:context>
2149 </dc:for-each>
2150 </dc:context>
2151 </dc:call-macro>
2152 </dc:context>
2153 </dc:for-each>
2154 </waterlevels>
2155 </dc:macro>
2156
2157 <dc:macro name="fix-wq-curve">
2158 <waterlevels>
2159 <dc:for-each>
2160 <dc:context>
2161 <dc:call-macro name="range-filter">
2162 <dc:context>
2163 <dc:statement>
2164 SELECT id AS out_id
2165 FROM outs
2166 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve'
2167 </dc:statement>
2168 <dc:for-each>
2169 <dc:context>
2170 <dc:statement>
2171 SELECT name AS facet_name, num AS facet_num, description AS facet_description
2172 FROM facets
2173 WHERE out_id = ${out_id} and (
2174 name LIKE 'fix_sector_average_wq%' OR
2175 name = 'fix_wq_curve' OR
2176 name LIKE 'fix_analysis_events_wq%' OR
2177 name LIKE 'fix_reference_events_wq%' )
2178 ORDER BY num ASC, name DESC
2179 </dc:statement>
2180 <waterlevels description="{$river} {$a_creation} {$collection_name}">
2181 <dc:for-each>
2182 <dc:element name="${facet_name}">
2183 <dc:attribute name="description" value="${facet_description}"/>
2184 <dc:attribute name="ids" value="${facet_num}"/>
2185 <dc:attribute name="factory" value="fixanalysis"/>
2186 <dc:attribute name="artifact-id" value="${a_gid}"/>
2187 <dc:attribute name="out" value="fix_wq_curve"/>
2188 </dc:element>
2189 </dc:for-each>
2190 </waterlevels>
2191 </dc:context>
2192 </dc:for-each>
2193 </dc:context>
2194 </dc:call-macro>
2195 </dc:context>
2196 </dc:for-each>
2197 </waterlevels>
2198 </dc:macro>
2199
2200 <dc:macro name="duration-curve">
2201 <computed_discharge_curves>
2202 <dc:for-each>
2203 <dc:context>
2204 <dc:call-macro name="range-filter">
2205 <dc:context>
2206 <dc:statement>
2207 SELECT a.gid AS aid,
2208 f.id AS fid,
2209 f.name AS facet_name,
2210 f.num AS facet_num,
2211 f.description AS facet_description
2212 FROM outs AS o, facets AS f, artifacts AS a
2213 WHERE
2214 (f.name = 'duration_curve.q' OR f.name = 'duration_curve.w') AND
2215 f.out_id = o.id AND
2216 o.artifact_id = ${a_id} AND
2217 a.id = ${a_id}
2218 </dc:statement>
2219 <dc:for-each>
2058 <dc:element name="${facet_name}"> 2220 <dc:element name="${facet_name}">
2059 <dc:attribute name="description" value="${facet_description}"/> 2221 <dc:attribute name="description" value="${facet_description}"/>
2060 <dc:attribute name="factory" value="winfo"/> 2222 <dc:attribute name="factory" value="winfo"/>
2061 <dc:attribute name="artifact-id" value="${aid}"/> 2223 <dc:attribute name="artifact-id" value="${aid}"/>
2062 <dc:attribute name="ids" value="${aid}"/> 2224 <dc:attribute name="ids" value="${aid}"/>
2063 <dc:attribute name="out" value="computed_discharge_curve"/> 2225 <dc:attribute name="out" value="duration_curve"/>
2064 </dc:element> 2226 </dc:element>
2065 </dc:elements> 2227 </dc:for-each>
2066 </dc:context> 2228 </dc:context>
2067 </dc:call-macro> 2229 </dc:call-macro>
2068 </dc:context> 2230 </dc:context>
2069 </dc:elements> 2231 </dc:for-each>
2070 </computed_discharge_curves> 2232 </computed_discharge_curves>
2071 </dc:macro> 2233 </dc:macro>
2072 2234
2073 <dc:comment> 2235 <dc:comment>
2074 CROSS SECTION 2236 WATERLEVELS - ONLY SHOW Ws
2075 </dc:comment> 2237 </dc:comment>
2076 2238
2077 2239 <dc:comment><!-- TODO doesnt work nicely for fix/wq-diags. --></dc:comment>
2078 <dc:macro name="waterlevels"> 2240
2079 <waterlevels> 2241 <dc:macro name="waterlevels-fix">
2080 <dc:elements> 2242 <waterlevels>
2081 <dc:context> 2243 <dc:for-each>
2082 <dc:call-macro name="range-filter">
2083 <dc:context>
2084 <dc:statement>
2085 SELECT id AS out_id
2086 FROM outs
2087 WHERE artifact_id = ${a_id} AND name = 'cross_section'
2088 </dc:statement>
2089 <dc:elements>
2090 <dc:context>
2091 <dc:statement>
2092 SELECT name AS facet_name, num as facet_num, description AS facet_description
2093 FROM facets
2094 WHERE out_id = ${out_id}
2095 ORDER BY num ASC, name DESC
2096 </dc:statement>
2097 <longitudinal_section_columns>
2098 <dc:attribute name="description" value="${river} ${a_creation}"/>
2099 <dc:elements>
2100 <dc:element name="${facet_name}">
2101 <dc:attribute name="description" value="${facet_description}"/>
2102 <dc:attribute name="ids" value="${facet_num}"/>
2103 <dc:attribute name="factory" value="winfo"/>
2104 <dc:attribute name="artifact-id" value="${a_gid}"/>
2105 <dc:attribute name="out" value="cross_section"/>
2106 </dc:element>
2107 </dc:elements>
2108 </longitudinal_section_columns>
2109 </dc:context>
2110 </dc:elements>
2111 </dc:context>
2112 </dc:call-macro>
2113 </dc:context>
2114 </dc:elements>
2115 </waterlevels>
2116 </dc:macro>
2117
2118
2119 <dc:macro name="longitudinal">
2120 <waterlevels>
2121 <dc:elements>
2122 <dc:context>
2123 <dc:call-macro name="range-filter">
2124 <dc:context> 2244 <dc:context>
2125 <dc:statement> 2245 <dc:call-macro name="range-filter">
2126 SELECT id AS out_id
2127 FROM outs
2128 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
2129 </dc:statement>
2130 <dc:elements>
2131 <dc:context>
2132 <dc:statement>
2133 SELECT name AS facet_name, num as facet_num, description AS facet_description
2134 FROM facets
2135 WHERE out_id = ${out_id}
2136 ORDER BY num ASC, name DESC
2137 </dc:statement>
2138 <longitudinal_section_columns>
2139 <dc:attribute name="description" value="${river} ${a_creation}"/>
2140 <dc:elements>
2141 <dc:element name="${facet_name}">
2142 <dc:attribute name="description" value="${facet_description}"/>
2143 <dc:attribute name="ids" value="${facet_num}"/>
2144 <dc:attribute name="factory" value="winfo"/>
2145 <dc:attribute name="artifact-id" value="${a_gid}"/>
2146 <dc:attribute name="out" value="longitudinal_section"/>
2147 </dc:element>
2148 </dc:elements>
2149 </longitudinal_section_columns>
2150 </dc:context>
2151 </dc:elements>
2152 </dc:context>
2153 </dc:call-macro>
2154 </dc:context>
2155 </dc:elements>
2156 </waterlevels>
2157 </dc:macro>
2158
2159
2160 <dc:macro name="longitudinal-section">
2161 <waterlevels>
2162 <dc:elements>
2163 <dc:context>
2164 <dc:call-macro name="range-filter">
2165 <dc:context>
2166 <dc:statement>
2167 SELECT id AS out_id
2168 FROM outs
2169 WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve'
2170 </dc:statement>
2171 <dc:elements>
2172 <dc:context>
2173 <!-- average und deviation ls_0 . ls_1 ...-->
2174 <dc:statement>
2175 SELECT name AS facet_name, num as facet_num, description AS facet_description
2176 FROM facets
2177 WHERE out_id = ${out_id} AND ( name LIKE 'fix_deviation_ls%' OR name LIKE 'fix_sector_average_ls%' OR name LIKE 'fix_analysis_events_ls%' OR name LIKE 'fix_reference_events_ls%' )
2178 ORDER BY num ASC, name DESC
2179 </dc:statement>
2180 <waterlevels>
2181 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
2182 <dc:elements>
2183 <dc:element name="${facet_name}">
2184 <dc:attribute name="description" value="${facet_description}"/>
2185 <dc:attribute name="ids" value="${facet_num}"/>
2186 <dc:attribute name="factory" value="fixanalysis"/>
2187 <dc:attribute name="artifact-id" value="${a_gid}"/>
2188 <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
2189 </dc:element>
2190 </dc:elements>
2191 </waterlevels>
2192 </dc:context>
2193 </dc:elements>
2194 </dc:context>
2195 </dc:call-macro>
2196 </dc:context>
2197 </dc:elements>
2198 </waterlevels>
2199 </dc:macro>
2200
2201 <dc:macro name="delta-wt">
2202 <waterlevels>
2203 <dc:elements>
2204 <dc:context>
2205 <dc:call-macro name="range-filter">
2206 <dc:context>
2207 <dc:statement>
2208 SELECT id AS out_id
2209 FROM outs
2210 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve'
2211 </dc:statement>
2212 <dc:elements>
2213 <dc:context>
2214 <dc:statement>
2215 SELECT name AS facet_name, num as facet_num, description AS facet_description
2216 FROM facets
2217 WHERE out_id = ${out_id} and ( name LIKE 'fix_sector_average_dwt%' OR name LIKE 'fix_deviation_dwt%' OR name = 'fix_analysis_events_dwt' OR name = 'fix_reference_events_dwt' OR name = 'fix_analysis_periods_dwt' )
2218 ORDER BY num ASC, name DESC
2219 </dc:statement>
2220 <waterlevels>
2221 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
2222 <dc:elements>
2223 <dc:element name="${facet_name}">
2224 <dc:attribute name="description" value="${facet_description}"/>
2225 <dc:attribute name="ids" value="${facet_num}"/>
2226 <dc:attribute name="factory" value="fixanalysis"/>
2227 <dc:attribute name="artifact-id" value="${a_gid}"/>
2228 <dc:attribute name="out" value="fix_deltawt_curve"/>
2229 </dc:element>
2230 </dc:elements>
2231 </waterlevels>
2232 </dc:context>
2233 </dc:elements>
2234 </dc:context>
2235 </dc:call-macro>
2236 </dc:context>
2237 </dc:elements>
2238 </waterlevels>
2239 </dc:macro>
2240
2241
2242 <dc:macro name="fix-derivate-curve">
2243 <waterlevels>
2244 <dc:elements>
2245 <dc:context>
2246 <dc:call-macro name="range-filter">
2247 <dc:context>
2248 <dc:statement>
2249 SELECT id AS out_id
2250 FROM outs
2251 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve'
2252 </dc:statement>
2253 <dc:elements>
2254 <dc:context>
2255 <dc:statement>
2256 SELECT name AS facet_name, num as facet_num, description AS facet_description
2257 FROM facets
2258 WHERE out_id = ${out_id} and name = 'fix_derivate_curve'
2259 ORDER BY num ASC, name DESC
2260 </dc:statement>
2261 <waterlevels>
2262 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
2263 <dc:elements>
2264 <dc:element name="${facet_name}">
2265 <dc:attribute name="description" value="${facet_description}"/>
2266 <dc:attribute name="ids" value="${facet_num}"/>
2267 <dc:attribute name="factory" value="fixanalysis"/>
2268 <dc:attribute name="artifact-id" value="${a_gid}"/>
2269 <dc:attribute name="out" value="fix_derivate_curve"/>
2270 </dc:element>
2271 </dc:elements>
2272 </waterlevels>
2273 </dc:context>
2274 </dc:elements>
2275 </dc:context>
2276 </dc:call-macro>
2277 </dc:context>
2278 </dc:elements>
2279 </waterlevels>
2280 </dc:macro>
2281
2282
2283 <dc:macro name="fix-wq-curve">
2284 <waterlevels>
2285 <dc:elements>
2286 <dc:context>
2287 <dc:call-macro name="range-filter">
2288 <dc:context>
2289 <dc:statement>
2290 SELECT id AS out_id
2291 FROM outs
2292 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve'
2293 </dc:statement>
2294 <dc:elements>
2295 <dc:context>
2296 <dc:statement>
2297 SELECT name AS facet_name, num as facet_num, description AS facet_description
2298 FROM facets
2299 WHERE out_id = ${out_id} and ( name LIKE 'fix_sector_average_wq%' OR name = 'fix_wq_curve' OR name LIKE 'fix_analysis_events_wq%' OR name LIKE 'fix_reference_events_wq%' )
2300 ORDER BY num ASC, name DESC
2301 </dc:statement>
2302 <waterlevels>
2303 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
2304 <dc:elements>
2305 <dc:element name="${facet_name}">
2306 <dc:attribute name="description" value="${facet_description}"/>
2307 <dc:attribute name="ids" value="${facet_num}"/>
2308 <dc:attribute name="factory" value="fixanalysis"/>
2309 <dc:attribute name="artifact-id" value="${a_gid}"/>
2310 <dc:attribute name="out" value="fix_wq_curve"/>
2311 </dc:element>
2312 </dc:elements>
2313 </waterlevels>
2314 </dc:context>
2315 </dc:elements>
2316 </dc:context>
2317 </dc:call-macro>
2318 </dc:context>
2319 </dc:elements>
2320 </waterlevels>
2321 </dc:macro>
2322
2323
2324 <dc:macro name="duration-curve">
2325 <computed_discharge_curves>
2326 <dc:elements>
2327 <dc:context>
2328 <dc:call-macro name="range-filter">
2329 <dc:context> 2246 <dc:context>
2330 <dc:statement> 2247 <dc:statement>
2331 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description 2248 SELECT id AS out_id
2332 FROM outs as o, facets as f, artifacts as a 2249 FROM outs
2333 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} 2250 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
2334 </dc:statement> 2251 </dc:statement>
2335 <dc:elements> 2252 <dc:for-each>
2253 <dc:context>
2254 <dc:statement>
2255 SELECT name AS facet_name, num AS facet_num, description AS facet_description
2256 FROM facets
2257 WHERE out_id = ${out_id} and name = 'longitudinal_section.w'
2258 ORDER BY num ASC, name DESC
2259 </dc:statement>
2260 <waterlevels description="{$river} {$a_creation} {$collection_name}">
2261 <dc:for-each>
2262 <dc:element name="${facet_name}">
2263 <dc:attribute name="description" value="${facet_description}"/>
2264 <dc:attribute name="ids" value="${facet_num}"/>
2265 <dc:attribute name="factory" value="winfo"/>
2266 <dc:attribute name="artifact-id" value="${a_gid}"/>
2267 <dc:attribute name="out" value="longitudinal_section"/>
2268 </dc:element>
2269 </dc:for-each>
2270 </waterlevels>
2271 </dc:context>
2272 </dc:for-each>
2273 </dc:context>
2274 </dc:call-macro>
2275 </dc:context>
2276 </dc:for-each>
2277 </waterlevels>
2278 </dc:macro>
2279
2280 <dc:comment>
2281 SHOW FLOODMAPS
2282 </dc:comment>
2283
2284 <dc:macro name="flood-map">
2285 <floodmap>
2286 <dc:for-each>
2287 <dc:context>
2288 <dc:call-macro name="range-filter">
2289 <dc:context>
2290 <dc:statement>
2291 SELECT a.gid AS aid,
2292 f.id AS fid,
2293 f.name AS facet_name,
2294 f.num AS facet_num,
2295 f.description AS facet_description
2296 FROM outs AS o, facets AS f, artifacts AS a
2297 WHERE f.name = 'floodmap.wsplgen' AND
2298 f.out_id = o.id AND
2299 o.artifact_id = ${a_id} AND
2300 a.id = ${a_id}
2301 </dc:statement>
2302 <dc:for-each>
2336 <dc:element name="${facet_name}"> 2303 <dc:element name="${facet_name}">
2337 <dc:attribute name="description" value="${facet_description}"/> 2304 <dc:attribute name="description" value="${facet_description}"/>
2338 <dc:attribute name="factory" value="winfo"/> 2305 <dc:attribute name="factory" value="winfo"/>
2339 <dc:attribute name="artifact-id" value="${aid}"/> 2306 <dc:attribute name="artifact-id" value="${aid}"/>
2340 <dc:attribute name="ids" value="${aid}"/> 2307 <dc:attribute name="ids" value="${aid}"/>
2341 <dc:attribute name="out" value="duration_curve"/> 2308 <dc:attribute name="out" value="floodmap"/>
2342 </dc:element> 2309 </dc:element>
2343 </dc:elements> 2310 </dc:for-each>
2344 </dc:context> 2311 </dc:context>
2345 </dc:call-macro> 2312 </dc:call-macro>
2346 </dc:context>
2347 </dc:elements>
2348 </computed_discharge_curves>
2349 </dc:macro>
2350
2351 <dc:comment>
2352 WATERLEVELS - ONLY SHOW Ws
2353 </dc:comment>
2354
2355 <!-- TODO doesnt work nicely for fix/wq-diags. -->
2356
2357 <dc:macro name="waterlevels-fix">
2358 <waterlevels>
2359 <dc:elements>
2360 <dc:context>
2361 <dc:call-macro name="range-filter">
2362 <dc:context>
2363 <dc:statement>
2364 SELECT id AS out_id
2365 FROM outs
2366 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
2367 </dc:statement>
2368 <dc:elements>
2369 <dc:context>
2370 <dc:statement>
2371 SELECT name AS facet_name, num as facet_num, description AS facet_description
2372 FROM facets
2373 WHERE out_id = ${out_id} and name = 'longitudinal_section.w'
2374 ORDER BY num ASC, name DESC
2375 </dc:statement>
2376 <waterlevels>
2377 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
2378 <dc:elements>
2379 <dc:element name="${facet_name}">
2380 <dc:attribute name="description" value="${facet_description}"/>
2381 <dc:attribute name="ids" value="${facet_num}"/>
2382 <dc:attribute name="factory" value="winfo"/>
2383 <dc:attribute name="artifact-id" value="${a_gid}"/>
2384 <dc:attribute name="out" value="longitudinal_section"/>
2385 </dc:element>
2386 </dc:elements>
2387 </waterlevels>
2388 </dc:context>
2389 </dc:elements>
2390 </dc:context> 2313 </dc:context>
2391 </dc:call-macro> 2314 </dc:for-each>
2392 </dc:context> 2315 </floodmap>
2393 </dc:elements> 2316 </dc:macro>
2394 </waterlevels> 2317
2395 </dc:macro> 2318 <dc:comment>
2396 2319 MINFO bedheight difference
2397 <dc:comment> 2320 </dc:comment>
2398 SHOW FLOODMAPS 2321
2399 </dc:comment> 2322 <dc:macro name="bed-difference">
2400 2323 <fix_longitudinal_section_curve>
2401 2324 <dc:for-each>
2402 <dc:macro name="flood-map"> 2325 <dc:context>
2403 <floodmap> 2326 <dc:call-macro name="range-filter">
2404 <dc:elements>
2405 <dc:context>
2406 <dc:call-macro name="range-filter">
2407 <dc:context> 2327 <dc:context>
2408 <dc:statement> 2328 <dc:statement>
2409 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description 2329 SELECT a.gid AS aid,
2410 FROM outs as o, facets as f, artifacts as a 2330 f.id AS fid,
2411 WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} 2331 f.name AS facet_name,
2332 f.num AS facet_num,
2333 f.description AS facet_description
2334 FROM outs AS o, facets AS f, artifacts AS a
2335 WHERE (
2336 f.name = 'fix_sector_average_ls_0' OR
2337 f.name = 'fix_sector_average_ls_1' OR
2338 f.name = 'fix_sector_average_ls_2' OR
2339 f.name = 'fix_sector_average_ls_3' OR
2340 f.name = 'fix_analysis_events_ls' OR
2341 f.name = 'fix_reference_events_ls'
2342 ) AND f.out_id = o.id AND o.artifact_id = ${a_id} AND a.id = ${a_id}
2412 </dc:statement> 2343 </dc:statement>
2413 <dc:elements> 2344 <fix_longitudinal_section_curve description="{$river} {$a_creation} {$collection_name}">
2414 <dc:element name="${facet_name}"> 2345 <dc:for-each>
2415 <dc:attribute name="description" value="${facet_description}"/> 2346 <dc:element name="${facet_name}">
2416 <dc:attribute name="factory" value="winfo"/> 2347 <dc:attribute name="description" value="${facet_description}"/>
2417 <dc:attribute name="artifact-id" value="${aid}"/> 2348 <dc:attribute name="factory" value="fixanalysis"/>
2418 <dc:attribute name="ids" value="${aid}"/> 2349 <dc:attribute name="artifact-id" value="${aid}"/>
2419 <dc:attribute name="out" value="floodmap"/> 2350 <dc:attribute name="ids" value="${facet_num}"/>
2420 </dc:element> 2351 <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
2421 </dc:elements> 2352 </dc:element>
2353 </dc:for-each>
2354 </fix_longitudinal_section_curve>
2422 </dc:context> 2355 </dc:context>
2423 </dc:call-macro> 2356 </dc:call-macro>
2424 </dc:context> 2357 </dc:context>
2425 </dc:elements> 2358 </dc:for-each>
2426 </floodmap> 2359 </fix_longitudinal_section_curve>
2427 </dc:macro> 2360 </dc:macro>
2428 2361
2429 <dc:comment> 2362 <dc:comment>
2430 MINFO bedheight difference 2363 MINFO bedheight middle
2431 </dc:comment> 2364 </dc:comment>
2432 2365
2433 <dc:macro name="bed-difference"> 2366 <dc:macro name="bed-height">
2434 <fix_longitudinal_section_curve> 2367 <fix_vollmer_wq_curve>
2435 <dc:elements> 2368 <dc:for-each>
2436 <dc:context> 2369 <dc:context>
2437 <dc:call-macro name="range-filter"> 2370 <dc:call-macro name="range-filter">
2438 <dc:context> 2371 <dc:context>
2439 <dc:statement> 2372 <dc:statement>
2440 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description 2373 SELECT a.gid AS aid,
2441 FROM outs as o, facets as f, artifacts as a 2374 f.id AS fid,
2442 WHERE (f.name = 'fix_sector_average_ls_0' or f.name = 'fix_sector_average_ls_1' or f.name = 'fix_sector_average_ls_2' 2375 f.name AS facet_name,
2443 or f.name = 'fix_sector_average_ls_3' or f.name = 'fix_analysis_events_ls' or f.name = 'fix_reference_events_ls') 2376 f.num AS facet_num,
2444 and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} 2377 f.description AS facet_description
2378 FROM outs AS o, facets AS f, artifacts AS a
2379 WHERE (
2380 f.name = 'longitudinal_section.w' OR
2381 f.name = 'heightmarks_points'
2382 ) AND f.out_id = o.id AND o.artifact_id = ${a_id} AND a.id = ${a_id}
2445 </dc:statement> 2383 </dc:statement>
2446 <fix_longitudinal_section_curve> 2384 <fix_vollmer_wq_curve description="{$river} {$a_creation} {$collection_name}">
2447 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/> 2385 <dc:for-each>
2448 <dc:elements>
2449 <dc:element name="${facet_name}"> 2386 <dc:element name="${facet_name}">
2450 <dc:attribute name="description" value="${facet_description}"/> 2387 <dc:attribute name="description" value="${facet_description}"/>
2451 <dc:attribute name="factory" value="fixanalysis"/> 2388 <dc:attribute name="factory" value="fixanalysis"/>
2452 <dc:attribute name="artifact-id" value="${aid}"/> 2389 <dc:attribute name="artifact-id" value="${aid}"/>
2453 <dc:attribute name="ids" value="${facet_num}"/> 2390 <dc:attribute name="ids" value="${facet_num}"/>
2454 <dc:attribute name="out" value="fix_longitudinal_section_curve"/> 2391 <dc:attribute name="out" value="longitudinal_section"/>
2455 </dc:element> 2392 </dc:element>
2456 </dc:elements> 2393 </dc:for-each>
2457 </fix_longitudinal_section_curve> 2394 </fix_vollmer_wq_curve>
2458 </dc:context> 2395 </dc:context>
2459 </dc:call-macro> 2396 </dc:call-macro>
2460 </dc:context> 2397 </dc:context>
2461 </dc:elements> 2398 </dc:for-each>
2462 </fix_longitudinal_section_curve> 2399 </fix_vollmer_wq_curve>
2463 </dc:macro> 2400 </dc:macro>
2464 2401
2465 <dc:comment> 2402 <dc:macro name="floodmap-hws-user">
2466 MINFO bedheight middle 2403 <dc:context>
2467 </dc:comment> 2404 <dc:statement>
2468 2405 SELECT id AS out_id
2469 <dc:macro name="bed-height"> 2406 FROM outs
2470 <fix_vollmer_wq_curve> 2407 WHERE artifact_id = ${a_id} AND name = 'floodmap'
2471 <dc:elements> 2408 </dc:statement>
2472 <dc:context> 2409 <dc:for-each>
2473 <dc:call-macro name="range-filter">
2474 <dc:context>
2475 <dc:statement>
2476 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description
2477 FROM outs as o, facets as f, artifacts as a
2478 WHERE (f.name = 'longitudinal_section.w' or f.name = 'heightmarks_points')
2479 and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
2480 </dc:statement>
2481 <fix_vollmer_wq_curve>
2482 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
2483 <dc:elements>
2484 <dc:element name="${facet_name}">
2485 <dc:attribute name="description" value="${facet_description}"/>
2486 <dc:attribute name="factory" value="fixanalysis"/>
2487 <dc:attribute name="artifact-id" value="${aid}"/>
2488 <dc:attribute name="ids" value="${facet_num}"/>
2489 <dc:attribute name="out" value="longitudinal_section"/>
2490 </dc:element>
2491 </dc:elements>
2492 </fix_vollmer_wq_curve>
2493 </dc:context>
2494 </dc:call-macro>
2495 </dc:context>
2496 </dc:elements>
2497 </fix_vollmer_wq_curve>
2498 </dc:macro>
2499
2500 <dc:macro name="floodmap-hws-user">
2501 <dc:context> 2410 <dc:context>
2502 <dc:statement> 2411 <dc:statement>
2503 SELECT id AS out_id 2412 SELECT name AS facet_name,
2504 FROM outs 2413 num AS facet_num,
2505 WHERE artifact_id = ${a_id} AND name = 'floodmap' 2414 description AS facet_description
2415 FROM facets
2416 WHERE out_id = ${out_id} AND name = 'floodmap.usershape'
2417 ORDER BY num ASC, name DESC
2506 </dc:statement> 2418 </dc:statement>
2507 <dc:elements> 2419 <own-hws>
2508 <dc:context> 2420 <dc:for-each>
2509 <dc:statement> 2421 <dc:element name="${facet_name}">
2510 SELECT name AS facet_name, num as facet_num, description AS facet_description 2422 <dc:attribute name="description" value="${facet_description}"/>
2511 FROM facets 2423 <dc:attribute name="ids" value="${facet_num}"/>
2512 WHERE out_id = ${out_id} and name = 'floodmap.usershape' 2424 <dc:attribute name="factory" value="winfo"/>
2513 ORDER BY num ASC, name DESC 2425 <dc:attribute name="artifact-id" value="${a_gid}"/>
2514 </dc:statement> 2426 <dc:attribute name="out" value="floodmap"/>
2515 <own-hws> 2427 </dc:element>
2516 <dc:elements> 2428 </dc:for-each>
2517 <dc:element name="${facet_name}"> 2429 </own-hws>
2518 <dc:attribute name="description" value="${facet_description}"/>
2519 <dc:attribute name="ids" value="${facet_num}"/>
2520 <dc:attribute name="factory" value="winfo"/>
2521 <dc:attribute name="artifact-id" value="${a_gid}"/>
2522 <dc:attribute name="out" value="floodmap"/>
2523 </dc:element>
2524 </dc:elements>
2525 </own-hws>
2526 </dc:context>
2527 </dc:elements>
2528 </dc:context> 2430 </dc:context>
2529 </dc:macro> 2431 </dc:for-each>
2530 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))"> 2432 </dc:context>
2531 <dc:call-macro name="longitudinal"/> 2433 </dc:macro>
2532 </dc:if> 2434
2533 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')"> 2435 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))">
2534 <dc:call-macro name="delta-wt"/> 2436 <dc:call-macro name="longitudinal"/>
2535 </dc:if> 2437 </dc:if>
2536 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))"> 2438 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')">
2537 <dc:call-macro name="differences"/> 2439 <dc:call-macro name="delta-wt"/>
2538 </dc:if> 2440 </dc:if>
2539 <dc:if test="dc:contains($artifact-outs, 'reference_curve')"> 2441 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))">
2540 <dc:call-macro name="reference-curves"/> 2442 <dc:call-macro name="differences"/>
2541 </dc:if> 2443 </dc:if>
2542 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> 2444 <dc:if test="dc:contains($artifact-outs, 'reference_curve')">
2543 <dc:call-macro name="computed-discharge-curve"/> 2445 <dc:call-macro name="reference-curves"/>
2544 </dc:if> 2446 </dc:if>
2545 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> 2447 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
2546 <dc:call-macro name="waterlevels"/> 2448 <dc:call-macro name="computed-discharge-curve"/>
2547 </dc:if> 2449 </dc:if>
2548 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> 2450 <dc:if test="dc:contains($artifact-outs, 'cross_section')">
2549 <dc:call-macro name="longitudinal-section"/> 2451 <dc:call-macro name="waterlevels"/>
2550 </dc:if> 2452 </dc:if>
2551 <dc:if test="dc:contains($artifact-outs, 'fix_derivate_curve')"> 2453 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')">
2552 <dc:call-macro name="fix-derivate-curve"/> 2454 <dc:call-macro name="longitudinal-section"/>
2553 </dc:if> 2455 </dc:if>
2554 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> 2456 <dc:if test="dc:contains($artifact-outs, 'fix_derivate_curve')">
2555 <dc:call-macro name="fix-wq-curve"/> 2457 <dc:call-macro name="fix-derivate-curve"/>
2556 </dc:if> 2458 </dc:if>
2557 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> 2459 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')">
2558 <dc:call-macro name="duration-curve"/> 2460 <dc:call-macro name="fix-wq-curve"/>
2559 </dc:if> 2461 </dc:if>
2560 <dc:if test="dc:contains($artifact-outs, 'waterlevels') or (dc:contains($artifact-outs, 'fix_wq_curve'))"> 2462 <dc:if test="dc:contains($artifact-outs, 'duration_curve')">
2561 <dc:call-macro name="waterlevels-fix"/> 2463 <dc:call-macro name="duration-curve"/>
2562 </dc:if> 2464 </dc:if>
2563 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')"> 2465 <dc:if test="dc:contains($artifact-outs, 'waterlevels') or (dc:contains($artifact-outs, 'fix_wq_curve'))">
2564 <dc:call-macro name="flood-map"/> 2466 <dc:call-macro name="waterlevels-fix"/>
2565 </dc:if> 2467 </dc:if>
2566 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year') or dc:contains($artifact-outs, 'bed_difference_height_year')"> 2468 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')">
2567 <dc:call-macro name="bed-difference"/> 2469 <dc:call-macro name="flood-map"/>
2568 </dc:if> 2470 </dc:if>
2569 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> 2471 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year') or dc:contains($artifact-outs, 'bed_difference_height_year')">
2570 <dc:call-macro name="bed-height"/> 2472 <dc:call-macro name="bed-difference"/>
2571 </dc:if> 2473 </dc:if>
2572 <dc:if test="dc:contains($artifact-outs, 'floodmap-hws')"> 2474 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')">
2573 <dc:call-macro name="floodmap-hws-user"/> 2475 <dc:call-macro name="bed-height"/>
2574 </dc:if> 2476 </dc:if>
2575 </dc:context> 2477 <dc:if test="dc:contains($artifact-outs, 'floodmap-hws')">
2576 </dc:call-macro> 2478 <dc:call-macro name="floodmap-hws-user"/>
2479 </dc:if>
2480 </dc:context>
2481 </dc:call-macro>
2577 2482
2578 </old_calculations> 2483 </old_calculations>
2579 2484
2580 2485 <dc:if test="dc:contains($parameters,'load-system')">
2486 <dc:comment>
2487 Include System specific part when 'load-system' is in parameters.
2488 -----------------------------------------------------------------
2489 </dc:comment>
2490 <dc:call-macro name="load-system"/>
2491 </dc:if>
2492 </dc:when>
2493
2494 <dc:otherwise>
2581 <dc:comment> 2495 <dc:comment>
2582 Include System specific part when 'load-system' is in parameters. 2496 Include System specific part only if no user ID is given.
2583 ----------------------------------------------------------------- 2497 ---------------------------------------------------------
2584 </dc:comment> 2498 </dc:comment>
2585 <dc:choose> 2499 <dc:call-macro name="load-system"/>
2586 <dc:when test="dc:contains($parameters,'load-system')">
2587 <dc:call-macro name="load-system"/>
2588 </dc:when>
2589 </dc:choose>
2590 </dc:when>
2591
2592
2593 <dc:comment>
2594 Include System specific part only if no user ID is given.
2595 ---------------------------------------------------------
2596 </dc:comment>
2597 <dc:otherwise>
2598 <dc:call-macro name="load-system"/>
2599 </dc:otherwise> 2500 </dc:otherwise>
2600 </dc:choose> 2501 </dc:choose>
2502
2601 </datacage> 2503 </datacage>
2602 </dc:template> 2504 </dc:template>

http://dive4elements.wald.intevation.org