comparison artifacts/doc/conf/meta-data.xml @ 8941:a9950a3a71e5

SINFO - tkh, configured result facets and themes Configured datacages
author gernotbelger
date Wed, 07 Mar 2018 17:36:04 +0100
parents 5d5d0051723f
children b0aeed4c97c1
comparison
equal deleted inserted replaced
8940:82998242ba84 8941:a9950a3a71e5
115 </dc:when> 115 </dc:when>
116 <dc:comment> Maps </dc:comment> 116 <dc:comment> Maps </dc:comment>
117 <dc:when test="$out = 'floodmap'"> 117 <dc:when test="$out = 'floodmap'">
118 <dc:call-macro name="flood-map-recommended"/> 118 <dc:call-macro name="flood-map-recommended"/>
119 </dc:when> 119 </dc:when>
120 120
121 <dc:when test="$out = 'sinfo_flow_depth'"> 121 <dc:when test="$out = 'sinfo_flow_depth'">
122 <dc:call-macro name="annotations"/> 122 <dc:call-macro name="annotations"/>
123 </dc:when> 123 </dc:when>
124 <dc:when test="$out = 'sinfo_tkk'"> 124 <dc:when test="$out = 'sinfo_tkk'">
125 <dc:call-macro name="annotations"/> 125 <dc:call-macro name="annotations"/>
260 <dc:call-macro name="basedata_1_additionals"/> 260 <dc:call-macro name="basedata_1_additionals"/>
261 <dc:call-macro name="basedata_2_fixations"/> 261 <dc:call-macro name="basedata_2_fixations"/>
262 <dc:call-macro name="basedata_4_heightmarks-points"/> 262 <dc:call-macro name="basedata_4_heightmarks-points"/>
263 <dc:call-macro name="basedata_5_flood-protections"/> 263 <dc:call-macro name="basedata_5_flood-protections"/>
264 </dc:when> 264 </dc:when>
265 265
266 <dc:when test="$out = 'sinfo_flow_depth'"> 266 <dc:when test="$out = 'sinfo_flow_depth'">
267 <!-- FIXME: chcck -->
268 <dc:call-macro name="longitudinal-section-prototype"/> 267 <dc:call-macro name="longitudinal-section-prototype"/>
269 </dc:when> 268 </dc:when>
270 269
270 <dc:when test="$out = 'sinfo_tkk'">
271 <dc:call-macro name="longitudinal-section-prototype"/>
272 </dc:when>
271 </dc:choose> 273 </dc:choose>
272 </dc:iterate> 274 </dc:iterate>
273 </dc:otherwise> 275 </dc:otherwise>
274 </dc:choose> 276 </dc:choose>
275 </dc:call-macro> 277 </dc:call-macro>
349 <dc:call-macro name="longitudinal-section-user-prototype"/> 351 <dc:call-macro name="longitudinal-section-user-prototype"/>
350 </dc:when> 352 </dc:when>
351 <dc:when test="$out = 'sinfo_flow_depth'"> 353 <dc:when test="$out = 'sinfo_flow_depth'">
352 <dc:call-macro name="longitudinal-section-user-prototype"/> 354 <dc:call-macro name="longitudinal-section-user-prototype"/>
353 </dc:when> 355 </dc:when>
356 <dc:when test="$out = 'sinfo_tkk'">
357 <dc:call-macro name="longitudinal-section-user-prototype"/>
358 </dc:when>
354 <dc:comment> Discharge curves </dc:comment> 359 <dc:comment> Discharge curves </dc:comment>
355 <dc:when test="$out = 'computed_discharge_curve'"> 360 <dc:when test="$out = 'computed_discharge_curve'">
356 <dc:call-macro name="discharge-curve-user-prototype"/> 361 <dc:call-macro name="discharge-curve-user-prototype"/>
357 </dc:when> 362 </dc:when>
358 <dc:when test="$out = 'fix_derivate_curve'"> 363 <dc:when test="$out = 'fix_derivate_curve'">
746 <dc:call-macro name="collection-group"> 751 <dc:call-macro name="collection-group">
747 <waterlevels description="{dc:group-key()}"> 752 <waterlevels description="{dc:group-key()}">
748 <dc:for-each> 753 <dc:for-each>
749 <dc:choose> 754 <dc:choose>
750 <dc:when test="$ld_m = 'location'"> 755 <dc:when test="$ld_m = 'location'">
751 <dc:variable name="combined_desc" 756 <dc:variable name="combined_desc" expr="concat($facet_description,
752 expr="concat($facet_description,
753 ' an KM ', $deffrom)"/> 757 ' an KM ', $deffrom)"/>
754 </dc:when> 758 </dc:when>
755 <dc:otherwise> 759 <dc:otherwise>
756 <dc:variable name="combined_desc" 760 <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ',
757 expr="concat($facet_description, ' von KM ',
758 $deffrom, ' bis KM ', $defto)"/> 761 $deffrom, ' bis KM ', $defto)"/>
759 </dc:otherwise> 762 </dc:otherwise>
760 </dc:choose> 763 </dc:choose>
761 <dc:element name="${facet_name}"> 764 <dc:element name="${facet_name}">
762 <dc:attribute name="description" value="${combined_desc}"/> 765 <dc:attribute name="description" value="${combined_desc}"/>
772 </waterlevels> 775 </waterlevels>
773 </dc:if> 776 </dc:if>
774 </dc:filter> 777 </dc:filter>
775 </dc:macro> 778 </dc:macro>
776 779
777 <dc:comment comment="For building differences." /> 780 <dc:comment comment="For building differences."/>
778 <dc:macro name="differences-fix"> 781 <dc:macro name="differences-fix">
779 <dc:comment comment="Vollmer curves need own factory"/> 782 <dc:comment comment="Vollmer curves need own factory"/>
780 <dc:filter expr="$a_state = 'state.fix.vollmer.compute' and $facet_name = 'longitudinal_section.w'"> 783 <dc:filter expr="$a_state = 'state.fix.vollmer.compute' and $facet_name = 'longitudinal_section.w'">
781 <dc:if test="dc:has-result()"> 784 <dc:if test="dc:has-result()">
782 <vollmer_waterlevels> 785 <vollmer_waterlevels>
789 </dc:when> 792 </dc:when>
790 <dc:otherwise> 793 <dc:otherwise>
791 <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ', 794 <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ',
792 $deffrom, ' bis KM ', $defto)"/> 795 $deffrom, ' bis KM ', $defto)"/>
793 </dc:otherwise> 796 </dc:otherwise>
794 </dc:choose> 797 </dc:choose>
795 <dc:element name="${facet_name}"> 798 <dc:element name="${facet_name}">
796 <dc:attribute name="description" value="${combined_desc}"/> 799 <dc:attribute name="description" value="${combined_desc}"/>
797 <dc:attribute name="ids" value="${facet_num}"/> 800 <dc:attribute name="ids" value="${facet_num}"/>
798 <dc:attribute name="factory" value="fixanalysis"/> 801 <dc:attribute name="factory" value="fixanalysis"/>
799 <dc:attribute name="target_out" value="${out}"/> 802 <dc:attribute name="target_out" value="${out}"/>
809 <dc:filter expr="not($a_state = 'state.fix.vollmer.compute') and (($out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w') and 812 <dc:filter expr="not($a_state = 'state.fix.vollmer.compute') and (($out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w') and
810 (not ($current-state-id = 'state.winfo.uesk.wsp' and $ld_m = 'location')))"> 813 (not ($current-state-id = 'state.winfo.uesk.wsp' and $ld_m = 'location')))">
811 <dc:if test="dc:has-result()"> 814 <dc:if test="dc:has-result()">
812 <waterlevels> 815 <waterlevels>
813 <dc:call-macro name="collection-group"> 816 <dc:call-macro name="collection-group">
814 <waterlevels description="{dc:group-key()}"> 817 <waterlevels description="{dc:group-key()}">
815 <dc:for-each> 818 <dc:for-each>
816 <dc:choose> 819 <dc:choose>
817 <dc:when test="$ld_m = 'location'"> 820 <dc:when test="$ld_m = 'location'">
818 <dc:variable name="combined_desc" expr="concat($facet_description, ' an KM ', $deffrom)"/> 821 <dc:variable name="combined_desc" expr="concat($facet_description, ' an KM ', $deffrom)"/>
819 </dc:when> 822 </dc:when>
820 <dc:otherwise> 823 <dc:otherwise>
821 <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ', 824 <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ',
822 $deffrom, ' bis KM ', $defto)"/> 825 $deffrom, ' bis KM ', $defto)"/>
823 </dc:otherwise> 826 </dc:otherwise>
824 </dc:choose> 827 </dc:choose>
825 <dc:element name="${facet_name}"> 828 <dc:element name="${facet_name}">
826 <dc:attribute name="description" value="${combined_desc}"/> 829 <dc:attribute name="description" value="${combined_desc}"/>
827 <dc:attribute name="ids" value="${facet_num}"/> 830 <dc:attribute name="ids" value="${facet_num}"/>
828 <dc:attribute name="factory" value="winfo"/> 831 <dc:attribute name="factory" value="winfo"/>
829 <dc:attribute name="target_out" value="${out}"/> 832 <dc:attribute name="target_out" value="${out}"/>
830 <dc:attribute name="artifact-id" value="${a_gid}"/> 833 <dc:attribute name="artifact-id" value="${a_gid}"/>
831 <dc:attribute name="out" value="longitudinal_section"/> 834 <dc:attribute name="out" value="longitudinal_section"/>
832 </dc:element> 835 </dc:element>
833 </dc:for-each> 836 </dc:for-each>
834 </waterlevels> 837 </waterlevels>
835 </dc:call-macro> 838 </dc:call-macro>
836 </waterlevels> 839 </waterlevels>
837 </dc:if> 840 </dc:if>
838 </dc:filter> 841 </dc:filter>
839 </dc:macro> 842 </dc:macro>
975 </dc:if> 978 </dc:if>
976 </dc:filter> 979 </dc:filter>
977 </dc:macro> 980 </dc:macro>
978 981
979 <dc:macro name="sqrelations_user"> 982 <dc:macro name="sqrelations_user">
980 <dc:filter expr="not(dc:contains($facet_name, 'overview')) and ( 983 <dc:filter
984 expr="not(dc:contains($facet_name, 'overview')) and (
981 ($out = 'sq_relation_a' and starts-with($facet_name, 'sq_a_')) or 985 ($out = 'sq_relation_a' and starts-with($facet_name, 'sq_a_')) or
982 ($out = 'sq_relation_b' and starts-with($facet_name, 'sq_b_')) or 986 ($out = 'sq_relation_b' and starts-with($facet_name, 'sq_b_')) or
983 ($out = 'sq_relation_c' and starts-with($facet_name, 'sq_c_')) or 987 ($out = 'sq_relation_c' and starts-with($facet_name, 'sq_c_')) or
984 ($out = 'sq_relation_d' and starts-with($facet_name, 'sq_d_')) or 988 ($out = 'sq_relation_d' and starts-with($facet_name, 'sq_d_')) or
985 ($out = 'sq_relation_e' and starts-with($facet_name, 'sq_e_')) or 989 ($out = 'sq_relation_e' and starts-with($facet_name, 'sq_e_')) or
1043 </dc:macro> 1047 </dc:macro>
1044 1048
1045 <!-- discharge curves --> 1049 <!-- discharge curves -->
1046 <dc:macro name="hist_discharge_factory"> 1050 <dc:macro name="hist_discharge_factory">
1047 <dc:for-each> 1051 <dc:for-each>
1048 <dc:variable name="validity" 1052 <dc:variable name="validity" expr="concat(
1049 expr="concat(
1050 dc:date-format('dd.MM.yyyy', $start_time), 1053 dc:date-format('dd.MM.yyyy', $start_time),
1051 ' - ', 1054 ' - ',
1052 dc:date-format('dd.MM.yyyy', $stop_time))"/> 1055 dc:date-format('dd.MM.yyyy', $stop_time))"/>
1053 <histdis name="{concat($bfg_id, ' ', $validity)}" 1056 <histdis name="{concat($bfg_id, ' ', $validity)}" description="{concat($bfg_id, ' ', $validity)}" factory="gaugedischarge" target_out="{$out}" ids="{$gauge_name};{$dt_id};{concat($bfg_id, ' ',
1054 description="{concat($bfg_id, ' ', $validity)}"
1055 factory="gaugedischarge" target_out="{$out}"
1056 ids="{$gauge_name};{$dt_id};{concat($bfg_id, ' ',
1057 $gauge_name, ' ', $validity)}"/> 1057 $gauge_name, ' ', $validity)}"/>
1058 </dc:for-each> 1058 </dc:for-each>
1059 </dc:macro> 1059 </dc:macro>
1060 1060
1061 <dc:macro name="hist_discharge_rec"> 1061 <dc:macro name="hist_discharge_rec">
1062 <dc:variable name="start" type="number" 1062 <dc:variable name="start" type="number" expr="dc:date-format('yyyyMMdd',
1063 expr="dc:date-format('yyyyMMdd',
1064 number(substring-before($year_range, ';')))"/> 1063 number(substring-before($year_range, ';')))"/>
1065 <dc:variable name="stop" type="number" 1064 <dc:variable name="stop" type="number" expr="dc:date-format('yyyyMMdd',
1066 expr="dc:date-format('yyyyMMdd',
1067 number(substring-after($year_range, ';')))"/> 1065 number(substring-after($year_range, ';')))"/>
1068 <dc:call-macro name="discharge_curve_choose_context"> 1066 <dc:call-macro name="discharge_curve_choose_context">
1069 <dc:filter expr="$kind = 1 and 1067 <dc:filter expr="$kind = 1 and
1070 number(dc:date-format('yyyyMMdd', $start_time)) 1068 number(dc:date-format('yyyyMMdd', $start_time))
1071 &lt; $stop and 1069 &lt; $stop and
1082 <dc:call-macro name="discharge_curve_choose_context"> 1080 <dc:call-macro name="discharge_curve_choose_context">
1083 <dc:filter expr="$kind = 0"> 1081 <dc:filter expr="$kind = 0">
1084 <dc:group expr="$gauge_name"> 1082 <dc:group expr="$gauge_name">
1085 <gauge name="{dc:group-key()}"> 1083 <gauge name="{dc:group-key()}">
1086 <dc:for-each> 1084 <dc:for-each>
1087 <current_gauge factory="gaugedischarge" target_out="{$out}" 1085 <current_gauge factory="gaugedischarge" target_out="{$out}" ids="{$gauge_name}"/>
1088 ids="{$gauge_name}"/>
1089 </dc:for-each> 1086 </dc:for-each>
1090 </gauge> 1087 </gauge>
1091 </dc:group> 1088 </dc:group>
1092 </dc:filter> 1089 </dc:filter>
1093 </dc:call-macro> 1090 </dc:call-macro>
1114 <dc:call-macro name="discharge_curves_km"/> 1111 <dc:call-macro name="discharge_curves_km"/>
1115 <dc:macro-body/> 1112 <dc:macro-body/>
1116 </dc:context> 1113 </dc:context>
1117 </dc:when> 1114 </dc:when>
1118 <dc:otherwise> 1115 <dc:otherwise>
1119 <dc:variable name="refgauge" type="number" 1116 <dc:variable name="refgauge" type="number" expr="dc:get('reference_gauge')"/>
1120 expr="dc:get('reference_gauge')"/>
1121 <dc:context> 1117 <dc:context>
1122 <dc:call-macro name="discharge_curves_refgauge"/> 1118 <dc:call-macro name="discharge_curves_refgauge"/>
1123 <dc:macro-body/> 1119 <dc:macro-body/>
1124 </dc:context> 1120 </dc:context>
1125 </dc:otherwise> 1121 </dc:otherwise>
1126 </dc:choose> 1122 </dc:choose>
1127 </dc:macro> 1123 </dc:macro>
1128 1124
1129 <dc:macro name="discharge_curves_km"> 1125 <dc:macro name="discharge_curves_km">
1130 <dc:statement> 1126 <dc:statement>
1131 SELECT g.name AS gauge_name, 1127 SELECT g.name AS gauge_name,
1132 dt.id AS dt_id, 1128 dt.id AS dt_id,
1133 t.start_time AS start_time, 1129 t.start_time AS start_time,
1134 t.stop_time AS stop_time, 1130 t.stop_time AS stop_time,
1135 dt.bfg_id AS bfg_id, 1131 dt.bfg_id AS bfg_id,
1136 dt.kind AS kind 1132 dt.kind AS kind
1137 FROM gauges g 1133 FROM gauges g
1138 JOIN discharge_tables dt ON g.id = dt.gauge_id 1134 JOIN discharge_tables dt ON g.id = dt.gauge_id
1139 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id 1135 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
1140 WHERE g.river_id = ${river_id} 1136 WHERE g.river_id = ${river_id}
1141 AND g.station BETWEEN ${fromkm} AND ${tokm} 1137 AND g.station BETWEEN ${fromkm} AND ${tokm}
1142 ORDER BY start_time 1138 ORDER BY start_time
1143 </dc:statement> 1139 </dc:statement>
1144 </dc:macro> 1140 </dc:macro>
1145 1141
1146 <dc:macro name="discharge_curves_refgauge"> 1142 <dc:macro name="discharge_curves_refgauge">
1147 <dc:statement> 1143 <dc:statement>
1148 SELECT g.name AS gauge_name, 1144 SELECT g.name AS gauge_name,
1149 dt.id AS dt_id, 1145 dt.id AS dt_id,
1150 t.start_time AS start_time, 1146 t.start_time AS start_time,
1151 t.stop_time AS stop_time, 1147 t.stop_time AS stop_time,
1152 dt.bfg_id AS bfg_id, 1148 dt.bfg_id AS bfg_id,
1153 dt.kind AS kind 1149 dt.kind AS kind
1154 FROM gauges g 1150 FROM gauges g
1155 JOIN discharge_tables dt ON g.id = dt.gauge_id 1151 JOIN discharge_tables dt ON g.id = dt.gauge_id
1156 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id 1152 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
1157 WHERE g.river_id = ${river_id} 1153 WHERE g.river_id = ${river_id}
1158 AND g.official_number = ${refgauge} 1154 AND g.official_number = ${refgauge}
1159 ORDER BY start_time 1155 ORDER BY start_time
1160 </dc:statement> 1156 </dc:statement>
1161 </dc:macro> 1157 </dc:macro>
1162 1158
1163 <!-- Cross sections --> 1159 <!-- Cross sections -->
1164 <dc:macro name="cross_sections"> 1160 <dc:macro name="cross_sections">
1165 <cross_sections id="flood-protections-{$river_id}"> 1161 <cross_sections id="flood-protections-{$river_id}">
1166 <dc:context connection="system"> 1162 <dc:context connection="system">
1167 <dc:statement> 1163 <dc:statement>
1168 SELECT DISTINCT 1164 SELECT DISTINCT
1169 cs.id AS prot_id, 1165 cs.id AS prot_id,
1170 cs.description AS prot_description 1166 cs.description AS prot_description
1171 FROM cross_sections cs 1167 FROM cross_sections cs
1172 JOIN cross_section_lines csl ON csl.cross_section_id = cs.id 1168 JOIN cross_section_lines csl ON csl.cross_section_id = cs.id
1173 WHERE cs.river_id = ${river_id} 1169 WHERE cs.river_id = ${river_id}
1174 AND csl.km BETWEEN ${fromkm} AND ${tokm} 1170 AND csl.km BETWEEN ${fromkm} AND ${tokm}
1175 </dc:statement> 1171 </dc:statement>
1176 <dc:for-each> 1172 <dc:for-each>
1177 <cross_section name="{$prot_description}" 1173 <cross_section name="{$prot_description}" ids="{$prot_id}" factory="crosssections" target_out="{$out}"/>
1178 ids="{$prot_id}"
1179 factory="crosssections" target_out="{$out}" />
1180 </dc:for-each> 1174 </dc:for-each>
1181 </dc:context> 1175 </dc:context>
1182 </cross_sections> 1176 </cross_sections>
1183 </dc:macro> 1177 </dc:macro>
1184 1178
1185 <dc:macro name="hyks"> 1179 <dc:macro name="hyks">
1186 <hyks id="hyk-{$river_id}"> 1180 <hyks id="hyk-{$river_id}">
1187 <dc:context connection="system"> 1181 <dc:context connection="system">
1188 <dc:statement> 1182 <dc:statement>
1189 SELECT DISTINCT 1183 SELECT DISTINCT
1190 h.id AS hyk_id, 1184 h.id AS hyk_id,
1191 h.description AS hyk_description 1185 h.description AS hyk_description
1192 FROM hyks h 1186 FROM hyks h
1193 JOIN hyk_entries he ON he.hyk_id = h.id 1187 JOIN hyk_entries he ON he.hyk_id = h.id
1194 WHERE river_id = ${river_id} 1188 WHERE river_id = ${river_id}
1195 AND he.km BETWEEN ${fromkm} AND ${tokm} 1189 AND he.km BETWEEN ${fromkm} AND ${tokm}
1196 </dc:statement> 1190 </dc:statement>
1197 <dc:for-each> 1191 <dc:for-each>
1198 <hyk name="{$hyk_description}" 1192 <hyk name="{$hyk_description}" ids="{$hyk_id}" factory="hyk" target_out="{$out}"/>
1199 ids="{$hyk_id}"
1200 factory="hyk" target_out="{$out}" />
1201 </dc:for-each> 1193 </dc:for-each>
1202 </dc:context> 1194 </dc:context>
1203 </hyks> 1195 </hyks>
1204 </dc:macro> 1196 </dc:macro>
1205 1197
1223 </dc:filter> 1215 </dc:filter>
1224 </dc:macro> 1216 </dc:macro>
1225 1217
1226 <dc:macro name="basedata_0"> 1218 <dc:macro name="basedata_0">
1227 <dc:call-macro name="basedata_0_macro"> 1219 <dc:call-macro name="basedata_0_macro">
1228 <column name="{$wst_column_name}" 1220 <column name="{$wst_column_name}" ids="base_data-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1229 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
1230 factory="staticwqkms" target_out="{$out}"
1231 info="{$info} [km {$deffrom} - {$defto}]"/>
1232 </dc:call-macro> 1221 </dc:call-macro>
1233 </dc:macro> 1222 </dc:macro>
1234 1223
1235 <dc:macro name="basedata_0_wq"> 1224 <dc:macro name="basedata_0_wq">
1236 <dc:call-macro name="basedata_0_macro"> 1225 <dc:call-macro name="basedata_0_macro">
1237 <column name="{$wst_column_name}" 1226 <column name="{$wst_column_name}" ids="base_data-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1238 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
1239 factory="wqinterpol" target_out="{$out}"
1240 info="{$info} [km {$deffrom} - {$defto}]"/>
1241 </dc:call-macro> 1227 </dc:call-macro>
1242 </dc:macro> 1228 </dc:macro>
1243 1229
1244 <!-- additional longitudinal sections --> 1230 <!-- additional longitudinal sections -->
1245 <dc:macro name="basedata_1_additionals_macro"> 1231 <dc:macro name="basedata_1_additionals_macro">
1258 </dc:filter> 1244 </dc:filter>
1259 </dc:macro> 1245 </dc:macro>
1260 1246
1261 <dc:macro name="basedata_1_additionals"> 1247 <dc:macro name="basedata_1_additionals">
1262 <dc:call-macro name="basedata_1_additionals_macro"> 1248 <dc:call-macro name="basedata_1_additionals_macro">
1263 <column name="{$wst_column_name}" 1249 <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1264 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1265 factory="staticwqkms" target_out="{$out}"
1266 info="{$info} [km {$deffrom} - {$defto}]"/>
1267 </dc:call-macro> 1250 </dc:call-macro>
1268 </dc:macro> 1251 </dc:macro>
1269 1252
1270 <dc:macro name="basedata_1_additionals_wq"> 1253 <dc:macro name="basedata_1_additionals_wq">
1271 <dc:call-macro name="basedata_1_additionals_macro"> 1254 <dc:call-macro name="basedata_1_additionals_macro">
1272 <column name="{$wst_column_name}" 1255 <column name="{$wst_column_name}" ids="base_data-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1273 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
1274 factory="wqinterpol" target_out="{$out}"
1275 info="{$info} [km {$deffrom} - {$defto}]"/>
1276 </dc:call-macro> 1256 </dc:call-macro>
1277 </dc:macro> 1257 </dc:macro>
1278 1258
1279 <dc:macro name="basedata_1_additionals-relative_point"> 1259 <dc:macro name="basedata_1_additionals-relative_point">
1280 <dc:call-macro name="basedata_1_additionals_macro"> 1260 <dc:call-macro name="basedata_1_additionals_macro">
1281 <column name="{$wst_column_name}" 1261 <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1282 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1283 factory="staticwkms" target_out="{$out}"
1284 info="{$info} [km {$deffrom} - {$defto}]"/>
1285 </dc:call-macro> 1262 </dc:call-macro>
1286 </dc:macro> 1263 </dc:macro>
1287 1264
1288 <!-- fixations --> 1265 <!-- fixations -->
1289 <dc:macro name="fixings-macro"> 1266 <dc:macro name="fixings-macro">
1302 </dc:filter> 1279 </dc:filter>
1303 </dc:macro> 1280 </dc:macro>
1304 1281
1305 <dc:macro name="basedata_2_fixations"> 1282 <dc:macro name="basedata_2_fixations">
1306 <dc:call-macro name="fixings-macro"> 1283 <dc:call-macro name="fixings-macro">
1307 <column name="{$wst_column_name}" 1284 <column name="{$wst_column_name}" ids="fixations-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1308 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
1309 factory="staticwqkms" target_out="{$out}"
1310 info="{$info} [km {$deffrom} - {$defto}]"/>
1311 </dc:call-macro> 1285 </dc:call-macro>
1312 </dc:macro> 1286 </dc:macro>
1313 1287
1314 <dc:macro name="basedata_2_fixations_wq"> 1288 <dc:macro name="basedata_2_fixations_wq">
1315 <dc:call-macro name="fixings-macro"> 1289 <dc:call-macro name="fixings-macro">
1316 <column name="{$wst_column_name}" 1290 <column name="{$wst_column_name}" ids="fixations-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1317 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
1318 factory="wqinterpol" target_out="{$out}"
1319 info="{$info} [km {$deffrom} - {$defto}]"/>
1320 </dc:call-macro> 1291 </dc:call-macro>
1321 </dc:macro> 1292 </dc:macro>
1322 1293
1323 <dc:macro name="basedata_2_fixations_relative_point"> 1294 <dc:macro name="basedata_2_fixations_relative_point">
1324 <dc:call-macro name="fixings-macro"> 1295 <dc:call-macro name="fixings-macro">
1325 <column name="{$wst_column_name}" 1296 <column name="{$wst_column_name}" ids="fixations-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1326 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
1327 factory="staticwkms" target_out="{$out}"
1328 info="{$info} [km {$deffrom} - {$defto}]"/>
1329 </dc:call-macro> 1297 </dc:call-macro>
1330 </dc:macro> 1298 </dc:macro>
1331 1299
1332 <!-- official lines --> 1300 <!-- official lines -->
1333 <dc:macro name="basedata_3_macro"> 1301 <dc:macro name="basedata_3_macro">
1346 </dc:filter> 1314 </dc:filter>
1347 </dc:macro> 1315 </dc:macro>
1348 1316
1349 <dc:macro name="basedata_3_officials"> 1317 <dc:macro name="basedata_3_officials">
1350 <dc:call-macro name="basedata_3_macro"> 1318 <dc:call-macro name="basedata_3_macro">
1351 <column name="{$wst_column_name}" 1319 <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1352 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1353 factory="staticwqkms"
1354 target_out="{$out}"
1355 info="{$info} [km {$deffrom} - {$defto}]"/>
1356 </dc:call-macro> 1320 </dc:call-macro>
1357 </dc:macro> 1321 </dc:macro>
1358 1322
1359 <dc:macro name="basedata_3_officials_wq"> 1323 <dc:macro name="basedata_3_officials_wq">
1360 <dc:call-macro name="basedata_3_macro"> 1324 <dc:call-macro name="basedata_3_macro">
1361 <column name="{$wst_column_name}" 1325 <column name="{$wst_column_name}" ids="officials_wq-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1362 ids="officials_wq-wstv-{$wst_column_position}-{$wst_id}"
1363 factory="wqinterpol"
1364 target_out="{$out}"
1365 info="{$info} [km {$deffrom} - {$defto}]"/>
1366 </dc:call-macro> 1326 </dc:call-macro>
1367 </dc:macro> 1327 </dc:macro>
1368 1328
1369 <!-- flood marks --> 1329 <!-- flood marks -->
1370 <dc:macro name="basedata_4_macro"> 1330 <dc:macro name="basedata_4_macro">
1383 </dc:filter> 1343 </dc:filter>
1384 </dc:macro> 1344 </dc:macro>
1385 1345
1386 <dc:macro name="basedata_4_heightmarks-points"> 1346 <dc:macro name="basedata_4_heightmarks-points">
1387 <dc:call-macro name="basedata_4_macro"> 1347 <dc:call-macro name="basedata_4_macro">
1388 <column name="{$wst_column_name}" 1348 <column name="{$wst_column_name}" ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1389 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
1390 factory="staticwkms" target_out="{$out}"
1391 info="{$info} [km {$deffrom} - {$defto}]"/>
1392 </dc:call-macro> 1349 </dc:call-macro>
1393 </dc:macro> 1350 </dc:macro>
1394 1351
1395 <dc:macro name="basedata_4_heightmarks-points_wq"> 1352 <dc:macro name="basedata_4_heightmarks-points_wq">
1396 <dc:call-macro name="basedata_4_macro"> 1353 <dc:call-macro name="basedata_4_macro">
1397 <column name="{$wst_column_name}" 1354 <column name="{$wst_column_name}" ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1398 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
1399 factory="wqinterpol" target_out="{$out}"
1400 info="{$info} [km {$deffrom} - {$defto}]"/>
1401 </dc:call-macro> 1355 </dc:call-macro>
1402 </dc:macro> 1356 </dc:macro>
1403 1357
1404 <dc:macro name="basedata_4_heightmarks-points-relative_points"> 1358 <dc:macro name="basedata_4_heightmarks-points-relative_points">
1405 <dc:call-macro name="basedata_4_macro"> 1359 <dc:call-macro name="basedata_4_macro">
1406 <column name="{$wst_column_name}" 1360 <column name="{$wst_column_name}" ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1407 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
1408 factory="staticwkms" target_out="{$out}"
1409 info="{$info} [km {$deffrom} - {$defto}]"/>
1410 </dc:call-macro> 1361 </dc:call-macro>
1411 </dc:macro> 1362 </dc:macro>
1412 1363
1413 <!-- flood protection structures --> 1364 <!-- flood protection structures -->
1414 <dc:macro name="basedata_5_macro"> 1365 <dc:macro name="basedata_5_macro">
1427 </dc:filter> 1378 </dc:filter>
1428 </dc:macro> 1379 </dc:macro>
1429 1380
1430 <dc:macro name="basedata_5_flood-protections"> 1381 <dc:macro name="basedata_5_flood-protections">
1431 <dc:call-macro name="basedata_5_macro"> 1382 <dc:call-macro name="basedata_5_macro">
1432 <column name="{$wst_column_name}" 1383 <column name="{$wst_column_name}" ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1433 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
1434 factory="staticwkms" target_out="{$out}"
1435 info="{$info} [km {$deffrom} - {$defto}]"/>
1436 </dc:call-macro> 1384 </dc:call-macro>
1437 </dc:macro> 1385 </dc:macro>
1438 1386
1439 <dc:macro name="basedata_5_flood-protections_wq"> 1387 <dc:macro name="basedata_5_flood-protections_wq">
1440 <dc:call-macro name="basedata_5_macro"> 1388 <dc:call-macro name="basedata_5_macro">
1441 <column name="{$wst_column_name}" 1389 <column name="{$wst_column_name}" ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1442 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
1443 factory="wqinterpol" target_out="{$out}"
1444 info="{$info} [km {$deffrom} - {$defto}]"/>
1445 </dc:call-macro> 1390 </dc:call-macro>
1446 </dc:macro> 1391 </dc:macro>
1447 1392
1448 <dc:macro name="basedata_5_flood-protections_relative_points"> 1393 <dc:macro name="basedata_5_flood-protections_relative_points">
1449 <dc:call-macro name="basedata_5_macro"> 1394 <dc:call-macro name="basedata_5_macro">
1450 <column name="{$wst_column_name}" 1395 <column name="{$wst_column_name}" ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1451 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
1452 factory="staticwkms" target_out="{$out}"
1453 info="{$info} [km {$deffrom} - {$defto}]"/>
1454 </dc:call-macro> 1396 </dc:call-macro>
1455 </dc:macro> 1397 </dc:macro>
1456 1398
1457 <!-- waterlevel differences imported from CSV-files for M-INFO --> 1399 <!-- waterlevel differences imported from CSV-files for M-INFO -->
1458 <dc:macro name="basedata_6_delta_w"> 1400 <dc:macro name="basedata_6_delta_w">
1462 <delta_w_cm> 1404 <delta_w_cm>
1463 <dc:filter expr="contains($wst_description, 'cm.csv')"> 1405 <dc:filter expr="contains($wst_description, 'cm.csv')">
1464 <dc:group expr="dc:replace($wst_description, 'CSV/', '')"> 1406 <dc:group expr="dc:replace($wst_description, 'CSV/', '')">
1465 <relativepoint name="{dc:group-key()}"> 1407 <relativepoint name="{dc:group-key()}">
1466 <dc:for-each> 1408 <dc:for-each>
1467 <column name="{$wst_column_name}" 1409 <column name="{$wst_column_name}" ids="delta_w-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1468 ids="delta_w-wstv-{$wst_column_position}-{$wst_id}"
1469 factory="staticwkms"
1470 target_out="{$out}"
1471 info="{$info} [km {$deffrom} - {$defto}]"/>
1472 </dc:for-each> 1410 </dc:for-each>
1473 </relativepoint> 1411 </relativepoint>
1474 </dc:group> 1412 </dc:group>
1475 </dc:filter> 1413 </dc:filter>
1476 </delta_w_cm> 1414 </delta_w_cm>
1477 <delta_w_cma> 1415 <delta_w_cma>
1478 <dc:filter expr="contains($wst_description, 'cm-a.csv')"> 1416 <dc:filter expr="contains($wst_description, 'cm-a.csv')">
1479 <dc:group expr="dc:replace($wst_description, 'CSV/', '')"> 1417 <dc:group expr="dc:replace($wst_description, 'CSV/', '')">
1480 <relativepoint name="{dc:group-key()}"> 1418 <relativepoint name="{dc:group-key()}">
1481 <dc:for-each> 1419 <dc:for-each>
1482 <column name="{$wst_column_name}" 1420 <column name="{$wst_column_name}" ids="delta_w_cma-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1483 ids="delta_w_cma-wstv-{$wst_column_position}-{$wst_id}"
1484 factory="staticwkms" target_out="{$out}"
1485 info="{$info} [km {$deffrom} - {$defto}]"/>
1486 </dc:for-each> 1421 </dc:for-each>
1487 </relativepoint> 1422 </relativepoint>
1488 </dc:group> 1423 </dc:group>
1489 </dc:filter> 1424 </dc:filter>
1490 </delta_w_cma> 1425 </delta_w_cma>
1510 </dc:filter> 1445 </dc:filter>
1511 </dc:macro> 1446 </dc:macro>
1512 1447
1513 <dc:macro name="basedata_7_waterlevels"> 1448 <dc:macro name="basedata_7_waterlevels">
1514 <dc:call-macro name="basedata_7_macro"> 1449 <dc:call-macro name="basedata_7_macro">
1515 <column name="{$wst_column_name}" 1450 <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1516 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1517 factory="staticwqkms" target_out="{$out}"
1518 info="{$info} [km {$deffrom} - {$defto}]"/>
1519 </dc:call-macro> 1451 </dc:call-macro>
1520 </dc:macro> 1452 </dc:macro>
1521 1453
1522 <dc:macro name="basedata_7_waterlevels_wq"> 1454 <dc:macro name="basedata_7_waterlevels_wq">
1523 <dc:call-macro name="basedata_7_macro"> 1455 <dc:call-macro name="basedata_7_macro">
1524 <column name="{$wst_column_name}" 1456 <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="wqinterpol" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]"/>
1525 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1526 factory="wqinterpol" target_out="{$out}"
1527 info="{$info} [km {$deffrom} - {$defto}]"/>
1528 </dc:call-macro> 1457 </dc:call-macro>
1529 </dc:macro> 1458 </dc:macro>
1530 1459
1531 1460
1532 <!-- prototypes --> 1461 <!-- prototypes -->
1533 1462
1534 <dc:macro name="discharge-curve-prototype"> 1463 <dc:macro name="discharge-curve-prototype">
1535 <computed_discharge_curve> 1464 <computed_discharge_curve>
1536 <dc:call-macro name="discharge_table_gauge"/> 1465 <dc:call-macro name="discharge_table_gauge"/>
1537 <dc:call-macro name="mainvalues"/> 1466 <dc:call-macro name="mainvalues"/>
1538 </computed_discharge_curve> 1467 </computed_discharge_curve>
1539 <dc:call-macro name="historical_discharge_curve"/> 1468 <dc:call-macro name="historical_discharge_curve"/>
1540 <dc:call-macro name="basedata_0_wq"/> 1469 <dc:call-macro name="basedata_0_wq"/>
1541 <dc:call-macro name="basedata_1_additionals_wq"/> 1470 <dc:call-macro name="basedata_1_additionals_wq"/>
1542 <dc:call-macro name="basedata_2_fixations_wq"/> 1471 <dc:call-macro name="basedata_2_fixations_wq"/>
1543 <dc:call-macro name="basedata_3_officials_wq"/> 1472 <dc:call-macro name="basedata_3_officials_wq"/>
1544 <dc:call-macro name="basedata_4_heightmarks-points_wq"/> 1473 <dc:call-macro name="basedata_4_heightmarks-points_wq"/>
1545 <dc:call-macro name="basedata_5_flood-protections_wq"/> 1474 <dc:call-macro name="basedata_5_flood-protections_wq"/>
1546 <minfo> 1475 <minfo>
1547 <dc:call-macro name="sqrelations"/> 1476 <dc:call-macro name="sqrelations"/>
1548 <dc:call-macro name="basedata_7_waterlevels_wq"/> 1477 <dc:call-macro name="basedata_7_waterlevels_wq"/>
1549 </minfo> 1478 </minfo>
1550 </dc:macro> 1479 </dc:macro>
1551 1480
1552 <dc:macro name="discharge-curve-user-prototype"> 1481 <dc:macro name="discharge-curve-user-prototype">
1553 <dc:call-macro name="waterlevels-user"/> 1482 <dc:call-macro name="waterlevels-user"/>
1554 <dc:call-macro name="computed-discharge-curve"/> 1483 <dc:call-macro name="computed-discharge-curve"/>
1568 <dc:call-macro name="basedata_3_officials"/> 1497 <dc:call-macro name="basedata_3_officials"/>
1569 <dc:call-macro name="basedata_4_heightmarks-points"/> 1498 <dc:call-macro name="basedata_4_heightmarks-points"/>
1570 <dc:call-macro name="basedata_5_flood-protections"/> 1499 <dc:call-macro name="basedata_5_flood-protections"/>
1571 <dc:call-macro name="annotations_per_type"/> 1500 <dc:call-macro name="annotations_per_type"/>
1572 <minfo> 1501 <minfo>
1573 <fixanalysis> 1502 <fixanalysis>
1574 <dc:call-macro name="basedata_6_delta_w"/> 1503 <dc:call-macro name="basedata_6_delta_w"/>
1575 <dc:call-macro name="basedata_7_waterlevels"/> 1504 <dc:call-macro name="basedata_7_waterlevels"/>
1576 </fixanalysis> 1505 </fixanalysis>
1577 <dc:call-macro name="sedimentloads"/> 1506 <dc:call-macro name="sedimentloads"/>
1578 <dc:call-macro name="densities"/> 1507 <dc:call-macro name="densities"/>
1579 <dc:call-macro name="minfo-heights"/> 1508 <dc:call-macro name="minfo-heights"/>
1580 <dc:call-macro name="sounding-width"/> 1509 <dc:call-macro name="sounding-width"/>
1581 <dc:call-macro name="morph_width"/> 1510 <dc:call-macro name="morph_width"/>
1582 <dc:call-macro name="porosities"/> 1511 <dc:call-macro name="porosities"/>
1583 <flow_velocities> 1512 <flow_velocities>
1584 <dc:call-macro name="flow_velocity_measurements"/> 1513 <dc:call-macro name="flow_velocity_measurements"/>
1585 <dc:call-macro name="flow_velocity_models"/> 1514 <dc:call-macro name="flow_velocity_models"/>
1586 </flow_velocities> 1515 </flow_velocities>
1587 </minfo> 1516 </minfo>
1588 </dc:macro> 1517 </dc:macro>
1589 1518
1590 <dc:macro name="longitudinal-section-user-prototype"> 1519 <dc:macro name="longitudinal-section-user-prototype">
1591 <dc:comment> WINFO/DIFF/FIX </dc:comment> 1520 <dc:comment> WINFO/DIFF/FIX </dc:comment>
1598 <dc:call-macro name="middle_bedheights"/> 1527 <dc:call-macro name="middle_bedheights"/>
1599 <dc:call-macro name="bedheight_differences"/> 1528 <dc:call-macro name="bedheight_differences"/>
1600 <dc:call-macro name="bedquality"/> 1529 <dc:call-macro name="bedquality"/>
1601 <dc:call-macro name="flow-velocity"/> 1530 <dc:call-macro name="flow-velocity"/>
1602 <dc:call-macro name="sediment-load"/> 1531 <dc:call-macro name="sediment-load"/>
1603 1532
1604 <dc:comment> SINFO </dc:comment> 1533 <dc:comment> SINFO </dc:comment>
1605 <dc:call-macro name="sinfo_flowdepths"/> 1534 <dc:call-macro name="sinfo_flowdepths"/>
1606 <dc:call-macro name="sinfo_tkh"/> 1535 <dc:call-macro name="sinfo_tkh"/>
1536
1537 <dc:call-macro name="sinfo_tkh_velocity"/>
1538 <dc:call-macro name="sinfo_tkh_d50"/>
1539 <dc:call-macro name="sinfo_tkh_tau"/>
1607 </dc:macro> 1540 </dc:macro>
1608 1541
1609 <!-- porosities --> 1542 <!-- porosities -->
1610 <dc:macro name="porosities"> 1543 <dc:macro name="porosities">
1611 <porosities> 1544 <porosities>
1612 <dc:context> 1545 <dc:context>
1613 <dc:statement> 1546 <dc:statement>
1614 SELECT DISTINCT 1547 SELECT DISTINCT
1615 p.id AS pid, 1548 p.id AS pid,
1616 p.description AS description, 1549 p.description AS description,
1617 d.lower AS depth_lower, 1550 d.lower AS depth_lower,
1618 d.upper AS depth_upper, 1551 d.upper AS depth_upper,
1619 p.description || '&lt;BR&gt;' || 1552 p.description || '&lt;BR&gt;' ||
1620 'Tiefe: ' || d.lower || ' - ' || d.upper 1553 'Tiefe: ' || d.lower || ' - ' || d.upper
1621 || ' cm &lt;BR&gt;' || 1554 || ' cm &lt;BR&gt;' ||
1622 'Zeitraum: ' AS info, 1555 'Zeitraum: ' AS info,
1623 t.start_time AS syear, 1556 t.start_time AS syear,
1624 t.stop_time AS eyear 1557 t.stop_time AS eyear
1625 FROM porosity p 1558 FROM porosity p
1626 JOIN depths d ON p.depth_id = d.id 1559 JOIN depths d ON p.depth_id = d.id
1627 JOIN time_intervals t ON p.time_interval_id=t.id 1560 JOIN time_intervals t ON p.time_interval_id=t.id
1628 WHERE p.river_id = ${river_id} 1561 WHERE p.river_id = ${river_id}
1629 ORDER BY depth_lower, depth_upper 1562 ORDER BY depth_lower, depth_upper
1630 </dc:statement> 1563 </dc:statement>
1631 <dc:if test="dc:has-result()"> 1564 <dc:if test="dc:has-result()">
1632 <dc:for-each> 1565 <dc:for-each>
1633 <porosity description="{$depth_lower}-{$depth_upper} cm" 1566 <porosity description="{$depth_lower}-{$depth_upper} cm" factory="porosity" target_out="{$out}" info="{concat($info, dc:date-format('yyyy', $syear),
1634 factory="porosity" 1567 ' - ', dc:date-format('yyyy', $eyear))}" ids="{$pid};{$description}"/>
1635 target_out="{$out}" 1568 </dc:for-each>
1636 info="{concat($info, dc:date-format('yyyy', $syear), 1569 </dc:if>
1637 ' - ', dc:date-format('yyyy', $eyear))}" 1570 </dc:context>
1638 ids="{$pid};{$description}" />
1639 </dc:for-each>
1640 </dc:if>
1641 </dc:context>
1642 </porosities> 1571 </porosities>
1643 </dc:macro> 1572 </dc:macro>
1644 1573
1645 <dc:macro name="densities"> 1574 <dc:macro name="densities">
1646 <densities> 1575 <densities>
1647 <dc:context> 1576 <dc:context>
1648 <dc:statement> 1577 <dc:statement>
1649 SELECT DISTINCT 1578 SELECT DISTINCT
1650 sd.id AS sdid, 1579 sd.id AS sdid,
1651 d.lower AS depth_lower, 1580 d.lower AS depth_lower,
1652 d.upper AS depth_upper, 1581 d.upper AS depth_upper,
1653 min(sdv.year) AS year, 1582 min(sdv.year) AS year,
1654 sd.description || '&lt;BR&gt;Jahr: ' || min(sdv.year) AS info 1583 sd.description || '&lt;BR&gt;Jahr: ' || min(sdv.year) AS info
1655 FROM sediment_density sd 1584 FROM sediment_density sd
1656 JOIN depths d ON sd.depth_id = d.id 1585 JOIN depths d ON sd.depth_id = d.id
1657 JOIN sediment_density_values sdv on sdv.sediment_density_id = sd.id 1586 JOIN sediment_density_values sdv on sdv.sediment_density_id = sd.id
1658 WHERE sd.river_id = ${river_id} 1587 WHERE sd.river_id = ${river_id}
1659 GROUP BY sd.id, sd.description, d.upper, d.lower 1588 GROUP BY sd.id, sd.description, d.upper, d.lower
1660 ORDER BY year, depth_lower, depth_upper 1589 ORDER BY year, depth_lower, depth_upper
1661 </dc:statement> 1590 </dc:statement>
1662 <dc:if test="dc:has-result()"> 1591 <dc:if test="dc:has-result()">
1663 <dc:for-each> 1592 <dc:for-each>
1664 <density description="{$depth_lower}-{$depth_upper} cm" 1593 <density description="{$depth_lower}-{$depth_upper} cm" factory="sedimentdensity" target_out="{$out}" info="{$info}" ids="{$sdid}"/>
1665 factory="sedimentdensity" 1594 </dc:for-each>
1666 target_out="{$out}" 1595 </dc:if>
1667 info="{$info}" 1596 </dc:context>
1668 ids="{$sdid}" />
1669 </dc:for-each>
1670 </dc:if>
1671 </dc:context>
1672 </densities> 1597 </densities>
1673 </dc:macro> 1598 </dc:macro>
1674 1599
1675 <!-- sediment load --> 1600 <!-- sediment load -->
1676 <dc:macro name="load"> 1601 <dc:macro name="load">
1677 <year description="{$timespan}" 1602 <year description="{$timespan}" factory="sedimentload" target_out="{$out}" info="{$info}" ids="{$slid};{$fraction};{$timespan};{$kind}"/>
1678 factory="sedimentload"
1679 target_out="{$out}"
1680 info="{$info}"
1681 ids="{$slid};{$fraction};{$timespan};{$kind}" />
1682 </dc:macro> 1603 </dc:macro>
1683 1604
1684 <dc:macro name="load_ls"> 1605 <dc:macro name="load_ls">
1685 <year description="{$timespan}" 1606 <year description="{$timespan}" factory="sedimentload_ls" target_out="{$out}" info="{$info}" ids="{$slid};{$timespan};{$kind}"/>
1686 factory="sedimentload_ls"
1687 target_out="{$out}"
1688 info="{$info}"
1689 ids="{$slid};{$timespan};{$kind}" />
1690 </dc:macro> 1607 </dc:macro>
1691 1608
1692 <dc:macro name="loads"> 1609 <dc:macro name="loads">
1693 <dc:if test="dc:has-result()"> 1610 <dc:if test="dc:has-result()">
1694 <dc:group expr="concat('SQ ', dc:date-format('yyyy', $sqstart), '-', 1611 <dc:group expr="concat('SQ ', dc:date-format('yyyy', $sqstart), '-',
1695 dc:date-format('yyyy', $sqstop))"> 1612 dc:date-format('yyyy', $sqstop))">
1696 <sq_time description="{dc:group-key()}"> 1613 <sq_time description="{dc:group-key()}">
1697 <dc:group expr="$fraction"> 1614 <dc:group expr="$fraction">
1698 <dc:variable name="fraction_name" 1615 <dc:variable name="fraction_name" expr="concat('${', dc:group-key(), '}')"/>
1699 expr="concat('${', dc:group-key(), '}')"/>
1700 <fraction description="{$fraction_name}"> 1616 <fraction description="{$fraction_name}">
1701 <dc:for-each> 1617 <dc:for-each>
1702 <dc:choose> 1618 <dc:choose>
1703 <dc:when test="string-length(dc:get('endyear')) = 0"> 1619 <dc:when test="string-length(dc:get('endyear')) = 0">
1704 <dc:variable name="timespan" type="string" 1620 <dc:variable name="timespan" type="string" expr="dc:date-format('yyyy', $startyear)"/>
1705 expr="dc:date-format('yyyy', $startyear)"/>
1706 </dc:when> 1621 </dc:when>
1707 <dc:otherwise> 1622 <dc:otherwise>
1708 <dc:variable name="timespan" type="string" 1623 <dc:variable name="timespan" type="string" expr="concat(dc:date-format('yyyy',
1709 expr="concat(dc:date-format('yyyy',
1710 $startyear), '-', 1624 $startyear), '-',
1711 dc:date-format('yyyy', $endyear))"/> 1625 dc:date-format('yyyy', $endyear))"/>
1712 </dc:otherwise> 1626 </dc:otherwise>
1713 </dc:choose> 1627 </dc:choose>
1714 <dc:if test="$kind = 'official'"> 1628 <dc:if test="$kind = 'official'">
1715 <dc:variable name="info" type="string" 1629 <dc:variable name="info" type="string" expr="concat('Amtliche Epoche&lt;BR&gt;',
1716 expr="concat('Amtliche Epoche&lt;BR&gt;',
1717 dc:get('info'))"/> 1630 dc:get('info'))"/>
1718 </dc:if> 1631 </dc:if>
1719 <dc:macro-body/> 1632 <dc:macro-body/>
1720 </dc:for-each> 1633 </dc:for-each>
1721 </fraction> 1634 </fraction>
1726 </dc:macro> 1639 </dc:macro>
1727 1640
1728 <dc:macro name="sedimentloads-filter"> 1641 <dc:macro name="sedimentloads-filter">
1729 <years> 1642 <years>
1730 <dc:filter expr="string-length(dc:get('endyear')) = 0 and 1643 <dc:filter expr="string-length(dc:get('endyear')) = 0 and
1731 $kind != 'official'" > 1644 $kind != 'official'">
1732 <dc:macro-body/> 1645 <dc:macro-body/>
1733 </dc:filter> 1646 </dc:filter>
1734 </years> 1647 </years>
1735 <epochs> 1648 <epochs>
1736 <dc:filter expr="string-length(dc:get('endyear')) &gt; 0 and 1649 <dc:filter expr="string-length(dc:get('endyear')) &gt; 0 and
1737 $kind != 'official'" > 1650 $kind != 'official'">
1738 <dc:macro-body/> 1651 <dc:macro-body/>
1739 </dc:filter> 1652 </dc:filter>
1740 </epochs> 1653 </epochs>
1741 <off_epochs> 1654 <off_epochs>
1742 <dc:filter expr="$kind = 'official'" > 1655 <dc:filter expr="$kind = 'official'">
1743 <dc:macro-body/> 1656 <dc:macro-body/>
1744 </dc:filter> 1657 </dc:filter>
1745 </off_epochs> 1658 </off_epochs>
1746 </dc:macro> 1659 </dc:macro>
1747 1660
1772 </dc:macro> 1685 </dc:macro>
1773 1686
1774 <dc:macro name="sedimentload_stations_statement"> 1687 <dc:macro name="sedimentload_stations_statement">
1775 <dc:statement> 1688 <dc:statement>
1776 SELECT DISTINCT 1689 SELECT DISTINCT
1777 sl.id AS slid, 1690 sl.id AS slid,
1778 slk.kind AS kind, 1691 slk.kind AS kind,
1779 ti.start_time AS startyear, 1692 ti.start_time AS startyear,
1780 ti.stop_time AS endyear, 1693 ti.stop_time AS endyear,
1781 sq.start_time AS sqstart, 1694 sq.start_time AS sqstart,
1782 sq.stop_time AS sqstop, 1695 sq.stop_time AS sqstop,
1783 sq.id AS sqid, 1696 sq.id AS sqid,
1784 gf.name AS fraction, 1697 gf.name AS fraction,
1785 sl.description || '&lt;BR&gt;' || 1698 sl.description || '&lt;BR&gt;' ||
1786 'Fraktion: ' || gf.lower || ' bis ' || gf.upper || 1699 'Fraktion: ' || gf.lower || ' bis ' || gf.upper ||
1787 ' mm&lt;BR&gt;Einheit: t/a' AS info 1700 ' mm&lt;BR&gt;Einheit: t/a' AS info
1788 FROM sediment_load sl 1701 FROM sediment_load sl
1789 JOIN sediment_load_kinds slk ON slk.id = sl.kind 1702 JOIN sediment_load_kinds slk ON slk.id = sl.kind
1790 JOIN sediment_load_values slv 1703 JOIN sediment_load_values slv
1791 ON sl.id = slv.sediment_load_id 1704 ON sl.id = slv.sediment_load_id
1792 JOIN measurement_station ms 1705 JOIN measurement_station ms
1793 ON ms.id = slv.measurement_station_id 1706 ON ms.id =
1794 JOIN ranges ra ON ms.range_id = ra.id 1707 slv.measurement_station_id
1795 JOIN rivers r ON ra.river_id = r.id 1708 JOIN ranges ra ON ms.range_id = ra.id
1796 JOIN time_intervals ti ON sl.time_interval_id = ti.id 1709 JOIN rivers r ON ra.river_id = r.id
1797 LEFT JOIN time_intervals sq ON sl.sq_time_interval_id = sq.id 1710 JOIN time_intervals ti ON sl.time_interval_id = ti.id
1798 JOIN grain_fraction gf ON gf.id = sl.grain_fraction_id 1711 LEFT JOIN time_intervals sq ON sl.sq_time_interval_id = sq.id
1712 JOIN grain_fraction gf ON gf.id = sl.grain_fraction_id
1799 WHERE r.id = ${river_id} 1713 WHERE r.id = ${river_id}
1800 AND CASE WHEN r.km_up = 1 AND ra.b IS NOT NULL 1714 AND CASE WHEN r.km_up = 1 AND ra.b IS NOT NULL
1801 THEN ra.b ELSE ra.a END BETWEEN ${fromkm} AND ${tokm} 1715 THEN ra.b ELSE ra.a END BETWEEN ${fromkm} AND ${tokm}
1802 ORDER BY sqstart DESC, sqstop DESC, 1716 ORDER BY sqstart DESC, sqstop DESC,
1803 fraction, startyear DESC, endyear DESC 1717 fraction, startyear DESC, endyear DESC
1804 </dc:statement> 1718 </dc:statement>
1805 </dc:macro> 1719 </dc:macro>
1806 1720
1807 <dc:macro name="sedimentload_ls_statement"> 1721 <dc:macro name="sedimentload_ls_statement">
1808 <dc:statement> 1722 <dc:statement>
1809 SELECT DISTINCT 1723 SELECT DISTINCT
1810 sl.id AS slid, 1724 sl.id AS slid,
1811 slk.kind AS kind, 1725 slk.kind AS kind,
1812 ti.start_time AS startyear, 1726 ti.start_time AS startyear,
1813 ti.stop_time AS endyear, 1727 ti.stop_time AS endyear,
1814 sq.start_time AS sqstart, 1728 sq.start_time AS sqstart,
1815 sq.stop_time AS sqstop, 1729 sq.stop_time AS sqstop,
1816 sq.id AS sqid, 1730 sq.id AS sqid,
1817 gf.name AS fraction, 1731 gf.name AS fraction,
1818 sl.description || '&lt;BR&gt;' || 1732 sl.description || '&lt;BR&gt;' ||
1819 'Fraktion: ' || gf.lower || ' bis ' || gf.upper || 1733 'Fraktion: ' || gf.lower || ' bis ' || gf.upper ||
1820 ' mm&lt;BR&gt;Einheit: ' || u.name AS info 1734 ' mm&lt;BR&gt;Einheit: ' || u.name AS info
1821 FROM sediment_load_ls sl 1735 FROM sediment_load_ls sl
1822 JOIN sediment_load_kinds slk ON slk.id = sl.kind 1736 JOIN sediment_load_kinds slk ON slk.id = sl.kind
1823 JOIN rivers r ON sl.river_id = r.id 1737 JOIN rivers r ON sl.river_id = r.id
1824 JOIN sediment_load_ls_values slv 1738 JOIN sediment_load_ls_values slv
1825 ON sl.id = slv.sediment_load_ls_id 1739 ON sl.id = slv.sediment_load_ls_id
1826 JOIN time_intervals ti ON sl.time_interval_id = ti.id 1740 JOIN time_intervals ti ON sl.time_interval_id = ti.id
1827 LEFT JOIN time_intervals sq ON sl.sq_time_interval_id = sq.id 1741 LEFT JOIN time_intervals sq ON sl.sq_time_interval_id = sq.id
1828 JOIN grain_fraction gf ON gf.id = sl.grain_fraction_id 1742 JOIN grain_fraction gf ON gf.id = sl.grain_fraction_id
1829 JOIN units u ON sl.unit_id = u.id 1743 JOIN units u ON sl.unit_id = u.id
1830 WHERE r.id = ${river_id} 1744 WHERE r.id = ${river_id}
1831 AND slv.station BETWEEN ${fromkm} AND ${tokm} 1745 AND slv.station BETWEEN ${fromkm} AND ${tokm}
1832 ORDER BY sqstart DESC, sqstop DESC, 1746 ORDER BY sqstart DESC, sqstop DESC,
1833 fraction, startyear DESC, endyear DESC 1747 fraction, startyear DESC, endyear DESC
1834 </dc:statement> 1748 </dc:statement>
1835 </dc:macro> 1749 </dc:macro>
1836 1750
1837 <!-- annotations --> 1751 <!-- annotations -->
1838 <dc:macro name="annotations"> 1752 <dc:macro name="annotations">
1840 </dc:macro> 1754 </dc:macro>
1841 1755
1842 <dc:macro name="annotations_per_type"> 1756 <dc:macro name="annotations_per_type">
1843 <annotations> 1757 <annotations>
1844 <dc:context> 1758 <dc:context>
1845 <all_annotations factory="annotations" ids="{$river_id}" target_out="{$out}" /> 1759 <all_annotations factory="annotations" ids="{$river_id}" target_out="{$out}"/>
1846 <dc:statement> 1760 <dc:statement>
1847 SELECT id AS anno_id, 1761 SELECT id AS anno_id,
1848 name AS anno_description 1762 name AS anno_description
1849 FROM annotation_types 1763 FROM annotation_types
1850 </dc:statement> 1764 </dc:statement>
1851 <dc:for-each> 1765 <dc:for-each>
1852 <annotation name="{$anno_description}" 1766 <annotation name="{$anno_description}" factory="annotations" target_out="{$out}" ids="{$river_id}:{$anno_description}"/>
1853 factory="annotations" target_out="{$out}"
1854 ids="{$river_id}:{$anno_description}"/>
1855 </dc:for-each> 1767 </dc:for-each>
1856 </dc:context> 1768 </dc:context>
1857 </annotations> 1769 </annotations>
1858 </dc:macro> 1770 </dc:macro>
1859 1771
1860 <dc:macro name="annotations_sediment_load_ls"> 1772 <dc:macro name="annotations_sediment_load_ls">
1861 <sources_sinks> 1773 <sources_sinks>
1862 <dc:context> 1774 <dc:context>
1863 <dc:statement> 1775 <dc:statement>
1864 SELECT id AS anno_id, 1776 SELECT id AS anno_id,
1865 name AS anno_description 1777 name AS anno_description
1866 FROM annotation_types 1778 FROM annotation_types
1867 WHERE name LIKE 'Quelle %' OR name LIKE 'Senke %' 1779 WHERE name LIKE 'Quelle %' OR name LIKE 'Senke %'
1868 </dc:statement> 1780 </dc:statement>
1869 <dc:for-each> 1781 <dc:for-each>
1870 <annotation name="{$anno_description}" 1782 <annotation name="{$anno_description}" factory="annotations" target_out="{$out}" ids="{$river_id}:{$anno_description}"/>
1871 factory="annotations" target_out="{$out}"
1872 ids="{$river_id}:{$anno_description}"/>
1873 </dc:for-each> 1783 </dc:for-each>
1874 </dc:context> 1784 </dc:context>
1875 </sources_sinks> 1785 </sources_sinks>
1876 </dc:macro> 1786 </dc:macro>
1877 1787
1878 <dc:macro name="qsectors"> 1788 <dc:macro name="qsectors">
1879 <qsector factory="qsectors" ids="{$river_id}" target_out="{$out}" /> 1789 <qsector factory="qsectors" ids="{$river_id}" target_out="{$out}"/>
1880 </dc:macro> 1790 </dc:macro>
1881 1791
1882 <dc:macro name="flood-map-recommended"> 1792 <dc:macro name="flood-map-recommended">
1883 <kilometrage> 1793 <kilometrage>
1884 <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}" /> 1794 <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}"/>
1885 </kilometrage> 1795 </kilometrage>
1886 <rastermap> 1796 <rastermap>
1887 <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" /> 1797 <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}"/>
1888 </rastermap> 1798 </rastermap>
1889 </dc:macro> 1799 </dc:macro>
1890 1800
1891 <!-- bed heights --> 1801 <!-- bed heights -->
1892 <dc:macro name="minfo-heights-diff"> 1802 <dc:macro name="minfo-heights-diff">
1893 <dc:context> 1803 <dc:context>
1894 <dc:statement> 1804 <dc:statement>
1895 WITH sta 1805 WITH sta
1896 AS (SELECT bhs.id, 1806 AS (SELECT bhs.id,
1897 bhs.description, 1807 bhs.description,
1898 bhsv.station, 1808 bhsv.station,
1899 bhs.year 1809 bhs.year
1900 FROM bed_height bhs 1810 FROM bed_height bhs
1901 JOIN bed_height_values bhsv 1811 JOIN bed_height_values bhsv
1902 ON bhsv.bed_height_id = bhs.id 1812 ON bhsv.bed_height_id = bhs.id
1903 WHERE bhs.river_id = ${river_id} 1813 WHERE bhs.river_id = ${river_id}
1904 AND bhsv.station BETWEEN ${fromkm} AND ${tokm}), 1814 AND bhsv.station BETWEEN ${fromkm} AND ${tokm}),
1905 csta 1815 csta
1906 AS (SELECT b1.id AS b1id, 1816 AS (SELECT b1.id AS b1id,
1907 b1.description AS b1desc, 1817 b1.description AS b1desc,
1908 b1.year AS b1year, 1818 b1.year AS b1year,
1909 b2.id AS b2id, 1819 b2.id AS b2id,
1910 b2.description AS b2desc, 1820 b2.description AS b2desc,
1911 b2.year AS b2year 1821 b2.year AS b2year
1912 FROM sta b1 1822 FROM sta b1
1913 JOIN sta b2 1823 JOIN sta b2
1914 ON b1.station = b2.station 1824 ON b1.station = b2.station
1915 AND b1.id &lt;&gt; b2.id 1825 AND b1.id &lt;&gt; b2.id
1916 AND (b1.year &gt; b2.year OR b1.year IS NULL)) 1826 AND (b1.year &gt; b2.year OR b1.year IS NULL))
1917 SELECT DISTINCT b1id, b1desc, b1year, 1827 SELECT
1918 b2id, b2desc, b2year 1828 DISTINCT b1id, b1desc, b1year,
1919 FROM csta 1829 b2id, b2desc, b2year
1920 ORDER BY b1desc, b2desc 1830 FROM csta
1831 ORDER BY b1desc, b2desc
1921 </dc:statement> 1832 </dc:statement>
1922 <dc:if test="dc:has-result()"> 1833 <dc:if test="dc:has-result()">
1923 <bedheights> 1834 <bedheights>
1924 <dc:call-macro name="bed-heights-single-diff"/> 1835 <dc:call-macro name="bed-heights-single-diff"/>
1925 <dc:call-macro name="bed-heights-epoch-diff"/> 1836 <dc:call-macro name="bed-heights-epoch-diff"/>
1948 <dc:group expr="dc:coalesce($b1year, 'sonstige')"> 1859 <dc:group expr="dc:coalesce($b1year, 'sonstige')">
1949 <minfo-diff name="{dc:group-key()}"> 1860 <minfo-diff name="{dc:group-key()}">
1950 <dc:for-each> 1861 <dc:for-each>
1951 <dc:choose> 1862 <dc:choose>
1952 <dc:when test="dc:group-key() = $b1year"> 1863 <dc:when test="dc:group-key() = $b1year">
1953 <height factory="bedheight" 1864 <height factory="bedheight" target_out="{$out}" ids="bedheight-single-{$b1id}#bedheight-single-{$b2id}" info="{$b1desc}#{$b2desc}" description="{$b1desc} - {$b2desc}"/>
1954 target_out="{$out}"
1955 ids="bedheight-single-{$b1id}#bedheight-single-{$b2id}"
1956 info="{$b1desc}#{$b2desc}"
1957 description="{$b1desc} - {$b2desc}"/>
1958 </dc:when> 1865 </dc:when>
1959 <dc:when test="dc:group-key() = 'sonstige'"> 1866 <dc:when test="dc:group-key() = 'sonstige'">
1960 <height factory="bedheight" 1867 <height factory="bedheight" target_out="{$out}" ids="bedheight-single-{$b1id}#bedheight-single-{$b2id}" info="{$b1desc}#{$b2desc}" description="{$b1desc} - {$b2desc}"/>
1961 target_out="{$out}" 1868 <height factory="bedheight" target_out="{$out}" ids="bedheight-single-{$b2id}#bedheight-single-{$b1id}" info="{$b2desc}#{$b1desc}" description="{$b2desc} - {$b1desc}"/>
1962 ids="bedheight-single-{$b1id}#bedheight-single-{$b2id}"
1963 info="{$b1desc}#{$b2desc}"
1964 description="{$b1desc} - {$b2desc}"/>
1965 <height factory="bedheight"
1966 target_out="{$out}"
1967 ids="bedheight-single-{$b2id}#bedheight-single-{$b1id}"
1968 info="{$b2desc}#{$b1desc}"
1969 description="{$b2desc} - {$b1desc}"/>
1970 </dc:when> 1869 </dc:when>
1971 </dc:choose> 1870 </dc:choose>
1972 </dc:for-each> 1871 </dc:for-each>
1973 </minfo-diff> 1872 </minfo-diff>
1974 </dc:group> 1873 </dc:group>
1981 </bedheights> 1880 </bedheights>
1982 </dc:macro> 1881 </dc:macro>
1983 1882
1984 <dc:macro name="bed-heights-factory"> 1883 <dc:macro name="bed-heights-factory">
1985 <dc:for-each> 1884 <dc:for-each>
1986 <height factory="bedheight" 1885 <height factory="bedheight" target_out="{$out}" ids="bedheight-single-{$bedh_id}-{$bedh_year}" info="{$info}" description="{$bedh_descr}"/>
1987 target_out="{$out}"
1988 ids="bedheight-single-{$bedh_id}-{$bedh_year}"
1989 info="{$info}"
1990 description="{$bedh_descr}"/>
1991 </dc:for-each> 1886 </dc:for-each>
1992 </dc:macro> 1887 </dc:macro>
1993 1888
1994 <dc:macro name="bed-heights-single"> 1889 <dc:macro name="bed-heights-single">
1995 <single> 1890 <single>
2019 </epoch> 1914 </epoch>
2020 </dc:macro> 1915 </dc:macro>
2021 1916
2022 <dc:macro name="sounding-width-factory"> 1917 <dc:macro name="sounding-width-factory">
2023 <dc:for-each> 1918 <dc:for-each>
2024 <height factory="bedheight" 1919 <height factory="bedheight" target_out="{$out}" ids="bedheight-soundings-{$bedh_id}-{$bedh_year}" info="{$info}" description="{$bedh_descr}"/>
2025 target_out="{$out}"
2026 ids="bedheight-soundings-{$bedh_id}-{$bedh_year}"
2027 info="{$info}"
2028 description="{$bedh_descr}"/>
2029 </dc:for-each> 1920 </dc:for-each>
2030 </dc:macro> 1921 </dc:macro>
2031 1922
2032 <dc:macro name="sounding-width"> 1923 <dc:macro name="sounding-width">
2033 <dc:context> 1924 <dc:context>
2049 </dc:context> 1940 </dc:context>
2050 </dc:macro> 1941 </dc:macro>
2051 1942
2052 <dc:macro name="bed-heights-statement"> 1943 <dc:macro name="bed-heights-statement">
2053 <dc:statement> 1944 <dc:statement>
2054 SELECT bhs.id AS bedh_id, 1945 SELECT bhs.id AS bedh_id,
2055 bhs.year AS bedh_year, 1946 bhs.year AS bedh_year,
2056 bhs.description AS bedh_descr, 1947 bhs.description AS bedh_descr,
2057 bhs.description || '&lt;BR&gt;Jahr: ' || bhs.year || 1948 bhs.description || '&lt;BR&gt;Jahr: ' || bhs.year ||
2058 '&lt;BR&gt;Aufnahmeart: ' || bht.name || 1949 '&lt;BR&gt;Aufnahmeart: ' || bht.name ||
2059 '&lt;BR&gt;Lagesystem: ' || ls.name || 1950 '&lt;BR&gt;Lagesystem: ' || ls.name ||
2060 '&lt;BR&gt;Höhensystem: ' || cur_em.name || 1951 '&lt;BR&gt;Höhensystem: ' || cur_em.name ||
2061 '&lt;BR&gt;ursprüngliches Höhensystem: ' || old_em.name || 1952 '&lt;BR&gt;ursprüngliches Höhensystem: ' || old_em.name ||
2062 '&lt;BR&gt;Strecke: ' || round(r.a, 1) || '-' || round(r.b, 1) || 1953 '&lt;BR&gt;Strecke: ' || round(r.a, 1) || '-' || round(r.b, 1) ||
2063 '&lt;BR&gt;Auswerter: ' || bhs.evaluation_by AS info 1954 '&lt;BR&gt;Auswerter: ' || bhs.evaluation_by AS info
2064 FROM bed_height bhs 1955 FROM bed_height bhs
2065 JOIN bed_height_type bht ON bht.id = bhs.type_id 1956 JOIN bed_height_type bht ON bht.id =
2066 JOIN location_system ls ON ls.id = location_system_id 1957 bhs.type_id
2067 JOIN elevation_model cur_em ON cur_em.id = cur_elevation_model_id 1958 JOIN location_system ls ON ls.id = location_system_id
2068 LEFT JOIN elevation_model old_em 1959 JOIN elevation_model cur_em ON cur_em.id = cur_elevation_model_id
2069 ON old_em.id = old_elevation_model_id 1960 LEFT JOIN elevation_model old_em
2070 LEFT JOIN ranges r ON r.id = range_id 1961 ON old_em.id = old_elevation_model_id
1962 LEFT JOIN ranges r ON r.id = range_id
2071 WHERE bhs.river_id = ${river_id} 1963 WHERE bhs.river_id = ${river_id}
2072 </dc:statement> 1964 </dc:statement>
2073 </dc:macro> 1965 </dc:macro>
2074 1966
2075 <!-- flow velocity --> 1967 <!-- flow velocity -->
2076 <dc:macro name="flow_velocity_models"> 1968 <dc:macro name="flow_velocity_models">
2077 <dc:context> 1969 <dc:context>
2078 <dc:statement> 1970 <dc:statement>
2079 SELECT fvm.id AS fvmid, 1971 SELECT fvm.id AS fvmid,
2080 fvm.description AS fvmd, 1972 fvm.description AS fvmd,
2081 dz.gauge_name AS gauge, 1973 dz.gauge_name AS gauge,
2082 dz.value AS q, 1974 dz.value AS q,
2083 dz.upper_discharge AS upperQ, 1975 dz.upper_discharge AS upperQ,
2084 dz.lower_discharge AS lowerQ 1976 dz.lower_discharge AS lowerQ
2085 FROM flow_velocity_model fvm 1977 FROM flow_velocity_model fvm
2086 JOIN discharge_zone dz ON dz.id = fvm.discharge_zone_id 1978 JOIN discharge_zone dz ON dz.id = fvm.discharge_zone_id
2087 WHERE dz.river_id = ${river_id} 1979 WHERE dz.river_id = ${river_id}
2088 ORDER BY dz.value 1980 ORDER BY dz.value
2089 </dc:statement> 1981 </dc:statement>
2090 <dc:if test="dc:has-result()"> 1982 <dc:if test="dc:has-result()">
2091 <flowvelocitymodel> 1983 <flowvelocitymodel>
2092 <dc:for-each> 1984 <dc:for-each>
2093 <measurement_value name="{$fvmd}" 1985 <measurement_value name="{$fvmd}" ids="{$fvmid}" factory="flowvelocitymodel" info="{$lowerQ} - {$upperQ}&lt;BR&gt;
2094 ids="{$fvmid}"
2095 factory="flowvelocitymodel"
2096 info="{$lowerQ} - {$upperQ}&lt;BR&gt;
2097 Pegel {$gauge}&lt;BR&gt; 1986 Pegel {$gauge}&lt;BR&gt;
2098 Q = {$q} m3/s" 1987 Q = {$q} m3/s" target_out="{$out}"/>
2099 target_out="{$out}" />
2100 </dc:for-each> 1988 </dc:for-each>
2101 </flowvelocitymodel> 1989 </flowvelocitymodel>
2102 </dc:if> 1990 </dc:if>
2103 </dc:context> 1991 </dc:context>
2104 </dc:macro> 1992 </dc:macro>
2105 1993
2106 1994
2107 <dc:macro name="flow_velocity_measurements"> 1995 <dc:macro name="flow_velocity_measurements">
2108 <dc:context> 1996 <dc:context>
2109 <dc:statement> 1997 <dc:statement>
2110 SELECT id AS fvmid, 1998 SELECT id AS fvmid,
2111 description AS fvmd 1999 description AS fvmd
2112 FROM flow_velocity_measurements WHERE river_id = ${river_id} 2000 FROM flow_velocity_measurements WHERE river_id = ${river_id}
2113 </dc:statement> 2001 </dc:statement>
2114 <dc:if test="dc:has-result()"> 2002 <dc:if test="dc:has-result()">
2115 <flowvelocitymeasurement> 2003 <flowvelocitymeasurement>
2116 <dc:for-each> 2004 <dc:for-each>
2118 <dc:context> 2006 <dc:context>
2119 <dc:statement> 2007 <dc:statement>
2120 SELECT id, description, station, datetime, v, w, q 2008 SELECT id, description, station, datetime, v, w, q
2121 FROM flow_velocity_measure_values 2009 FROM flow_velocity_measure_values
2122 WHERE measurements_id = ${fvmid} 2010 WHERE measurements_id = ${fvmid}
2123 AND station BETWEEN ${fromkm} AND ${tokm} 2011 AND station BETWEEN ${fromkm} AND ${tokm}
2124 </dc:statement> 2012 </dc:statement>
2125 <dc:for-each> 2013 <dc:for-each>
2126 <measurement_value name="{$description} - {$station} - {$datetime}" 2014 <measurement_value name="{$description} - {$station} - {$datetime}" ids="{$id}" factory="flowvelocity" target_out="{$out}"/>
2127 ids="{$id}"
2128 factory="flowvelocity" target_out="{$out}" />
2129 </dc:for-each> 2015 </dc:for-each>
2130 </dc:context> 2016 </dc:context>
2131 </flow_velocity_measurement> 2017 </flow_velocity_measurement>
2132 </dc:for-each> 2018 </dc:for-each>
2133 </flowvelocitymeasurement> 2019 </flowvelocitymeasurement>
2136 </dc:macro> 2022 </dc:macro>
2137 2023
2138 <dc:macro name="morph_width"> 2024 <dc:macro name="morph_width">
2139 <dc:context> 2025 <dc:context>
2140 <dc:statement> 2026 <dc:statement>
2141 SELECT id AS width_id 2027 SELECT id AS width_id
2142 FROM morphologic_width 2028 FROM morphologic_width
2143 WHERE river_id = ${river_id} 2029 WHERE river_id = ${river_id}
2144 </dc:statement> 2030 </dc:statement>
2145 <dc:if test="dc:has-result()"> 2031 <dc:if test="dc:has-result()">
2146 <morph_width> 2032 <morph_width>
2147 <dc:for-each> 2033 <dc:for-each>
2148 <dc:context> 2034 <dc:context>
2149 <dc:statement> 2035 <dc:statement>
2150 SELECT min(station) AS from_station, 2036 SELECT min(station) AS from_station,
2151 max(station) AS to_station 2037 max(station) AS to_station
2152 FROM morphologic_width_values 2038 FROM morphologic_width_values
2153 WHERE morphologic_width_id = ${width_id} 2039 WHERE morphologic_width_id = ${width_id}
2154 </dc:statement> 2040 </dc:statement>
2155 <dc:for-each> 2041 <dc:for-each>
2156 <morphologic-width name="{$from_station} - {$to_station}" 2042 <morphologic-width name="{$from_station} - {$to_station}" ids="{$width_id}" factory="morph-width" target_out="{$out}"/>
2157 ids="{$width_id}"
2158 factory="morph-width" target_out="{$out}" />
2159 </dc:for-each> 2043 </dc:for-each>
2160 </dc:context> 2044 </dc:context>
2161 </dc:for-each> 2045 </dc:for-each>
2162 </morph_width> 2046 </morph_width>
2163 </dc:if> 2047 </dc:if>
2166 2050
2167 <dc:macro name="sqrelations"> 2051 <dc:macro name="sqrelations">
2168 <dc:context> 2052 <dc:context>
2169 <dc:statement> 2053 <dc:statement>
2170 SELECT 2054 SELECT
2171 ti.start_time AS start_time, 2055 ti.start_time AS start_time,
2172 ti.stop_time AS stop_time, 2056 ti.stop_time AS stop_time,
2173 ms.name AS station_name, 2057 ms.name AS station_name,
2174 lower(sqv.parameter) AS parameter, 2058 lower(sqv.parameter) AS parameter,
2175 sqv.id AS sqvid, 2059 sqv.id AS sqvid,
2176 ra.a AS station_km 2060 ra.a AS station_km
2177 FROM sq_relation sq 2061 FROM sq_relation sq
2178 JOIN time_intervals ti ON ti.id = sq.time_interval_id 2062 JOIN time_intervals ti ON ti.id = sq.time_interval_id
2179 JOIN sq_relation_value sqv ON sqv.sq_relation_id = sq.id 2063 JOIN sq_relation_value sqv ON sqv.sq_relation_id = sq.id
2180 JOIN measurement_station ms ON sqv.measurement_station_id = ms.id 2064 JOIN measurement_station ms ON sqv.measurement_station_id = ms.id
2181 JOIN ranges ra ON ms.range_id = ra.id 2065 JOIN ranges ra ON ms.range_id = ra.id
2190 <dc:group expr="$station_km" type="number"> 2074 <dc:group expr="$station_km" type="number">
2191 <dc:group expr="concat('km ', $station_km, ': ', 2075 <dc:group expr="concat('km ', $station_km, ': ',
2192 $station_name)"> 2076 $station_name)">
2193 <station description="{dc:group-key()}"> 2077 <station description="{dc:group-key()}">
2194 <dc:for-each> 2078 <dc:for-each>
2195 <dc:variable name="combined_desc" 2079 <dc:variable name="combined_desc" expr="concat(dc:date-format('yyyy',
2196 expr="concat(dc:date-format('yyyy',
2197 $start_time), ' bis ', 2080 $start_time), ' bis ',
2198 dc:date-format('yyyy', 2081 dc:date-format('yyyy',
2199 $stop_time))"/> 2082 $stop_time))"/>
2200 <sqvalue factory="sqrelationdatacage" 2083 <sqvalue factory="sqrelationdatacage" target_out="{$out}" ids="{$sqvid};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}" description="{$combined_desc}"/>
2201 target_out="{$out}"
2202 ids="{$sqvid};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}"
2203 description="{$combined_desc}"/>
2204 </dc:for-each> 2084 </dc:for-each>
2205 </station> 2085 </station>
2206 </dc:group> 2086 </dc:group>
2207 </dc:group> 2087 </dc:group>
2208 </parameter> 2088 </parameter>
2248 2128
2249 <dc:macro name="flood-map-dem"> 2129 <dc:macro name="flood-map-dem">
2250 <dems> 2130 <dems>
2251 <dc:context> 2131 <dc:context>
2252 <dc:statement> 2132 <dc:statement>
2253 SELECT d.id AS dem_id, 2133 SELECT d.id AS dem_id,
2254 r.a AS dem_lower, 2134 r.a AS dem_lower,
2255 r.b AS dem_upper, 2135 r.b AS dem_upper,
2256 d.name AS name, 2136 d.name AS name,
2257 t.start_time AS start_time, 2137 t.start_time AS start_time,
2258 t.stop_time AS stop_time, 2138 t.stop_time AS stop_time,
2259 'Projektion: ' || d.projection || '&lt;BR&gt;' || 2139 'Projektion: ' || d.projection || '&lt;BR&gt;' ||
2260 'Rasterweite: ' || d.resolution || 'm&lt;BR&gt;' || 2140 'Rasterweite: ' || d.resolution || 'm&lt;BR&gt;' ||
2261 'Format: ' || d.format || '&lt;BR&gt;' || 2141 'Format: ' || d.format || '&lt;BR&gt;' ||
2262 'Zeitraum: ' 2142 'Zeitraum: '
2263 AS info 2143 AS info
2264 FROM dem d 2144 FROM dem d
2265 JOIN ranges r ON d.range_id = r.id 2145 JOIN ranges r ON d.range_id = r.id
2266 LEFT JOIN time_intervals t ON d.time_interval_id = t.id 2146 LEFT JOIN time_intervals t ON d.time_interval_id = t.id
2267 WHERE d.river_id = ${river_id} 2147 WHERE d.river_id = ${river_id}
2268 AND NOT((${tokm} &lt; r.a) or (${fromkm} &gt; r.b)) 2148 AND NOT((${tokm} &lt; r.a) or (${fromkm} &gt; r.b))
2269 </dc:statement> 2149 </dc:statement>
2270 <dc:for-each> 2150 <dc:for-each>
2271 <dem factory="demfactory" target_out="{$out}" 2151 <dem factory="demfactory" target_out="{$out}" ids="{$dem_id}" name="{$name}" info="{$info}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/>
2272 ids="{$dem_id}"
2273 name="{$name}"
2274 info="{$info}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/>
2275 </dc:for-each> 2152 </dc:for-each>
2276 </dc:context> 2153 </dc:context>
2277 </dems> 2154 </dems>
2278 </dc:macro> 2155 </dc:macro>
2279 2156
2280 <dc:macro name="filter_hws_ddg"> 2157 <dc:macro name="filter_hws_ddg">
2281 <dc:macro name="durchlass_damm_graben"> 2158 <dc:macro name="durchlass_damm_graben">
2282 <dc:macro name="ddg_factory"> 2159 <dc:macro name="ddg_factory">
2283 <dc:for-each> 2160 <dc:for-each>
2284 <hws factory="hwsfactory" name="{$hws_name}" target_out="{$out}" /> 2161 <hws factory="hwsfactory" name="{$hws_name}" target_out="{$out}"/>
2285 </dc:for-each> 2162 </dc:for-each>
2286 </dc:macro> 2163 </dc:macro>
2287 2164
2288 <dc:filter expr="$hws_kind=1"> 2165 <dc:filter expr="$hws_kind=1">
2289 <dc:if test="dc:has-result()"> 2166 <dc:if test="dc:has-result()">
2290 <Durchlass><dc:call-macro name="ddg_factory"/></Durchlass> 2167 <Durchlass>
2168 <dc:call-macro name="ddg_factory"/>
2169 </Durchlass>
2291 </dc:if> 2170 </dc:if>
2292 </dc:filter> 2171 </dc:filter>
2293 2172
2294 <dc:filter expr="$hws_kind=2"> 2173 <dc:filter expr="$hws_kind=2">
2295 <dc:if test="dc:has-result()"> 2174 <dc:if test="dc:has-result()">
2296 <Damm><dc:call-macro name="ddg_factory"/></Damm> 2175 <Damm>
2176 <dc:call-macro name="ddg_factory"/>
2177 </Damm>
2297 </dc:if> 2178 </dc:if>
2298 </dc:filter> 2179 </dc:filter>
2299 2180
2300 <dc:filter expr="$hws_kind=3"> 2181 <dc:filter expr="$hws_kind=3">
2301 <dc:if test="dc:has-result()"> 2182 <dc:if test="dc:has-result()">
2302 <Graben><dc:call-macro name="ddg_factory"/></Graben> 2183 <Graben>
2184 <dc:call-macro name="ddg_factory"/>
2185 </Graben>
2303 </dc:if> 2186 </dc:if>
2304 </dc:filter> 2187 </dc:filter>
2305 </dc:macro> 2188 </dc:macro>
2306 2189
2307 <dc:filter expr="$hws_official=1"> 2190 <dc:filter expr="$hws_official=1">
2323 2206
2324 <dc:macro name="flood-map-hws-lines"> 2207 <dc:macro name="flood-map-hws-lines">
2325 <dc:context> 2208 <dc:context>
2326 <dc:statement> 2209 <dc:statement>
2327 SELECT DISTINCT 2210 SELECT DISTINCT
2328 name AS hws_name, 2211 name AS hws_name,
2329 official AS hws_official, 2212 official AS hws_official,
2330 kind_id AS hws_kind 2213 kind_id AS hws_kind
2331 FROM hws_lines 2214 FROM hws_lines
2332 WHERE river_id = ${river_id} 2215 WHERE river_id = ${river_id}
2333 </dc:statement> 2216 </dc:statement>
2334 <dc:if test="dc:has-result()"> 2217 <dc:if test="dc:has-result()">
2335 <lines> 2218 <lines>
2341 2224
2342 <dc:macro name="flood-map-hws-points"> 2225 <dc:macro name="flood-map-hws-points">
2343 <dc:context> 2226 <dc:context>
2344 <dc:statement> 2227 <dc:statement>
2345 SELECT DISTINCT 2228 SELECT DISTINCT
2346 name AS hws_name, 2229 name AS hws_name,
2347 official AS hws_official, 2230 official AS hws_official,
2348 kind_id AS hws_kind 2231 kind_id AS hws_kind
2349 FROM hws_points 2232 FROM hws_points
2350 WHERE river_id = ${river_id} 2233 WHERE river_id = ${river_id}
2351 </dc:statement> 2234 </dc:statement>
2352 <dc:if test="dc:has-result()"> 2235 <dc:if test="dc:has-result()">
2353 <points> 2236 <points>
2360 <dc:macro name="flood-map-hydr-boundaries-state"> 2243 <dc:macro name="flood-map-hydr-boundaries-state">
2361 <federal> 2244 <federal>
2362 <dc:context> 2245 <dc:context>
2363 <dc:statement> 2246 <dc:statement>
2364 SELECT DISTINCT 2247 SELECT DISTINCT
2365 name 2248 name
2366 FROM hydr_boundaries 2249 FROM hydr_boundaries
2367 WHERE river_id = ${river_id} 2250 WHERE river_id = ${river_id}
2368 AND kind = 2 2251 AND kind = 2
2369 </dc:statement> 2252 </dc:statement>
2370 <dc:for-each> 2253 <dc:for-each>
2371 <line factory="wmshydrboundariesfactory" target_out="{$out}" 2254 <line factory="wmshydrboundariesfactory" target_out="{$out}" ids="{$river_id};{$name};2" name="{$name}"/>
2372 ids="{$river_id};{$name};2"
2373 name="{$name}"/>
2374 </dc:for-each> 2255 </dc:for-each>
2375 </dc:context> 2256 </dc:context>
2376 <dc:context> 2257 <dc:context>
2377 <dc:statement> 2258 <dc:statement>
2378 SELECT DISTINCT 2259 SELECT DISTINCT
2379 name 2260 name
2380 FROM hydr_boundaries_poly 2261 FROM hydr_boundaries_poly
2381 WHERE river_id = ${river_id} 2262 WHERE river_id = ${river_id}
2382 AND kind = 2 2263 AND kind = 2
2383 </dc:statement> 2264 </dc:statement>
2384 <dc:for-each> 2265 <dc:for-each>
2385 <line factory="wmshydrboundariespolyfactory" target_out="{$out}" 2266 <line factory="wmshydrboundariespolyfactory" target_out="{$out}" ids="{$river_id};{$name};2" name="{$name}"/>
2386 ids="{$river_id};{$name};2"
2387 name="{$name}"/>
2388 </dc:for-each> 2267 </dc:for-each>
2389 </dc:context> 2268 </dc:context>
2390 </federal> 2269 </federal>
2391 </dc:macro> 2270 </dc:macro>
2392 2271
2393 <dc:macro name="flood-map-hydr-boundaries-lines"> 2272 <dc:macro name="flood-map-hydr-boundaries-lines">
2394 <dc:context> 2273 <dc:context>
2395 <dc:statement> 2274 <dc:statement>
2396 SELECT DISTINCT 2275 SELECT DISTINCT
2397 name 2276 name
2398 FROM hydr_boundaries 2277 FROM hydr_boundaries
2399 WHERE river_id = ${river_id} 2278 WHERE river_id = ${river_id}
2400 AND kind = 1 2279 AND kind = 1
2401 </dc:statement> 2280 </dc:statement>
2402 <dc:comment> What about all other line kinds?</dc:comment> 2281 <dc:comment> What about all other line kinds?</dc:comment>
2403 <dc:if test="dc:has-result()"> 2282 <dc:if test="dc:has-result()">
2404 <lines> 2283 <lines>
2405 <dc:for-each> 2284 <dc:for-each>
2406 <line factory="wmshydrboundariesfactory" target_out="{$out}" 2285 <line factory="wmshydrboundariesfactory" target_out="{$out}" ids="{$river_id};{$name};1" name="{$name}"/>
2407 ids="{$river_id};{$name};1"
2408 name="{$name}"/>
2409 </dc:for-each> 2286 </dc:for-each>
2410 </lines> 2287 </lines>
2411 </dc:if> 2288 </dc:if>
2412 </dc:context> 2289 </dc:context>
2413 </dc:macro> 2290 </dc:macro>
2415 <dc:macro name="flood-map-hydr-boundaries-poly"> 2292 <dc:macro name="flood-map-hydr-boundaries-poly">
2416 <areas> 2293 <areas>
2417 <dc:context> 2294 <dc:context>
2418 <dc:statement> 2295 <dc:statement>
2419 SELECT DISTINCT 2296 SELECT DISTINCT
2420 b.sectie AS sectie_id, 2297 b.sectie AS sectie_id,
2421 sk.name AS sectie 2298 sk.name AS sectie
2422 FROM hydr_boundaries_poly b 2299 FROM hydr_boundaries_poly b
2423 JOIN sectie_kinds sk ON b.sectie = sk.id 2300 JOIN sectie_kinds sk ON b.sectie = sk.id
2424 WHERE b.river_id = ${river_id} 2301 WHERE b.river_id = ${river_id}
2425 AND b.kind = 1 2302 AND b.kind = 1
2426 </dc:statement> 2303 </dc:statement>
2427 <dc:if test="dc:has-result()"> 2304 <dc:if test="dc:has-result()">
2428 <sobek_areas> 2305 <sobek_areas>
2429 <dc:for-each> 2306 <dc:for-each>
2430 <boundary name="{$sectie}" 2307 <boundary name="{$sectie}" factory="wmshydrboundariespolyfactory" target_out="{$out}" ids="{$river_id};{$sectie};1;{$sectie_id};-1"/>
2431 factory="wmshydrboundariespolyfactory" target_out="{$out}"
2432 ids="{$river_id};{$sectie};1;{$sectie_id};-1"/>
2433 </dc:for-each> 2308 </dc:for-each>
2434 </sobek_areas> 2309 </sobek_areas>
2435 </dc:if> 2310 </dc:if>
2436 </dc:context> 2311 </dc:context>
2437 <dc:context> 2312 <dc:context>
2438 <dc:statement> 2313 <dc:statement>
2439 SELECT DISTINCT 2314 SELECT DISTINCT
2440 b.sobek AS sobek_id, 2315 b.sobek AS sobek_id,
2441 sk.name AS sobek 2316 sk.name AS sobek
2442 FROM hydr_boundaries_poly b 2317 FROM hydr_boundaries_poly b
2443 JOIN sobek_kinds sk ON b.sobek = sk.id 2318 JOIN sobek_kinds sk ON b.sobek = sk.id
2444 WHERE b.river_id = ${river_id} 2319 WHERE b.river_id = ${river_id}
2445 AND b.kind = 1 2320 AND b.kind = 1
2446 </dc:statement> 2321 </dc:statement>
2447 <dc:if test="dc:has-result()"> 2322 <dc:if test="dc:has-result()">
2448 <sobek_flooded> 2323 <sobek_flooded>
2449 <dc:for-each> 2324 <dc:for-each>
2450 <boundary name="{$sobek}" 2325 <boundary name="{$sobek}" factory="wmshydrboundariespolyfactory" target_out="{$out}" ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/>
2451 factory="wmshydrboundariespolyfactory" target_out="{$out}"
2452 ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/>
2453 </dc:for-each> 2326 </dc:for-each>
2454 </sobek_flooded> 2327 </sobek_flooded>
2455 </dc:if> 2328 </dc:if>
2456 </dc:context> 2329 </dc:context>
2457 <dc:context> 2330 <dc:context>
2458 <dc:statement> 2331 <dc:statement>
2459 SELECT DISTINCT 2332 SELECT DISTINCT
2460 b.name AS name 2333 b.name AS name
2461 FROM hydr_boundaries_poly b 2334 FROM hydr_boundaries_poly b
2462 WHERE b.river_id = ${river_id} 2335 WHERE b.river_id = ${river_id}
2463 AND b.kind = 1 2336 AND b.kind = 1
2464 AND b.sobek IS NULL 2337 AND b.sobek IS NULL
2465 AND b.sectie is NULL 2338 AND b.sectie is NULL
2466 </dc:statement> 2339 </dc:statement>
2467 <dc:for-each> 2340 <dc:for-each>
2468 <boundary name="{$name}" 2341 <boundary name="{$name}" factory="wmshydrboundariespolyfactory" target_out="{$out}" ids="{$river_id};{$name}"/>
2469 factory="wmshydrboundariespolyfactory" target_out="{$out}"
2470 ids="{$river_id};{$name}"/>
2471 </dc:for-each> 2342 </dc:for-each>
2472 </dc:context> 2343 </dc:context>
2473 </areas> 2344 </areas>
2474 </dc:macro> 2345 </dc:macro>
2475 2346
2477 <dc:context> 2348 <dc:context>
2478 <dc:statement> 2349 <dc:statement>
2479 SELECT DISTINCT 1 FROM floodmaps WHERE river_id = ${river_id} 2350 SELECT DISTINCT 1 FROM floodmaps WHERE river_id = ${river_id}
2480 </dc:statement> 2351 </dc:statement>
2481 <dc:if test="dc:has-result()"> 2352 <dc:if test="dc:has-result()">
2482 <uesk> 2353 <uesk>
2483 <calculations> 2354 <calculations>
2484 <dc:context> 2355 <dc:context>
2485 <dc:statement> 2356 <dc:statement>
2486 SELECT DISTINCT 1 FROM floodmaps WHERE river_id = ${river_id} 2357 SELECT DISTINCT 1 FROM floodmaps WHERE river_id = ${river_id}
2487 AND (kind = 112 OR kind = 111) 2358 AND (kind = 112 OR kind = 111)
2488 </dc:statement> 2359 </dc:statement>
2489 <dc:if test="dc:has-result()"> 2360 <dc:if test="dc:has-result()">
2490 <current> 2361 <current>
2491 <dc:context> 2362 <dc:context>
2492 <dc:statement> 2363 <dc:statement>
2493 SELECT DISTINCT name AS name 2364 SELECT DISTINCT name AS name
2494 FROM floodmaps 2365 FROM floodmaps
2495 WHERE river_id = ${river_id} AND kind = 111 2366 WHERE river_id = ${river_id} AND kind = 111
2496 </dc:statement> 2367 </dc:statement>
2497 <dc:if test="dc:has-result()"> 2368 <dc:if test="dc:has-result()">
2498 <bfg> 2369 <bfg>
2499 <dc:for-each> 2370 <dc:for-each>
2500 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" 2371 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" ids="{$river_id};{$name}" name="{$name}"/>
2501 ids="{$river_id};{$name}" 2372 </dc:for-each>
2502 name="{$name}"/> 2373 </bfg>
2503 </dc:for-each> 2374 </dc:if>
2504 </bfg> 2375 </dc:context>
2505 </dc:if> 2376 <dc:context>
2506 </dc:context> 2377 <dc:statement>
2507 <dc:context> 2378 SELECT DISTINCT name AS name
2508 <dc:statement> 2379 FROM floodmaps
2509 SELECT DISTINCT name AS name 2380 WHERE river_id = ${river_id} AND kind = 112
2510 FROM floodmaps 2381 </dc:statement>
2511 WHERE river_id = ${river_id} AND kind = 112 2382 <dc:if test="dc:has-result()">
2512 </dc:statement> 2383 <federal>
2513 <dc:if test="dc:has-result()"> 2384 <dc:for-each>
2514 <federal> 2385 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" ids="{$river_id};{$name}" name="{$name}"/>
2515 <dc:for-each> 2386 </dc:for-each>
2516 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" 2387 </federal>
2517 ids="{$river_id};{$name}" 2388 </dc:if>
2518 name="{$name}"/> 2389 </dc:context>
2519 </dc:for-each> 2390 </current>
2520 </federal> 2391 </dc:if>
2521 </dc:if> 2392 </dc:context>
2522 </dc:context> 2393 <dc:context>
2523 </current> 2394 <dc:statement>
2524 </dc:if> 2395 SELECT DISTINCT 1 from floodmaps where river_id = ${river_id}
2525 </dc:context> 2396 AND (kind = 122 OR kind = 121)
2526 <dc:context> 2397 </dc:statement>
2527 <dc:statement> 2398 <dc:if test="dc:has-result()">
2528 SELECT DISTINCT 1 from floodmaps where river_id = ${river_id} 2399 <potential>
2529 AND (kind = 122 OR kind = 121) 2400 <dc:context>
2530 </dc:statement> 2401 <dc:statement>
2531 <dc:if test="dc:has-result()"> 2402 SELECT DISTINCT name AS name
2532 <potential> 2403 FROM floodmaps
2533 <dc:context> 2404 WHERE river_id = ${river_id} AND kind = 121
2534 <dc:statement> 2405 </dc:statement>
2535 SELECT DISTINCT name AS name 2406 <dc:if test="dc:has-result()">
2536 FROM floodmaps 2407 <bfg>
2537 WHERE river_id = ${river_id} AND kind = 121 2408 <dc:for-each>
2538 </dc:statement> 2409 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" ids="{$river_id};{$name}" name="{$name}"/>
2539 <dc:if test="dc:has-result()"> 2410 </dc:for-each>
2540 <bfg> 2411 </bfg>
2541 <dc:for-each> 2412 </dc:if>
2542 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" 2413 </dc:context>
2543 ids="{$river_id};{$name}"
2544 name="{$name}"/>
2545 </dc:for-each>
2546 </bfg>
2547 </dc:if>
2548 </dc:context>
2549 <dc:context>
2550 <dc:statement>
2551 SELECT DISTINCT
2552 name AS name
2553 FROM floodmaps
2554 WHERE river_id = ${river_id} AND kind = 122
2555 </dc:statement>
2556 <dc:if test="dc:has-result()">
2557 <federal>
2558 <dc:for-each>
2559 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
2560 ids="{$river_id};{$name}"
2561 name="{$name}"/>
2562 </dc:for-each>
2563 </federal>
2564 </dc:if>
2565 </dc:context>
2566 </potential>
2567 </dc:if>
2568 </dc:context>
2569 </calculations>
2570 <dc:context>
2571 <dc:statement>
2572 SELECT DISTINCT
2573 source AS source
2574 FROM floodmaps
2575 WHERE river_id = ${river_id} AND kind = 200
2576 </dc:statement>
2577 <dc:if test="dc:has-result()">
2578 <measurements>
2579 <dc:for-each>
2580 <year name="{$source}">
2581 <dc:context> 2414 <dc:context>
2582 <dc:statement> 2415 <dc:statement>
2583 SELECT DISTINCT 2416 SELECT DISTINCT
2417 name AS name
2418 FROM floodmaps
2419 WHERE river_id = ${river_id} AND kind = 122
2420 </dc:statement>
2421 <dc:if test="dc:has-result()">
2422 <federal>
2423 <dc:for-each>
2424 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" ids="{$river_id};{$name}" name="{$name}"/>
2425 </dc:for-each>
2426 </federal>
2427 </dc:if>
2428 </dc:context>
2429 </potential>
2430 </dc:if>
2431 </dc:context>
2432 </calculations>
2433 <dc:context>
2434 <dc:statement>
2435 SELECT DISTINCT
2436 source AS source
2437 FROM floodmaps
2438 WHERE river_id = ${river_id} AND kind = 200
2439 </dc:statement>
2440 <dc:if test="dc:has-result()">
2441 <measurements>
2442 <dc:for-each>
2443 <year name="{$source}">
2444 <dc:context>
2445 <dc:statement>
2446 SELECT DISTINCT
2584 name AS name 2447 name AS name
2585 FROM floodmaps 2448 FROM floodmaps
2586 WHERE river_id = ${river_id} AND kind = 200 AND source = 2449 WHERE river_id = ${river_id} AND kind = 200 AND source =
2587 ${source} 2450 ${source}
2588 </dc:statement> 2451 </dc:statement>
2589 <dc:for-each> 2452 <dc:for-each>
2590 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" 2453 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" ids="{$river_id};{$name}" name="{$name}"/>
2591 ids="{$river_id};{$name}" 2454 </dc:for-each>
2592 name="{$name}"/> 2455 </dc:context>
2593 </dc:for-each> 2456 </year>
2594 </dc:context> 2457 </dc:for-each>
2595 </year> 2458 </measurements>
2596 </dc:for-each> 2459 </dc:if>
2597 </measurements> 2460 </dc:context>
2598 </dc:if> 2461 </uesk>
2599 </dc:context> 2462 </dc:if>
2600 </uesk>
2601 </dc:if>
2602 </dc:context> 2463 </dc:context>
2603 </dc:macro> 2464 </dc:macro>
2604 2465
2605 <dc:macro name="flood-map-floodplain"> 2466 <dc:macro name="flood-map-floodplain">
2606 <dc:context> 2467 <dc:context>
2607 <dc:statement> 2468 <dc:statement>
2608 SELECT DISTINCT 2469 SELECT DISTINCT
2609 fp.kind_id AS kind_id, 2470 fp.kind_id AS kind_id,
2610 flk.name AS kind_name 2471 flk.name AS kind_name
2611 FROM floodplain fp 2472 FROM floodplain fp
2612 JOIN floodplain_kinds flk on fp.kind_id = flk.id 2473 JOIN floodplain_kinds flk on fp.kind_id = flk.id
2613 WHERE river_id = ${river_id} 2474 WHERE river_id = ${river_id}
2614 </dc:statement> 2475 </dc:statement>
2615 <dc:if test="dc:has-result()"> 2476 <dc:if test="dc:has-result()">
2616 <floodplain> 2477 <floodplain>
2617 <dc:filter expr="$kind_id=1"> 2478 <dc:filter expr="$kind_id=1">
2618 <dc:for-each> 2479 <dc:for-each>
2619 <floody factory="wmsfloodplainfactory" target_out="{$out}" 2480 <floody factory="wmsfloodplainfactory" target_out="{$out}" description="{$kind_name}" ids="{$river_id};{$kind_name};{$kind_id}"/>
2620 description="{$kind_name}"
2621 ids="{$river_id};{$kind_name};{$kind_id}"/>
2622 </dc:for-each> 2481 </dc:for-each>
2623 </dc:filter> 2482 </dc:filter>
2624 <dc:filter expr="$kind_id != 1"> 2483 <dc:filter expr="$kind_id != 1">
2625 <dc:if test="dc:has-result()"> 2484 <dc:if test="dc:has-result()">
2626 <other> 2485 <other>
2627 <dc:for-each> 2486 <dc:for-each>
2628 <floody factory="wmsfloodplainfactory" target_out="{$out}" 2487 <floody factory="wmsfloodplainfactory" target_out="{$out}" description="{$layer_name}" ids="{$river_id};{$layer_name};{$kind_id}"/>
2629 description="{$layer_name}"
2630 ids="{$river_id};{$layer_name};{$kind_id}"/>
2631 </dc:for-each> 2488 </dc:for-each>
2632 </other> 2489 </other>
2633 </dc:if> 2490 </dc:if>
2634 </dc:filter> 2491 </dc:filter>
2635 </floodplain> 2492 </floodplain>
2643 availble 2500 availble
2644 </dc:comment> 2501 </dc:comment>
2645 2502
2646 <dc:macro name="hwspoints_by_kind_factory"> 2503 <dc:macro name="hwspoints_by_kind_factory">
2647 <dc:for-each> 2504 <dc:for-each>
2648 <hws factory="wmshwspointsfactory" target_out="{$out}" 2505 <hws factory="wmshwspointsfactory" target_out="{$out}" ids="{$river_id};{$hws_name}" name="{$hws_name}"/>
2649 ids="{$river_id};{$hws_name}"
2650 name="{$hws_name}"/>
2651 </dc:for-each> 2506 </dc:for-each>
2652 </dc:macro> 2507 </dc:macro>
2653 2508
2654 <dc:filter expr="$hws_kind=1"> 2509 <dc:filter expr="$hws_kind=1">
2655 <dc:if test="dc:has-result()"> 2510 <dc:if test="dc:has-result()">
2680 <hws_points> 2535 <hws_points>
2681 <official> 2536 <official>
2682 <dc:context> 2537 <dc:context>
2683 <dc:statement> 2538 <dc:statement>
2684 SELECT DISTINCT 2539 SELECT DISTINCT
2685 fs.name AS fed_name, 2540 fs.name AS fed_name,
2686 fs.id AS fed_id 2541 fs.id AS fed_id
2687 FROM hws_points hws 2542 FROM hws_points hws
2688 JOIN fed_states fs ON hws.fed_state_id = fs.id 2543 JOIN fed_states fs ON hws.fed_state_id = fs.id
2689 WHERE river_id = ${river_id} 2544 WHERE river_id = ${river_id}
2690 AND hws.official=1 2545 AND hws.official=1
2691 </dc:statement> 2546 </dc:statement>
2692 <dc:for-each> 2547 <dc:for-each>
2693 <dc:context> 2548 <dc:context>
2694 <dc:statement> 2549 <dc:statement>
2695 SELECT DISTINCT 2550 SELECT DISTINCT
2696 name AS hws_name, 2551 name AS hws_name,
2697 kind_id AS hws_kind 2552 kind_id AS hws_kind
2698 FROM hws_points 2553 FROM hws_points
2699 WHERE river_id = ${river_id} 2554 WHERE river_id = ${river_id}
2700 AND official=1 2555 AND official=1
2701 AND fed_state_id = ${fed_id} ORDER BY name 2556 AND fed_state_id = ${fed_id} ORDER BY name
2702 </dc:statement> 2557 </dc:statement>
2703 <fedstate description="{$fed_name}"> 2558 <fedstate description="{$fed_name}">
2704 <dc:call-macro name="hwspoints_by_kind"/> 2559 <dc:call-macro name="hwspoints_by_kind"/>
2705 </fedstate> 2560 </fedstate>
2706 </dc:context> 2561 </dc:context>
2707 </dc:for-each> 2562 </dc:for-each>
2708 </dc:context> 2563 </dc:context>
2709 <dc:context> 2564 <dc:context>
2710 <dc:statement> 2565 <dc:statement>
2711 SELECT distinct 2566 SELECT distinct
2712 name AS hws_name, 2567 name AS hws_name,
2713 kind_id AS hws_kind 2568 kind_id AS hws_kind
2714 FROM hws_points 2569 FROM hws_points
2715 WHERE river_id = ${river_id} 2570 WHERE river_id = ${river_id}
2716 AND official=1 2571 AND official=1
2717 AND fed_state_id IS NULL 2572 AND fed_state_id IS NULL
2718 ORDER BY name 2573 ORDER BY name
2719 </dc:statement> 2574 </dc:statement>
2720 <hws_fed_unknown> 2575 <hws_fed_unknown>
2721 <dc:call-macro name="hwspoints_by_kind"/> 2576 <dc:call-macro name="hwspoints_by_kind"/>
2722 </hws_fed_unknown> 2577 </hws_fed_unknown>
2723 </dc:context> 2578 </dc:context>
2724 </official> 2579 </official>
2725 <inofficial> 2580 <inofficial>
2726 <dc:context> 2581 <dc:context>
2727 <dc:statement> 2582 <dc:statement>
2728 SELECT DISTINCT 2583 SELECT DISTINCT
2729 fs.name AS fed_name, 2584 fs.name AS fed_name,
2730 fs.id AS fed_id 2585 fs.id AS fed_id
2731 FROM hws_points hws 2586 FROM hws_points hws
2732 JOIN fed_states fs ON hws.fed_state_id = fs.id 2587 JOIN fed_states fs ON hws.fed_state_id = fs.id
2733 WHERE river_id = ${river_id} 2588 WHERE river_id = ${river_id}
2734 AND hws.official=0 2589 AND hws.official=0
2735 </dc:statement> 2590 </dc:statement>
2736 <dc:for-each> 2591 <dc:for-each>
2737 <dc:context> 2592 <dc:context>
2738 <dc:statement> 2593 <dc:statement>
2739 SELECT DISTINCT 2594 SELECT DISTINCT
2740 name AS hws_name, 2595 name AS hws_name,
2741 kind_id AS hws_kind 2596 kind_id AS hws_kind
2742 FROM hws_points 2597 FROM hws_points
2743 WHERE river_id = ${river_id} 2598 WHERE river_id = ${river_id}
2744 AND official=0 2599 AND official=0
2745 AND fed_state_id = ${fed_id} ORDER BY name 2600 AND fed_state_id = ${fed_id} ORDER BY name
2746 </dc:statement> 2601 </dc:statement>
2747 <fedstate description="{$fed_name}"> 2602 <fedstate description="{$fed_name}">
2748 <dc:call-macro name="hwspoints_by_kind"/> 2603 <dc:call-macro name="hwspoints_by_kind"/>
2749 </fedstate> 2604 </fedstate>
2750 </dc:context> 2605 </dc:context>
2751 </dc:for-each> 2606 </dc:for-each>
2752 </dc:context> 2607 </dc:context>
2753 <dc:context> 2608 <dc:context>
2754 <dc:statement> 2609 <dc:statement>
2755 SELECT distinct 2610 SELECT distinct
2756 name AS hws_name, 2611 name AS hws_name,
2757 kind_id AS hws_kind 2612 kind_id AS hws_kind
2758 FROM hws_points 2613 FROM hws_points
2759 WHERE river_id = ${river_id} 2614 WHERE river_id = ${river_id}
2760 AND official=0 2615 AND official=0
2761 AND fed_state_id IS NULL ORDER BY name 2616 AND fed_state_id IS NULL ORDER BY name
2762 </dc:statement> 2617 </dc:statement>
2763 <hws_fed_unknown> 2618 <hws_fed_unknown>
2764 <dc:call-macro name="hwspoints_by_kind"/> 2619 <dc:call-macro name="hwspoints_by_kind"/>
2765 </hws_fed_unknown> 2620 </hws_fed_unknown>
2766 </dc:context> 2621 </dc:context>
2774 availble 2629 availble
2775 </dc:comment> 2630 </dc:comment>
2776 2631
2777 <dc:macro name="hwslines_by_kind_factory"> 2632 <dc:macro name="hwslines_by_kind_factory">
2778 <dc:for-each> 2633 <dc:for-each>
2779 <hws factory="wmshwslinesfactory" target_out="{$out}" 2634 <hws factory="wmshwslinesfactory" target_out="{$out}" ids="{$river_id};{$hws_name}" name="{$hws_name}"/>
2780 ids="{$river_id};{$hws_name}"
2781 name="{$hws_name}"/>
2782 </dc:for-each> 2635 </dc:for-each>
2783 </dc:macro> 2636 </dc:macro>
2784 2637
2785 <dc:filter expr="$hws_kind=1"> 2638 <dc:filter expr="$hws_kind=1">
2786 <dc:if test="dc:has-result()"> 2639 <dc:if test="dc:has-result()">
2811 <hws_lines> 2664 <hws_lines>
2812 <official> 2665 <official>
2813 <dc:context> 2666 <dc:context>
2814 <dc:statement> 2667 <dc:statement>
2815 SELECT DISTINCT 2668 SELECT DISTINCT
2816 fs.name AS fed_name, 2669 fs.name AS fed_name,
2817 fs.id AS fed_id 2670 fs.id AS fed_id
2818 FROM hws_lines hws 2671 FROM hws_lines hws
2819 JOIN fed_states fs ON hws.fed_state_id = fs.id 2672 JOIN fed_states fs ON hws.fed_state_id = fs.id
2820 WHERE river_id = ${river_id} 2673 WHERE river_id = ${river_id}
2821 AND hws.official=1 2674 AND hws.official=1
2822 </dc:statement> 2675 </dc:statement>
2823 <dc:for-each> 2676 <dc:for-each>
2824 <dc:context> 2677 <dc:context>
2825 <dc:statement> 2678 <dc:statement>
2826 SELECT DISTINCT 2679 SELECT DISTINCT
2827 name AS hws_name, 2680 name AS hws_name,
2828 kind_id AS hws_kind 2681 kind_id AS hws_kind
2829 FROM hws_lines 2682 FROM hws_lines
2830 WHERE river_id = ${river_id} 2683 WHERE river_id = ${river_id}
2831 AND official=1 2684 AND official=1
2832 AND fed_state_id = ${fed_id} ORDER BY name 2685 AND fed_state_id = ${fed_id} ORDER BY name
2833 </dc:statement> 2686 </dc:statement>
2834 <fedstate description="{$fed_name}"> 2687 <fedstate description="{$fed_name}">
2835 <dc:call-macro name="hwslines_by_kind"/> 2688 <dc:call-macro name="hwslines_by_kind"/>
2836 </fedstate> 2689 </fedstate>
2837 </dc:context> 2690 </dc:context>
2838 </dc:for-each> 2691 </dc:for-each>
2839 </dc:context> 2692 </dc:context>
2840 <dc:context> 2693 <dc:context>
2841 <dc:statement> 2694 <dc:statement>
2842 SELECT distinct 2695 SELECT distinct
2843 name AS hws_name, 2696 name AS hws_name,
2844 kind_id AS hws_kind 2697 kind_id AS hws_kind
2845 FROM hws_lines 2698 FROM hws_lines
2846 WHERE river_id = ${river_id} 2699 WHERE river_id = ${river_id}
2847 AND official=1 2700 AND official=1
2848 AND fed_state_id IS NULL 2701 AND fed_state_id IS NULL
2849 ORDER BY name 2702 ORDER BY name
2850 </dc:statement> 2703 </dc:statement>
2851 <hws_fed_unknown> 2704 <hws_fed_unknown>
2852 <dc:call-macro name="hwslines_by_kind"/> 2705 <dc:call-macro name="hwslines_by_kind"/>
2853 </hws_fed_unknown> 2706 </hws_fed_unknown>
2854 </dc:context> 2707 </dc:context>
2855 </official> 2708 </official>
2856 <inofficial> 2709 <inofficial>
2857 <dc:context> 2710 <dc:context>
2858 <dc:statement> 2711 <dc:statement>
2859 SELECT DISTINCT 2712 SELECT DISTINCT
2860 fs.name AS fed_name, 2713 fs.name AS fed_name,
2861 fs.id AS fed_id 2714 fs.id AS fed_id
2862 FROM hws_lines hws 2715 FROM hws_lines hws
2863 JOIN fed_states fs ON hws.fed_state_id = fs.id 2716 JOIN fed_states fs ON hws.fed_state_id = fs.id
2864 WHERE river_id = ${river_id} 2717 WHERE river_id = ${river_id}
2865 AND hws.official=0 2718 AND hws.official=0
2866 </dc:statement> 2719 </dc:statement>
2867 <dc:for-each> 2720 <dc:for-each>
2868 <dc:context> 2721 <dc:context>
2869 <dc:statement> 2722 <dc:statement>
2870 SELECT DISTINCT 2723 SELECT DISTINCT
2871 name AS hws_name, 2724 name AS hws_name,
2872 kind_id AS hws_kind 2725 kind_id AS hws_kind
2873 FROM hws_lines 2726 FROM hws_lines
2874 WHERE river_id = ${river_id} 2727 WHERE river_id = ${river_id}
2875 AND official=0 2728 AND official=0
2876 AND fed_state_id = ${fed_id} ORDER BY name 2729 AND fed_state_id = ${fed_id} ORDER BY name
2877 </dc:statement> 2730 </dc:statement>
2878 <fedstate description="{$fed_name}"> 2731 <fedstate description="{$fed_name}">
2879 <dc:call-macro name="hwslines_by_kind"/> 2732 <dc:call-macro name="hwslines_by_kind"/>
2880 </fedstate> 2733 </fedstate>
2881 </dc:context> 2734 </dc:context>
2882 </dc:for-each> 2735 </dc:for-each>
2883 </dc:context> 2736 </dc:context>
2884 <dc:context> 2737 <dc:context>
2885 <dc:statement> 2738 <dc:statement>
2886 SELECT distinct 2739 SELECT distinct
2887 name AS hws_name, 2740 name AS hws_name,
2888 kind_id AS hws_kind 2741 kind_id AS hws_kind
2889 FROM hws_lines 2742 FROM hws_lines
2890 WHERE river_id = ${river_id} 2743 WHERE river_id = ${river_id}
2891 AND official=0 2744 AND official=0
2892 AND fed_state_id IS NULL ORDER BY name 2745 AND fed_state_id IS NULL ORDER BY name
2893 </dc:statement> 2746 </dc:statement>
2894 <hws_fed_unknown> 2747 <hws_fed_unknown>
2895 <dc:call-macro name="hwslines_by_kind"/> 2748 <dc:call-macro name="hwslines_by_kind"/>
2896 </hws_fed_unknown> 2749 </hws_fed_unknown>
2897 </dc:context> 2750 </dc:context>
2901 2754
2902 <dc:macro name="floodmarks"> 2755 <dc:macro name="floodmarks">
2903 <dc:context> 2756 <dc:context>
2904 <dc:statement> 2757 <dc:statement>
2905 SELECT DISTINCT 2758 SELECT DISTINCT
2906 COALESCE(CAST (year AS VARCHAR(64)), 'Unbekanntes Jahr') AS year 2759 COALESCE(CAST (year AS VARCHAR(64)), 'Unbekanntes Jahr') AS year
2907 FROM flood_marks 2760 FROM flood_marks
2908 WHERE river_id = ${river_id} 2761 WHERE river_id = ${river_id}
2909 </dc:statement> 2762 </dc:statement>
2910 <dc:if test="dc:has-result()"> 2763 <dc:if test="dc:has-result()">
2911 <floodmarks> 2764 <floodmarks>
2912 <dc:for-each> 2765 <dc:for-each>
2913 <floodmark name="{$year}" 2766 <floodmark name="{$year}" factory="wmsfloodmarkfactory" target_out="{$out}" ids="{$river_id};{$year};{$year}"/>
2914 factory="wmsfloodmarkfactory" target_out="{$out}"
2915 ids="{$river_id};{$year};{$year}"/>
2916 </dc:for-each> 2767 </dc:for-each>
2917 </floodmarks> 2768 </floodmarks>
2918 </dc:if> 2769 </dc:if>
2919 </dc:context> 2770 </dc:context>
2920 </dc:macro> 2771 </dc:macro>
2921 2772
2922 <dc:macro name="flood-map-gaugelocations"> 2773 <dc:macro name="flood-map-gaugelocations">
2923 <gaugelocations> 2774 <gaugelocations>
2924 <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)" target_out="{$out}" /> 2775 <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)" target_out="{$out}"/>
2925 <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)" target_out="{$out}" /> 2776 <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)" target_out="{$out}"/>
2926 <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)" target_out="{$out}" /> 2777 <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)" target_out="{$out}"/>
2927 <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)" target_out="{$out}" /> 2778 <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)" target_out="{$out}"/>
2928 </gaugelocations> 2779 </gaugelocations>
2929 </dc:macro> 2780 </dc:macro>
2930 2781
2931 <dc:macro name="flood-map-riveraxis"> 2782 <dc:macro name="flood-map-riveraxis">
2932 <dc:context> 2783 <dc:context>
2933 <dc:statement> 2784 <dc:statement>
2934 SELECT DISTINCT 2785 SELECT DISTINCT
2935 ak.name AS kind_name, 2786 ak.name AS kind_name,
2936 ax.kind_id AS kind_id, 2787 ax.kind_id AS kind_id,
2937 ax.name AS layer_name 2788 ax.name AS layer_name
2938 FROM river_axes ax 2789 FROM river_axes ax
2939 JOIN axis_kinds ak on ax.kind_id = ak.id 2790 JOIN axis_kinds ak on ax.kind_id = ak.id
2940 WHERE river_id = ${river_id} 2791 WHERE river_id = ${river_id}
2941 </dc:statement> 2792 </dc:statement>
2942 <dc:if test="dc:has-result()"> 2793 <dc:if test="dc:has-result()">
2943 <axis> 2794 <axis>
2944 <dc:filter expr="$kind_id=1"> 2795 <dc:filter expr="$kind_id=1">
2945 <dc:for-each> 2796 <dc:for-each>
2946 <actual description="{$kind_name}" 2797 <actual description="{$kind_name}" ids="{$river_id};{$kind_name};{$kind_id}" factory="riveraxis" target_out="{$out}"/>
2947 ids="{$river_id};{$kind_name};{$kind_id}"
2948 factory="riveraxis" target_out="{$out}" />
2949 </dc:for-each> 2798 </dc:for-each>
2950 </dc:filter> 2799 </dc:filter>
2951 <dc:filter expr="$kind_id!=1"> 2800 <dc:filter expr="$kind_id!=1">
2952 <other> 2801 <other>
2953 <dc:for-each> 2802 <dc:for-each>
2954 <misc-axis description="{$layer_name}" 2803 <misc-axis description="{$layer_name}" ids="{$river_id};{$layer_name};{$kind_id}" factory="riveraxis" target_out="{$out}"/>
2955 ids="{$river_id};{$layer_name};{$kind_id}"
2956 factory="riveraxis" target_out="{$out}" />
2957 </dc:for-each> 2804 </dc:for-each>
2958 </other> 2805 </other>
2959 </dc:filter> 2806 </dc:filter>
2960 </axis> 2807 </axis>
2961 </dc:if> 2808 </dc:if>
2965 <dc:macro name="flood-map-km"> 2812 <dc:macro name="flood-map-km">
2966 <dc:context> 2813 <dc:context>
2967 <dc:statement> 2814 <dc:statement>
2968 SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id} 2815 SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id}
2969 </dc:statement> 2816 </dc:statement>
2970 <dc:for-each> 2817 <dc:for-each>
2971 <kilometrage factory="wmskmfactory" ids="{$river_id}" target_out="{$out}" /> 2818 <kilometrage factory="wmskmfactory" ids="{$river_id}" target_out="{$out}"/>
2972 </dc:for-each> 2819 </dc:for-each>
2973 </dc:context> 2820 </dc:context>
2974 </dc:macro> 2821 </dc:macro>
2975 2822
2976 <dc:macro name="flood-map-fixpoints"> 2823 <dc:macro name="flood-map-fixpoints">
2977 <dc:context> 2824 <dc:context>
2978 <dc:statement> 2825 <dc:statement>
2979 SELECT name AS name 2826 SELECT name AS name
2980 FROM fixpoints 2827 FROM fixpoints
2981 WHERE river_id = ${river_id} 2828 WHERE river_id = ${river_id}
2982 GROUP BY name 2829 GROUP BY name
2983 </dc:statement> 2830 </dc:statement>
2984 <dc:for-each> 2831 <dc:for-each>
2985 <fixpoints factory="wmsfixpointsfactory" target_out="{$out}" 2832 <fixpoints factory="wmsfixpointsfactory" target_out="{$out}" ids="{$river_id};{$name}"/>
2986 ids="{$river_id};{$name}"/>
2987 </dc:for-each> 2833 </dc:for-each>
2988 </dc:context> 2834 </dc:context>
2989 </dc:macro> 2835 </dc:macro>
2990 2836
2991 <dc:macro name="flood-map-qps"> 2837 <dc:macro name="flood-map-qps">
2992 <dc:context> 2838 <dc:context>
2993 <dc:statement> 2839 <dc:statement>
2994 SELECT DISTINCT 2840 SELECT DISTINCT
2995 cs.kind_id AS kind_id, 2841 cs.kind_id AS kind_id,
2996 cs.name AS layer_name, 2842 cs.name AS layer_name,
2997 ck.name AS kind_name 2843 ck.name AS kind_name
2998 FROM cross_section_tracks cs 2844 FROM cross_section_tracks cs
2999 JOIN cross_section_track_kinds ck ON cs.kind_id = ck.id 2845 JOIN cross_section_track_kinds ck ON cs.kind_id = ck.id
3000 WHERE river_id = ${river_id} 2846 WHERE river_id = ${river_id}
3001 </dc:statement> 2847 </dc:statement>
3002 <dc:if test="dc:has-result()"> 2848 <dc:if test="dc:has-result()">
3003 <qps> 2849 <qps>
3004 <dc:filter expr="$kind_id=1"> 2850 <dc:filter expr="$kind_id=1">
3005 <dc:for-each> 2851 <dc:for-each>
3006 <actual description="{$kind_name}" 2852 <actual description="{$kind_name}" factory="wmsqpsfactory" target_out="{$out}" ids="{$river_id};{$kind_name};{$kind_id}"/>
3007 factory="wmsqpsfactory" target_out="{$out}"
3008 ids="{$river_id};{$kind_name};{$kind_id}"/>
3009 </dc:for-each> 2853 </dc:for-each>
3010 </dc:filter> 2854 </dc:filter>
3011 <dc:filter expr="$kind_id = 0"> 2855 <dc:filter expr="$kind_id = 0">
3012 <dc:if test="dc:has-result()"> 2856 <dc:if test="dc:has-result()">
3013 <other> 2857 <other>
3014 <dc:for-each> 2858 <dc:for-each>
3015 <misc-qps description="{$layer_name}" 2859 <misc-qps description="{$layer_name}" factory="wmsqpsfactory" target_out="{$out}" ids="{$river_id};{$layer_name};{$kind_id}"/>
3016 factory="wmsqpsfactory" target_out="{$out}"
3017 ids="{$river_id};{$layer_name};{$kind_id}"/>
3018 </dc:for-each> 2860 </dc:for-each>
3019 </other> 2861 </other>
3020 </dc:if> 2862 </dc:if>
3021 </dc:filter> 2863 </dc:filter>
3022 </qps> 2864 </qps>
3027 <dc:macro name="flood-map-buildings"> 2869 <dc:macro name="flood-map-buildings">
3028 <buildings> 2870 <buildings>
3029 <dc:context> 2871 <dc:context>
3030 <dc:statement> 2872 <dc:statement>
3031 SELECT DISTINCT 2873 SELECT DISTINCT
3032 b.name AS building_name, 2874 b.name AS building_name,
3033 bk.name AS building_kind, 2875 bk.name AS building_kind,
3034 b.kind_id AS building_kind_id 2876 b.kind_id AS building_kind_id
3035 FROM buildings b 2877 FROM buildings b
3036 JOIN building_kinds bk ON b.kind_id = bk.id 2878 JOIN building_kinds bk ON b.kind_id = bk.id
3037 WHERE river_id = ${river_id} 2879 WHERE river_id = ${river_id}
3038 </dc:statement> 2880 </dc:statement>
3039 <dc:if test="dc:has-result()"> 2881 <dc:if test="dc:has-result()">
3040 <dc:filter expr="$building_kind_id!=0"> 2882 <dc:filter expr="$building_kind_id!=0">
3041 <dc:for-each> 2883 <dc:for-each>
3042 <buildings description="{$building_kind}" 2884 <buildings description="{$building_kind}" factory="wmsbuildingsfactory" target_out="{$out}" ids="{$river_id};{$building_kind};{$building_kind_id}"/>
3043 factory="wmsbuildingsfactory" target_out="{$out}"
3044 ids="{$river_id};{$building_kind};{$building_kind_id}"/>
3045 </dc:for-each> 2885 </dc:for-each>
3046 </dc:filter> 2886 </dc:filter>
3047 <dc:filter expr="$building_kind_id=0"> 2887 <dc:filter expr="$building_kind_id=0">
3048 <other> 2888 <other>
3049 <dc:for-each> 2889 <dc:for-each>
3050 <buildings description="{$building_name}" 2890 <buildings description="{$building_name}" factory="wmsbuildingsfactory" target_out="{$out}" ids="{$river_id};{$building_name}"/>
3051 factory="wmsbuildingsfactory" target_out="{$out}"
3052 ids="{$river_id};{$building_name}"/>
3053 </dc:for-each> 2891 </dc:for-each>
3054 </other> 2892 </other>
3055 </dc:filter> 2893 </dc:filter>
3056 </dc:if> 2894 </dc:if>
3057 </dc:context> 2895 </dc:context>
3058 <dc:context> 2896 <dc:context>
3059 <dc:statement> 2897 <dc:statement>
3060 SELECT DISTINCT 2898 SELECT DISTINCT
3061 j.kind_id AS jetty_kind_id, 2899 j.kind_id AS jetty_kind_id,
3062 jk.name AS jetty_kind 2900 jk.name AS jetty_kind
3063 FROM jetties j 2901 FROM jetties j
3064 JOIN jetty_kinds jk ON j.kind_id = jk.id 2902 JOIN jetty_kinds jk ON j.kind_id = jk.id
3065 WHERE river_id = ${river_id} 2903 WHERE river_id = ${river_id}
3066 </dc:statement> 2904 </dc:statement>
3067 <dc:if test="dc:has-result()"> 2905 <dc:if test="dc:has-result()">
3068 <jetties> 2906 <jetties>
3069 <dc:for-each> 2907 <dc:for-each>
3070 <jetty description="{$jetty_kind}" 2908 <jetty description="{$jetty_kind}" factory="wmsjettiesfactory" target_out="{$out}" ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/>
3071 factory="wmsjettiesfactory" target_out="{$out}"
3072 ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/>
3073 </dc:for-each> 2909 </dc:for-each>
3074 </jetties> 2910 </jetties>
3075 </dc:if> 2911 </dc:if>
3076 </dc:context> 2912 </dc:context>
3077 </buildings> 2913 </buildings>
3086 <dc:property name="columnPos" alias="wstcolpos"/> 2922 <dc:property name="columnPos" alias="wstcolpos"/>
3087 </dc:properties> 2923 </dc:properties>
3088 <dc:if test="dc:has-result()"> 2924 <dc:if test="dc:has-result()">
3089 <officiallines> 2925 <officiallines>
3090 <dc:for-each> 2926 <dc:for-each>
3091 <column name="{$olname}" 2927 <column name="{$olname}" ids="official-wstv-{$wstcolpos}-{$wstid}" factory="staticwqkms" target_out="{$out}"/>
3092 ids="official-wstv-{$wstcolpos}-{$wstid}"
3093 factory="staticwqkms" target_out="{$out}"/>
3094 </dc:for-each> 2928 </dc:for-each>
3095 </officiallines> 2929 </officiallines>
3096 </dc:if> 2930 </dc:if>
3097 </dc:container-context> 2931 </dc:container-context>
3098 </dc:if> 2932 </dc:if>
3099 </dc:macro> 2933 </dc:macro>
3100 2934
3101 <!-- sediment loads --> 2935 <!-- sediment loads -->
3102 <dc:macro name="sedimentload_off_epoch_filter"> 2936 <dc:macro name="sedimentload_off_epoch_filter">
3103 <dc:if test="dc:has-result()"> 2937 <dc:if test="dc:has-result()">
3104 <dc:variable name="sq_time_id" type="number" 2938 <dc:variable name="sq_time_id" type="number" expr="number($sq_ti_id)"/>
3105 expr="number($sq_ti_id)"/>
3106 <dc:if test="string-length(dc:get('epochs')) &gt; 0"> 2939 <dc:if test="string-length(dc:get('epochs')) &gt; 0">
3107 <dc:variable name="start" type="number" 2940 <dc:variable name="start" type="number" expr="dc:min-number(dc:find-all('\d{4}', $epochs))"/>
3108 expr="dc:min-number(dc:find-all('\d{4}', $epochs))"/> 2941 <dc:variable name="end" type="number" expr="dc:max-number(dc:find-all('\d{4}', $epochs))"/>
3109 <dc:variable name="end" type="number"
3110 expr="dc:max-number(dc:find-all('\d{4}', $epochs))"/>
3111 </dc:if> 2942 </dc:if>
3112 <dc:if test="string-length(dc:get('years')) &gt; 0"> 2943 <dc:if test="string-length(dc:get('years')) &gt; 0">
3113 <dc:variable name="start" type="number" 2944 <dc:variable name="start" type="number" expr="dc:min-number(dc:find-all('\d{4}', $years))"/>
3114 expr="dc:min-number(dc:find-all('\d{4}', $years))"/> 2945 <dc:variable name="end" type="number" expr="dc:max-number(dc:find-all('\d{4}', $years))"/>
3115 <dc:variable name="end" type="number"
3116 expr="dc:max-number(dc:find-all('\d{4}', $years))"/>
3117 </dc:if> 2946 </dc:if>
3118 <dc:filter expr="$kind = 'official' and 2947 <dc:filter expr="$kind = 'official' and
3119 $sqid = $sq_time_id and 2948 $sqid = $sq_time_id and
3120 not(number($end) &lt; 2949 not(number($end) &lt;
3121 number(dc:date-format('yyyy', $startyear)) 2950 number(dc:date-format('yyyy', $startyear))
3149 <!-- Common stuff --> 2978 <!-- Common stuff -->
3150 2979
3151 <dc:macro name="km-filtered-wsts"> 2980 <dc:macro name="km-filtered-wsts">
3152 <dc:context connection="system"> 2981 <dc:context connection="system">
3153 <dc:statement> 2982 <dc:statement>
3154 SELECT w.kind AS kind, 2983 SELECT w.kind AS kind,
3155 w.id AS wst_id, 2984 w.id AS wst_id,
3156 wc.id AS wst_column_id, 2985 wc.id AS wst_column_id,
3157 wc.position AS wst_column_position, 2986 wc.position AS wst_column_position,
3158 wc.description AS info, 2987 wc.description AS info,
3159 w.description AS wst_description, 2988 w.description AS wst_description,
3160 COALESCE(wc.name, '') AS wst_column_name, 2989 COALESCE(wc.name, '') AS wst_column_name,
3161 wr.a AS deffrom, 2990 wr.a AS deffrom,
3162 wr.b AS defto 2991 wr.b AS defto
3163 FROM wst_columns wc 2992 FROM wst_columns wc
3164 JOIN wsts w ON wc.wst_id = w.id 2993 JOIN wsts w ON wc.wst_id = w.id
3165 JOIN wst_ranges wr ON wc.id = wr.wst_column_id 2994 JOIN wst_ranges wr ON wc.id = wr.wst_column_id
3166 WHERE w.river_id = ${river_id} AND 2995 WHERE w.river_id = ${river_id} AND
3167 NOT((${tokm} &lt; wr.a) or (${fromkm} &gt; wr.b)) 2996 NOT((${tokm} &lt; wr.a) or (${fromkm} &gt; wr.b))
3168 ORDER BY wst_column_position 2997 ORDER BY wst_column_position
3169 </dc:statement> 2998 </dc:statement>
3170 <dc:macro-body/> 2999 <dc:macro-body/>
3171 </dc:context> 3000 </dc:context>
3172 </dc:macro> 3001 </dc:macro>
3173 3002
3174 <dc:macro name="all-user-artifacts"> 3003 <dc:macro name="all-user-artifacts">
3175 <dc:context connection="user"> 3004 <dc:context connection="user">
3176 <dc:comment>Select collections and masterartifacts. 3005 <dc:comment>Select collections and masterartifacts.
3177 XXX: The cast is a quick hack because the ld_* values are 3006 XXX: The cast is a quick hack because the ld_* values are
3178 now TEXT fields. To properly fix / asses the problems here 3007 now TEXT fields. To properly fix / asses the problems here
3179 an SLT evaluation is needed. 3008 an SLT evaluation is needed.
3180 </dc:comment> 3009 </dc:comment>
3181 <dc:statement> 3010 <dc:statement>
3182 SELECT c.name AS collection_name, 3011 SELECT c.name AS collection_name,
3183 ma.id AS a_id, 3012 ma.id AS a_id,
3184 ma.state AS a_state, 3013 ma.state AS a_state,
3185 ma.gid AS a_gid, 3014 ma.gid AS a_gid,
3186 ma.creation AS a_creation, 3015 ma.creation AS a_creation,
3187 CAST(COALESCE(ma.ld_mode, '') AS VARCHAR(255)) AS ld_m, 3016 CAST(COALESCE(ma.ld_mode, '') AS VARCHAR(255)) AS ld_m,
3188 CAST(COALESCE(ma.ld_locations, '') AS VARCHAR(255)) AS ld_l, 3017 CAST(COALESCE(ma.ld_locations, '') AS VARCHAR(255)) AS ld_l,
3189 CAST(COALESCE(ma.ld_from, '') AS VARCHAR(255)) AS ld_f, 3018 CAST(COALESCE(ma.ld_from, '') AS VARCHAR(255)) AS ld_f,
3190 CAST(COALESCE(ma.ld_to, '') AS VARCHAR(255)) AS ld_t, 3019 CAST(COALESCE(ma.ld_to, '') AS VARCHAR(255)) AS ld_t,
3191 o.name AS out_name, 3020 o.name AS out_name,
3192 o.id AS out_id, 3021 o.id AS out_id,
3193 f.name AS facet_name, 3022 f.name AS facet_name,
3194 f.num AS facet_num, 3023 f.num AS facet_num,
3195 f.description AS facet_description, 3024 f.description AS facet_description,
3196 f.id AS fid 3025 f.id AS fid
3197 FROM users u 3026 FROM users u
3198 JOIN collections c ON c.user_id = u.id 3027 JOIN
3199 JOIN master_artifacts_range ma ON ma.collection_id = c.id 3028 collections c ON c.user_id = u.id
3200 JOIN outs o ON o.artifact_id = ma.id 3029 JOIN master_artifacts_range ma ON ma.collection_id = c.id
3201 JOIN facets f ON f.out_id = o.id 3030 JOIN outs o ON o.artifact_id = ma.id
3202 WHERE u.gid = CAST(${user-id} AS UUID) 3031 JOIN facets f ON f.out_id = o.id
3203 AND ma.gid &lt;&gt; CAST(${artifact-id} AS uuid) 3032 WHERE u.gid = CAST(${user-id} AS UUID)
3204 AND f.name NOT LIKE '%empty.facet%' 3033 AND ma.gid &lt;&gt; CAST(${artifact-id} AS uuid)
3205 AND EXISTS ( 3034 AND f.name NOT LIKE '%empty.facet%'
3206 SELECT id 3035 AND EXISTS (
3207 FROM artifact_data ad 3036 SELECT id
3208 WHERE ad.artifact_id = ma.id 3037 FROM artifact_data ad
3209 AND k = 'river' 3038 WHERE ad.artifact_id = ma.id
3210 AND v = ${river}) 3039 AND k = 'river'
3040 AND v = ${river})
3211 </dc:statement> 3041 </dc:statement>
3212 <dc:virtual-column name="deffrom" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"> 3042 <dc:virtual-column name="deffrom" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)">
3213 <dc:virtual-column name="defto" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"> 3043 <dc:virtual-column name="defto" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)">
3214 <dc:macro-body/> 3044 <dc:macro-body/>
3215 </dc:virtual-column> 3045 </dc:virtual-column>
3229 </dc:macro> 3059 </dc:macro>
3230 3060
3231 <dc:macro name="artifact-range"> 3061 <dc:macro name="artifact-range">
3232 <dc:choose> 3062 <dc:choose>
3233 <dc:when test="dc:coalesce(dc:get('ld_locations'), ' ') != ' '"> 3063 <dc:when test="dc:coalesce(dc:get('ld_locations'), ' ') != ' '">
3234 <dc:variable name="fromkm" type="number" 3064 <dc:variable name="fromkm" type="number" expr="dc:min-number(dc:find-all('\d*\.?\d*',
3235 expr="dc:min-number(dc:find-all('\d*\.?\d*',
3236 dc:get('ld_locations')))"/> 3065 dc:get('ld_locations')))"/>
3237 <dc:variable name="tokm" type="number" 3066 <dc:variable name="tokm" type="number" expr="dc:max-number(dc:find-all('\d*\.?\d*',
3238 expr="dc:max-number(dc:find-all('\d*\.?\d*',
3239 dc:get('ld_locations')))"/> 3067 dc:get('ld_locations')))"/>
3240 </dc:when> 3068 </dc:when>
3241 <dc:otherwise> 3069 <dc:otherwise>
3242 <dc:variable name="fromkm" type="number" 3070 <dc:variable name="fromkm" type="number" expr="dc:fromValue(dc:get('ld_mode'),
3243 expr="dc:fromValue(dc:get('ld_mode'),
3244 dc:get('ld_locations'), dc:get('ld_from'))"/> 3071 dc:get('ld_locations'), dc:get('ld_from'))"/>
3245 <dc:variable name="tokm" type="number" 3072 <dc:variable name="tokm" type="number" expr="dc:toValue(dc:get('ld_mode'),
3246 expr="dc:toValue(dc:get('ld_mode'),
3247 dc:get('ld_locations'), dc:get('ld_to'))"/> 3073 dc:get('ld_locations'), dc:get('ld_to'))"/>
3248 <dc:if test="$fromkm > $tokm"> 3074 <dc:if test="$fromkm > $tokm">
3249 <dc:message>Inverting KM filter.</dc:message> 3075 <dc:message>Inverting KM filter.</dc:message>
3250 <dc:variable name="fromkm" type="number" 3076 <dc:variable name="fromkm" type="number" expr="dc:toValue(dc:get('ld_mode'),
3251 expr="dc:toValue(dc:get('ld_mode'),
3252 dc:get('ld_locations'), dc:get('ld_to'))"/> 3077 dc:get('ld_locations'), dc:get('ld_to'))"/>
3253 <dc:variable name="tokm" type="number" 3078 <dc:variable name="tokm" type="number" expr="dc:fromValue(dc:get('ld_mode'),
3254 expr="dc:fromValue(dc:get('ld_mode'),
3255 dc:get('ld_locations'), dc:get('ld_from'))"/> 3079 dc:get('ld_locations'), dc:get('ld_from'))"/>
3256 </dc:if> 3080 </dc:if>
3257 </dc:otherwise> 3081 </dc:otherwise>
3258 </dc:choose> 3082 </dc:choose>
3259 <dc:macro-body/> 3083 <dc:macro-body/>
3260 </dc:macro> 3084 </dc:macro>
3261 3085
3262 <dc:macro name="sinfo_flowdepths"> 3086 <dc:macro name="sinfo_flowdepths">
3263 <dc:filter expr="($out_name = 'sinfo_flow_depth' and ($facet_name = 'sinfo_flow_depth.filtered' or $facet_name = 'sinfo_flow_depth.tkh.filtered' ) )"> 3087 <!-- dc:filter expr="($out_name = 'sinfo_flow_depth' and ($facet_name = 'sinfo_flow_depth.filtered' or $facet_name = 'sinfo_flow_depth.tkh.filtered' ) )" -->
3088 <dc:filter expr="( $facet_name = 'sinfo_facet_flow_depth.filtered' or $facet_name = 'sinfo_facet_flow_depth_with_tkh.filtered' )">
3264 <dc:if test="dc:has-result()"> 3089 <dc:if test="dc:has-result()">
3265 <sinfo_flow_depths> 3090 <sinfo_flow_depths>
3266 <dc:call-macro name="collection-group"> 3091 <dc:call-macro name="collection-group">
3267 <sinfo_flow_depth description="{dc:group-key()}"> 3092 <sinfo_flow_depth description="{dc:group-key()}">
3268 <dc:for-each> 3093 <dc:for-each>
3281 </dc:if> 3106 </dc:if>
3282 </dc:filter> 3107 </dc:filter>
3283 </dc:macro> 3108 </dc:macro>
3284 3109
3285 <dc:macro name="sinfo_tkh"> 3110 <dc:macro name="sinfo_tkh">
3286 <dc:filter expr="($out_name = 'sinfo_flow_depth' and $facet_name = 'sinfo_flow_depth.tkh')"> 3111 <dc:filter expr="$facet_name = 'sinfo_facet_tkh' or $facet_name = 'sinfo_facet_tkh'">
3287 <dc:if test="dc:has-result()"> 3112 <dc:if test="dc:has-result()">
3288 <sinfo_tkhs> 3113 <sinfo_tkhs>
3289 <dc:call-macro name="collection-group"> 3114 <dc:call-macro name="collection-group">
3290 <sinfo_tkh description="{dc:group-key()}"> 3115 <sinfo_tkh description="{dc:group-key()}">
3291 <dc:for-each> 3116 <dc:for-each>
3303 </sinfo_tkhs> 3128 </sinfo_tkhs>
3304 </dc:if> 3129 </dc:if>
3305 </dc:filter> 3130 </dc:filter>
3306 </dc:macro> 3131 </dc:macro>
3307 3132
3133 <dc:macro name="sinfo_tkh_velocity">
3134 <dc:filter expr="starts-with( $facet_name , 'sinfo_facet_velocity.filtered' )">
3135 <dc:if test="dc:has-result()">
3136 <sinfo_velocities>
3137 <dc:call-macro name="collection-group">
3138 <sinfo_velocity description="{dc:group-key()}">
3139 <dc:for-each>
3140 <dc:element name="${facet_name}">
3141 <dc:attribute name="factory" value="sinfo"/>
3142 <dc:attribute name="target_out" value="${out}"/>
3143 <dc:attribute name="description" value="${facet_description}"/>
3144 <dc:attribute name="ids" value="${facet_num}"/>
3145 <dc:attribute name="artifact-id" value="${a_gid}"/>
3146 <dc:attribute name="out" value="${out_name}"/>
3147 </dc:element>
3148 </dc:for-each>
3149 </sinfo_velocity>
3150 </dc:call-macro>
3151 </sinfo_velocities>
3152 </dc:if>
3153 </dc:filter>
3154 </dc:macro>
3155
3156 <dc:macro name="sinfo_tkh_d50">
3157 <dc:filter expr="starts-with( $facet_name , 'sinfo_facet_d50.filtered' )">
3158 <dc:if test="dc:has-result()">
3159 <sinfo_bedqualities>
3160 <sinfo_d50s>
3161 <dc:call-macro name="collection-group">
3162 <sinfo_d50 description="{dc:group-key()}">
3163 <dc:for-each>
3164 <dc:element name="${facet_name}">
3165 <dc:attribute name="factory" value="sinfo"/>
3166 <dc:attribute name="target_out" value="${out}"/>
3167 <dc:attribute name="description" value="${facet_description}"/>
3168 <dc:attribute name="ids" value="${facet_num}"/>
3169 <dc:attribute name="artifact-id" value="${a_gid}"/>
3170 <dc:attribute name="out" value="${out_name}"/>
3171 </dc:element>
3172 </dc:for-each>
3173 </sinfo_d50>
3174 </dc:call-macro>
3175 </sinfo_d50s>
3176 </sinfo_bedqualities>
3177 </dc:if>
3178 </dc:filter>
3179 </dc:macro>
3180
3181 <dc:macro name="sinfo_tkh_tau">
3182 <dc:filter expr="starts-with( $facet_name , 'sinfo_facet_tau.filtered' )">
3183 <dc:if test="dc:has-result()">
3184 <sinfo_taus>
3185 <dc:call-macro name="collection-group">
3186 <sinfo_tau description="{dc:group-key()}">
3187 <dc:for-each>
3188 <dc:element name="${facet_name}">
3189 <dc:attribute name="factory" value="sinfo"/>
3190 <dc:attribute name="target_out" value="${out}"/>
3191 <dc:attribute name="description" value="${facet_description}"/>
3192 <dc:attribute name="ids" value="${facet_num}"/>
3193 <dc:attribute name="artifact-id" value="${a_gid}"/>
3194 <dc:attribute name="out" value="${out_name}"/>
3195 </dc:element>
3196 </dc:for-each>
3197 </sinfo_tau>
3198 </dc:call-macro>
3199 </sinfo_taus>
3200 </dc:if>
3201 </dc:filter>
3202 </dc:macro>
3203
3308 </datacage> 3204 </datacage>
3309 </dc:template> 3205 </dc:template>

http://dive4elements.wald.intevation.org