teichmann@5523: <?xml version="1.0" encoding="UTF-8"?> sascha@1046: <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage"> aheinecke@6053: <datacage> rrenkert@5015: aheinecke@6053: <dc:comment> aheinecke@6053: User specific part aheinecke@6053: ------------------ aheinecke@6183: This is a hack because we currently have no way to supress empty aheinecke@6183: folders (either in the client or in the datacage). aheinecke@6053: </dc:comment> aheinecke@6183: <dc:if test="dc:contains($parameters, 'user-id') and aheinecke@6183: not(dc:contains($artifact-outs, 'floodmap-hws')) and aheinecke@6183: not($current-state-id = 'state.winfo.uesk.dgm')"> aheinecke@6053: <dc:call-macro name="load-user"/> aheinecke@6053: </dc:if> aheinecke@6053: aheinecke@6053: <dc:call-macro name="load-system"/> aheinecke@6053: aheinecke@6053: <dc:macro name="load-system"> aheinecke@6053: <dc:context connection="system"> rrenkert@5015: <dc:statement> aheinecke@6053: SELECT id AS river_id, name AS river_name aheinecke@6053: FROM rivers aheinecke@6053: WHERE lower(name) LIKE lower(${river}) rrenkert@5015: </dc:statement> teichmann@5522: <dc:for-each> aheinecke@6053: <dc:call-macro name="generate-system-content"/> teichmann@5522: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> felix@3283: aheinecke@6053: <dc:macro name="load-user"> aheinecke@6053: <old_calculations> aheinecke@6053: <dc:call-macro name="generate-user-content"/> aheinecke@6053: </old_calculations> aheinecke@6053: </dc:macro> felix@4014: aheinecke@6053: <dc:macro name="generate-system-content"> aheinecke@6653: <dc:message>Generate system content with variables: {dc:dump-variables()}</dc:message> aheinecke@6183: <dc:call-macro name="artifact-range"> aheinecke@6053: <dc:call-macro name="km-filtered-wsts"> aheinecke@6053: <dc:choose> aheinecke@6053: <dc:when test="dc:contains($parameters, 'recommended')"> aheinecke@6053: <dc:comment> aheinecke@6053: Recommendations (client shall load immediately). aheinecke@6053: </dc:comment> aheinecke@6053: <dc:iterate var="out" container="artifact-outs"> aheinecke@6653: <dc:message>Rec out iteration for: {$out}</dc:message> aheinecke@6053: <dc:choose> tom@6638: <dc:when test="$out = 'w_differences'"> tom@6638: <dc:call-macro name="annotations"/> tom@6638: </dc:when> tom@6638: <dc:when test="$out = 'discharge_longitudinal_section'"> aheinecke@6053: <dc:call-macro name="annotations"/> rrenkert@6456: <dc:call-macro name="officiallines_user"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'historical_discharge_wq'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'cross_section'"> aheinecke@6053: <dc:call-macro name="cross_sections"/> aheinecke@6053: <dc:call-macro name="hyks"/> teichmann@6495: <dc:call-macro name="officiallines_user"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'discharge_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> felix@7624: <dc:call-macro name="basedata_3_officials_wq"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'computed_discharge_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> felix@7624: <dc:call-macro name="basedata_3_officials_wq"/> aheinecke@6053: <dc:call-macro name="basedata_2_fixations_wqkms"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'duration_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'reference_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'fix_wq_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: <dc:call-macro name="qsectors"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'longitudinal_section'"> aheinecke@6053: <dc:call-macro name="annotations"/> rrenkert@6456: <dc:call-macro name="officiallines_user"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'fix_longitudinal_section_curve'"> aheinecke@6053: <dc:call-macro name="annotations"/> aheinecke@6053: </dc:when> felix@6743: <dc:when test="$out = 'bedheight_middle'"> felix@6743: <dc:call-macro name="annotations"/> felix@6743: </dc:when> aheinecke@6053: <dc:when test="$out = 'bed_difference_year'"> aheinecke@6053: <dc:call-macro name="annotations"/> felix@6565: <dc:call-macro name="basedata_6_delta_w"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'bed_difference_height_year'"> aheinecke@6053: <dc:call-macro name="annotations"/> felix@6565: <dc:call-macro name="basedata_6_delta_w"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'floodmap'"> aheinecke@6053: <dc:call-macro name="flood-map-recommended"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'floodmap-hws'"> aheinecke@6053: <dc:call-macro name="flood-map-recommended"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'minfo-heights'"> aheinecke@6053: <dc:call-macro name="minfo-heights"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'minfo-heights-epoch'"> aheinecke@6053: <bedheights> aheinecke@6053: <dc:call-macro name="bed-heights-epoch"/> aheinecke@6053: </bedheights> aheinecke@6053: </dc:when> tom@6638: <dc:when test="$out = 'sedimentload_ls'"> tom@6638: <dc:call-macro name="annotations"/> tom@6638: </dc:when> tom@7664: <dc:when test="$out = 'bed_longitudinal_section'"> tom@7664: <dc:call-macro name="annotations"/> tom@7664: </dc:when> tom@7664: <dc:when test="$out = 'flow_velocity'"> tom@7664: <dc:call-macro name="annotations"/> tom@7664: </dc:when> aheinecke@6053: </dc:choose> aheinecke@6053: </dc:iterate> aheinecke@6053: </dc:when> aheinecke@6053: <dc:otherwise> aheinecke@6053: <dc:comment> felix@7303: Non - Recommendations (offered to user to choose additional data from). aheinecke@6053: </dc:comment> aheinecke@6053: <dc:iterate var="out" container="artifact-outs"> aheinecke@6653: <dc:message>Non Rec out iteration for: {$out}</dc:message> aheinecke@6053: <dc:choose> rrenkert@7961: <dc:when test="$out = 'minfo-heights-diff'"> rrenkert@7961: <dc:call-macro name="minfo-heights-diff"/> rrenkert@7961: </dc:when> aheinecke@6053: <dc:when test="$out = 'cross_section'"> aheinecke@6053: <dc:call-macro name="basedata_0"/> aheinecke@6053: <dc:call-macro name="basedata_1_additionals"/> aheinecke@6053: <dc:call-macro name="basedata_2_fixations"/> aheinecke@6053: <dc:call-macro name="basedata_3_officials"/> aheinecke@6053: <dc:call-macro name="basedata_4_heightmarks-points"/> aheinecke@6053: <dc:call-macro name="cross_sections"/> felix@6075: <dc:call-macro name="basedata_5_flood-protections"/> aheinecke@6053: <dc:call-macro name="hyks"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'longitudinal_section'"> aheinecke@6053: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> tom@6638: <dc:when test="$out = 'w_differences'"> aheinecke@6053: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'discharge_longitudinal_section'"> aheinecke@6053: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> aheinecke@6691: <dc:when test="$out = 'historical_discharge_wq'"> felix@7265: <dc:call-macro name="discharge-curve-prototype"/> aheinecke@6691: <dc:call-macro name="basedata_5_flood-protections"/> aheinecke@6691: <dc:call-macro name="basedata_0"/> aheinecke@6691: <dc:call-macro name="basedata_1_additionals"/> aheinecke@6691: <dc:call-macro name="basedata_4_heightmarks-points"/> aheinecke@6691: <computed_discharge_curve> aheinecke@6691: <dc:call-macro name="mainvalues"/> aheinecke@6691: </computed_discharge_curve> aheinecke@6691: </dc:when> aheinecke@6053: <dc:when test="$out = 'discharge_curve'"> felix@7265: <dc:call-macro name="discharge-curve-prototype"/> felix@7276: <dc:call-macro name="basedata_1_additionals_wq"/> aheinecke@6691: <dc:call-macro name="basedata_5_flood-protections"/> aheinecke@6691: <computed_discharge_curve> aheinecke@6691: <dc:call-macro name="mainvalues"/> aheinecke@6691: </computed_discharge_curve> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'duration_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: <dc:call-macro name="basedata_2_fixations_relative_point"/> aheinecke@6053: <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/> aheinecke@6053: <dc:call-macro name="basedata_5_flood-protections_relative_points"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'reference_curve'"> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: <dc:call-macro name="annotations"/> aheinecke@6053: <dc:call-macro name="basedata_1_additionals-relative_point"/> aheinecke@6053: <dc:call-macro name="basedata_2_fixations_relative_point"/> aheinecke@6053: <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/> aheinecke@6053: <dc:call-macro name="basedata_5_flood-protections_relative_points"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'fix_wq_curve'"> felix@7265: <dc:call-macro name="discharge-curve-prototype"/> aheinecke@6053: <dc:call-macro name="basedata_1_additionals_marks"/> aheinecke@6053: <dc:call-macro name="basedata_2_fixations_wqkms"/> aheinecke@6053: <dc:call-macro name="basedata_3_officials"/> aheinecke@6053: <dc:call-macro name="basedata_5_flood-protections_relative_points"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'fix_longitudinal_section_curve'"> rrenkert@6439: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'map'"> aheinecke@6053: <dc:call-macro name="flood-map-complete"/> aheinecke@6053: </dc:when> tom@6638: <dc:when test="$out = 'flow_velocity'"> felix@7233: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'bed_longitudinal_section'"> felix@7231: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> tom@6638: <dc:when test="$out = 'sedimentload_ls'"> felix@7232: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> tom@6638: <dc:when test="$out = 'bedheight_middle'"> felix@7229: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> tom@6638: <dc:when test="$out = 'bed_difference_height_year'"> felix@7230: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6277: </dc:when> tom@6638: <dc:when test="$out = 'bed_difference_year'"> felix@7230: <dc:call-macro name="longitudinal-section-prototype"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'floodmap'"> aheinecke@6053: <dc:choose> aheinecke@6053: <dc:when test="dc:contains($parameters, 'dem')"> aheinecke@6053: <dc:call-macro name="flood-map-dem"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="dc:contains($parameters, 'hws')"> aheinecke@6053: <hws> aheinecke@6053: <dc:call-macro name="flood-map-hws-lines"/> aheinecke@6053: <dc:call-macro name="flood-map-hws-points"/> aheinecke@6053: </hws> aheinecke@6053: </dc:when> aheinecke@6053: <dc:otherwise> aheinecke@6053: <dc:call-macro name="flood-map-complete"/> aheinecke@6053: </dc:otherwise> aheinecke@6053: </dc:choose> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'floodmap-hws'"> aheinecke@6053: <dc:choose> aheinecke@6053: <dc:when test="dc:contains($parameters, 'dem')"> aheinecke@6053: <dc:call-macro name="flood-map-dem"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="dc:contains($parameters, 'hws')"> aheinecke@6053: <hws> aheinecke@6053: <dc:call-macro name="flood-map-hws-lines"/> aheinecke@6053: <dc:call-macro name="flood-map-hws-points"/> aheinecke@6053: </hws> aheinecke@6053: </dc:when> aheinecke@6053: <dc:otherwise> aheinecke@6053: <dc:call-macro name="flood-map-complete"/> aheinecke@6053: </dc:otherwise> aheinecke@6053: </dc:choose> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'computed_discharge_curve'"> felix@7265: <dc:call-macro name="discharge-curve-prototype"/> felix@7276: <dc:call-macro name="basedata_0_wq"/> felix@7276: <dc:call-macro name="basedata_1_additionals_wq"/> aheinecke@6053: <dc:call-macro name="basedata_5_flood-protections"/> aheinecke@6053: <computed_discharge_curve> aheinecke@6053: <dc:call-macro name="mainvalues"/> aheinecke@6053: </computed_discharge_curve> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'minfo-heights'"> aheinecke@6053: <dc:call-macro name="minfo-heights"/> aheinecke@6053: </dc:when> aheinecke@6053: <dc:when test="$out = 'minfo-heights-epoch'"> aheinecke@6053: <bedheights> aheinecke@6053: <dc:call-macro name="bed-heights-epoch"/> aheinecke@6053: </bedheights> aheinecke@6053: </dc:when> felix@6581: <dc:when test="$out = 'differenceable'"> felix@6581: <dc:if test="$current-state-id != 'state.winfo.uesk.wsp'"> felix@6581: <dc:call-macro name="basedata_0"/> felix@6581: <dc:call-macro name="basedata_1_additionals"/> felix@6581: <dc:call-macro name="basedata_2_fixations"/> felix@6581: <dc:call-macro name="basedata_4_heightmarks-points"/> felix@6581: <dc:call-macro name="basedata_5_flood-protections"/> felix@6581: </dc:if> felix@6581: </dc:when> aheinecke@6081: <dc:when test="$out = 'waterlevels'"> felix@7572: <dc:call-macro name="basedata_0"/> felix@7572: <dc:call-macro name="basedata_1_additionals"/> felix@7572: <dc:call-macro name="basedata_2_fixations"/> felix@7675: <dc:call-macro name="basedata_3_officials"/> felix@7572: <dc:call-macro name="basedata_4_heightmarks-points"/> felix@7572: <dc:call-macro name="basedata_5_flood-protections"/> aheinecke@6081: </dc:when> aheinecke@7236: <dc:when test="starts-with($out, 'sq_relation')"> aheinecke@7236: <dc:call-macro name="sqrelations"/> aheinecke@7236: </dc:when> aheinecke@6053: </dc:choose> aheinecke@6053: </dc:iterate> aheinecke@6053: </dc:otherwise> aheinecke@6053: </dc:choose> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> rrenkert@5015: aheinecke@6053: <dc:macro name="generate-user-content"> aheinecke@7347: <dc:message>Generate user content with variables: {dc:dump-variables()}</dc:message> aheinecke@6183: <dc:call-macro name="artifact-range"> aheinecke@6095: <dc:call-macro name="all-user-artifacts"> aheinecke@6095: <dc:call-macro name="km-filtered-user-artifacts"> aheinecke@6095: <dc:choose> aheinecke@6095: <dc:when test="dc:contains($parameters, 'recommended')"> aheinecke@6095: <dc:comment> aheinecke@6095: Recommendations (user) aheinecke@6095: </dc:comment> aheinecke@6095: <dc:iterate var="out" container="artifact-outs"> aheinecke@6095: <dc:choose> aheinecke@6095: <dc:when test="$out = 'longitudinal_section'"> aheinecke@6095: <dc:call-macro name="officiallines_user"/> aheinecke@6095: </dc:when> aheinecke@6095: </dc:choose> aheinecke@6095: </dc:iterate> aheinecke@6095: </dc:when> aheinecke@6095: <dc:otherwise> aheinecke@6095: <dc:comment> felix@7303: Non Recommendations (user) - offer to load other projects aheinecke@6095: </dc:comment> aheinecke@6095: <dc:iterate var="out" container="artifact-outs"> aheinecke@6095: <dc:choose> aheinecke@6095: <dc:when test="$out = 'longitudinal_section'"> felix@7332: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'discharge_longitudinal_section'"> felix@7413: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> tom@6638: <dc:when test="$out = 'w_differences'"> felix@7413: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> felix@7266: <dc:when test="$out = 'computed_discharge_curve'"> felix@7266: <dc:call-macro name="computed-discharge-curve"/> felix@7267: <dc:call-macro name="fix-wq-curve"/> felix@7267: <dc:call-macro name="discharge-curve"/> felix@7267: <dc:call-macro name="extreme-wq-curve"/> felix@7266: </dc:when> aheinecke@6095: <dc:when test="$out = 'fix_deltawt_curve'"> aheinecke@6095: <dc:call-macro name="delta-wt"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'reference_curve'"> aheinecke@6095: <dc:call-macro name="reference-curves"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'cross_section'"> aheinecke@6095: <dc:call-macro name="waterlevels"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'fix_longitudinal_section_curve'"> tom@7428: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'fix_derivate_curve'"> aheinecke@6095: <dc:call-macro name="fix-derivate-curve"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'fix_wq_curve'"> aheinecke@6095: <dc:call-macro name="fix-wq-curve"/> aheinecke@6644: <dc:call-macro name="waterlevels-fix"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'duration_curve'"> aheinecke@6095: <dc:call-macro name="duration-curve"/> aheinecke@6095: </dc:when> felix@6581: <dc:when test="$out = 'differenceable'"> felix@7435: <dc:call-macro name="differenceable-fix"/> felix@7435: <dc:call-macro name="differences"/> felix@7435: <dc:comment comment="Candidate for:"> felix@7435: <dc:call-macro name="longitudinal-section-user-prototype"/> felix@7435: </dc:comment> felix@6581: </dc:when> aheinecke@6095: <dc:when test="$out = 'waterlevels'"> felix@7435: <dc:call-macro name="waterlevels-fix"/> felix@7435: <dc:comment comment="Candidate for:"> felix@7435: <dc:call-macro name="longitudinal-section-user-prototype"/> felix@7435: </dc:comment> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'floodmap'"> aheinecke@6095: <dc:call-macro name="flood-map"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'map'"> aheinecke@6095: <dc:call-macro name="flood-map"/> aheinecke@6095: </dc:when> tom@6638: <dc:when test="$out = 'bedheight_middle'"> teichmann@7419: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'floodmap-hws'"> aheinecke@6095: <dc:call-macro name="floodmap-hws-user"/> aheinecke@6095: </dc:when> tom@6638: <dc:when test="$out = 'flow_velocity'"> teichmann@7419: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> aheinecke@6095: <dc:when test="$out = 'bed_longitudinal_section'"> teichmann@7419: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> tom@6638: <dc:when test="$out = 'sedimentload_ls'"> teichmann@7419: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> tom@6638: <dc:when test="$out = 'bed_difference_year'"> teichmann@7419: <dc:call-macro name="longitudinal-section-user-prototype"/> aheinecke@6095: </dc:when> felix@7467: <dc:when test="$out = 'bed_difference_height_year'"> felix@7467: <dc:call-macro name="longitudinal-section-user-prototype"/> felix@7467: </dc:when> felix@7575: <dc:when test="$out = 'historical_discharge'"> felix@7575: <dc:call-macro name="historical-discharge-user"/> felix@7575: </dc:when> felix@7576: <dc:when test="$out = 'historical_discharge_wq'"> felix@7576: <dc:call-macro name="historical-discharge-wq-user"/> felix@7576: </dc:when> aheinecke@7348: <dc:when test="starts-with($out, 'sq_relation')"> aheinecke@7348: <dc:call-macro name="sqrelations_user"/> aheinecke@7348: </dc:when> aheinecke@6095: </dc:choose> aheinecke@6095: </dc:iterate> aheinecke@6095: </dc:otherwise> aheinecke@6095: </dc:choose> aheinecke@6095: </dc:call-macro> aheinecke@6081: </dc:call-macro> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> felix@4455: aheinecke@6053: <!-- Macros to load user data --> rrenkert@5631: felix@7575: <dc:macro name="historical-discharge-user"> felix@7576: <dc:filter expr="$out = 'historical_discharge' and starts-with($facet_name, 'historical_discharge.historical')"> felix@7576: <dc:if test="dc:has-result()"> felix@7576: <historical_discharges> felix@7576: <dc:call-macro name="collection-group"> felix@7576: <discharges description="{dc:group-key()}"> felix@7576: <dc:for-each> felix@7576: <dc:element name="${facet_name}"> felix@7576: <dc:attribute name="description" value="${facet_description}"/> felix@7576: <dc:attribute name="factory" value="winfo"/> felix@7576: <dc:attribute name="target_out" value="${out}"/> felix@7576: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7576: <dc:attribute name="ids" value="${facet_num}"/> felix@7576: <dc:attribute name="out" value="historical_discharge"/> felix@7576: </dc:element> felix@7576: </dc:for-each> felix@7576: </discharges> felix@7576: </dc:call-macro> felix@7576: </historical_discharges> felix@7576: </dc:if> felix@7576: </dc:filter> felix@7576: </dc:macro> felix@7576: felix@7576: <dc:macro name="historical-discharge-wq-user"> felix@7576: <dc:filter expr="$out = 'historical_discharge_wq' and starts-with($facet_name, 'historical_discharge.wq')"> felix@7575: <dc:if test="dc:has-result()"> felix@7575: <historical_discharges> felix@7575: <dc:call-macro name="collection-group"> felix@7575: <discharges description="{dc:group-key()}"> felix@7575: <dc:for-each> felix@7575: <dc:element name="${facet_name}"> felix@7575: <dc:attribute name="description" value="${facet_description}"/> felix@7575: <dc:attribute name="factory" value="winfo"/> felix@7575: <dc:attribute name="target_out" value="${out}"/> felix@7575: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7575: <dc:attribute name="ids" value="${facet_num}"/> felix@7575: <dc:attribute name="out" value="historical_discharge"/> felix@7575: </dc:element> felix@7575: </dc:for-each> felix@7575: </discharges> felix@7575: </dc:call-macro> felix@7575: </historical_discharges> felix@7575: </dc:if> felix@7575: </dc:filter> felix@7575: </dc:macro> felix@7575: aheinecke@6110: <dc:macro name="differences"> rrenkert@7795: <dc:filter expr="$facet_name = 'w_differences' or $facet_name = 'w_differences.filtered'"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6110: <differences> felix@7418: <dc:call-macro name="collection-group"> felix@7408: <differences description="{dc:group-key()}"> felix@7408: <dc:for-each> rrenkert@7795: <dc:element name="${facet_name}"> rrenkert@7795: <dc:attribute name="description" value="${facet_description}"/> rrenkert@7795: <dc:attribute name="factory" value="winfo"/> rrenkert@7795: <dc:attribute name="artifact-id" value="${a_gid}"/> rrenkert@7795: <dc:attribute name="ids" value="${facet_num}"/> rrenkert@7795: <dc:attribute name="target_out" value="${out}"/> rrenkert@7795: <dc:attribute name="out" value="${out_name}"/> rrenkert@7795: </dc:element> felix@7408: </dc:for-each> felix@7408: </differences> felix@7418: </dc:call-macro> aheinecke@6110: </differences> aheinecke@6053: </dc:if> aheinecke@6110: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@5976: aheinecke@6053: <dc:macro name="reference-curves"> felix@7457: <dc:filter expr="$out = 'reference_curve' and $facet_name = 'reference_curve'"> aheinecke@6111: <dc:if test="dc:has-result()"> aheinecke@6111: <reference_curves> felix@7457: <dc:call-macro name="collection-group"> felix@7457: <ref_curve description="{dc:group-key()}"> felix@7457: <dc:for-each> felix@7457: <dc:element name="${facet_name}"> felix@7457: <dc:attribute name="description" value="${facet_description}"/> felix@7457: <dc:attribute name="factory" value="winfo"/> felix@7457: <dc:attribute name="target_out" value="${out}"/> felix@7457: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7457: <dc:attribute name="ids" value="${facet_num}"/> felix@7457: <dc:attribute name="out" value="reference_curve"/> felix@7457: </dc:element> felix@7457: </dc:for-each> felix@7457: </ref_curve> felix@7457: </dc:call-macro> aheinecke@6111: </reference_curves> aheinecke@6111: </dc:if> aheinecke@6111: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6691: aheinecke@6717: <dc:macro name="historical_discharge_curve"> aheinecke@6849: <dc:variable name="refgauge" type="number" expr="$reference_gauge"/> aheinecke@6691: <dc:context> aheinecke@6691: <dc:statement> aheinecke@6691: SELECT g.id AS gauge_id, felix@7423: g.name AS gauge_name, felix@7423: dt.id AS dt_id, felix@7423: t.start_time AS start_time, felix@7423: t.stop_time AS stop_time, felix@7423: dt.bfg_id AS bfg_id aheinecke@6691: FROM gauges g aheinecke@6691: JOIN discharge_tables dt ON g.id = dt.gauge_id aheinecke@6691: LEFT JOIN time_intervals t ON dt.time_interval_id = t.id aheinecke@6691: WHERE g.river_id = ${river_id} felix@7423: AND dt.kind <> 0 felix@7423: AND ((g.station = ${fromkm} AND g.station = ${tokm}) felix@7423: OR g.official_number = ${refgauge}) aheinecke@6691: ORDER BY start_time aheinecke@6691: </dc:statement> aheinecke@6111: <dc:if test="dc:has-result()"> aheinecke@6691: <historical_discharge_curves> aheinecke@6691: <dc:group expr="$gauge_name"> aheinecke@6691: <dc:for-each> aheinecke@6691: <dc:variable name="combined_desc" expr="concat($bfg_id, ' ', dc:date-format('dd.MM.yyyy', $start_time), ' - ', dc:date-format('dd.MM.yyyy', $stop_time))"/> aheinecke@6691: <histdis name="{$combined_desc}" aheinecke@6691: description="{$combined_desc}" aheinecke@6691: factory="gaugedischarge" target_out="{$out}" aheinecke@6691: ids="{$gauge_name};{$dt_id};{$combined_desc}"/> aheinecke@6691: </dc:for-each> aheinecke@6691: </dc:group> aheinecke@6691: </historical_discharge_curves> aheinecke@6111: </dc:if> aheinecke@6691: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6691: aheinecke@6053: <dc:macro name="flood-map"> aheinecke@6111: <dc:filter expr="$facet_name = 'floodmap.wsplgen'"> aheinecke@6111: <dc:if test="dc:has-result()"> aheinecke@6111: <floodmap> aheinecke@6111: <dc:for-each> aheinecke@6654: <dc:variable name="combined_desc" expr="concat($facet_description, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)"/> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6237: <dc:attribute name="description" value="${combined_desc}"/> aheinecke@6111: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_id}"/> aheinecke@6111: <dc:attribute name="ids" value="${a_id}"/> aheinecke@6111: <dc:attribute name="out" value="floodmap"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </floodmap> aheinecke@6111: </dc:if> aheinecke@6111: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="waterlevels"> aheinecke@6095: <dc:filter expr="$out_name = 'cross_section'"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <waterlevels> aheinecke@6654: <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation))"> aheinecke@6111: <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment> aheinecke@6111: <longitudinal_section_columns description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="cross_section"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </longitudinal_section_columns> aheinecke@6111: </dc:group> aheinecke@6053: </waterlevels> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7418: <dc:macro name="collection-group"> felix@7418: <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)"> felix@7418: <dc:macro-body/> felix@7418: </dc:group> felix@7418: </dc:macro> felix@7418: aheinecke@6053: <dc:macro name="longitudinal"> felix@7492: <dc:filter expr="$out_name = 'longitudinal_section' and $a_state != 'state.fix.vollmer.compute'"> aheinecke@6053: <dc:if test="dc:has-result()"> felix@7332: <waterlevels_ls> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment> aheinecke@6111: <longitudinal_section_columns description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="longitudinal_section"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </longitudinal_section_columns> felix@7418: </dc:call-macro> felix@7332: </waterlevels_ls> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7491: <dc:macro name="longitudinal-section-fix-vollmer"> felix@7491: <dc:filter expr="$a_state = 'state.fix.vollmer.compute' and felix@7491: ($facet_name = 'longitudinal_section.w' or felix@7491: $facet_name = 'longitudinal_section.q') felix@7491: "> felix@7491: <dc:if test="dc:has-result()"> felix@7491: <waterlevels_fix_vollmer> felix@7491: <dc:call-macro name="collection-group"> felix@7491: <waterlevels description="{dc:group-key()}"> felix@7491: <dc:for-each> felix@7491: <dc:element name="${facet_name}"> felix@7491: <dc:attribute name="description" value="${facet_description}"/> felix@7491: <dc:attribute name="ids" value="${facet_num}"/> felix@7491: <dc:attribute name="factory" value="fixanalysis"/> felix@7491: <dc:attribute name="target_out" value="${out}"/> felix@7491: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7491: <dc:attribute name="out" value="longitudinal_section"/> felix@7491: </dc:element> felix@7491: </dc:for-each> felix@7491: </waterlevels> felix@7491: </dc:call-macro> felix@7491: </waterlevels_fix_vollmer> felix@7491: </dc:if> felix@7491: </dc:filter> felix@7491: </dc:macro> felix@7491: felix@7332: <dc:macro name="longitudinal-section-fix"> aheinecke@6111: <dc:filter expr="$out_name = 'fix_longitudinal_section_curve' and aheinecke@6111: (starts-with($facet_name, 'fix_deviation_ls') or aheinecke@6111: starts-with($facet_name, 'fix_sector_average_ls') or aheinecke@6111: starts-with($facet_name, 'fix_analysis_events_ls') or felix@7491: starts-with($facet_name, 'fix_reference_events_ls')) felix@7365: "> aheinecke@6053: <dc:if test="dc:has-result()"> felix@7332: <waterlevels_fix> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <waterlevels description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="fixanalysis"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7491: <dc:attribute name="out" value="fix_longitudinal_section_curve"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </waterlevels> felix@7418: </dc:call-macro> felix@7332: </waterlevels_fix> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="delta-wt"> aheinecke@6111: <dc:filter expr="$out_name = 'fix_deltawt_curve' and aheinecke@6111: ($facet_name = 'fix_analysis_events_dwt' or aheinecke@6111: $facet_name = 'fix_analysis_periods_dwt' or aheinecke@6111: $facet_name = 'fix_reference_events_dwt' or aheinecke@6111: starts-with($facet_name, 'fix_deviation_dwt') or aheinecke@6111: starts-with($facet_name, 'fix_sector_average_dwt'))"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <waterlevels> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <waterlevels description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="fixanalysis"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="fix_deltawt_curve"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </waterlevels> felix@7418: </dc:call-macro> aheinecke@6053: </waterlevels> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="fix-derivate-curve"> aheinecke@6111: <dc:filter expr="$out_name = 'fix_derivate_curve' and $facet_name = 'fix_derivate_curve'"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <waterlevels> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <waterlevels description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="fixanalysis"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="fix_derivate_curve"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </waterlevels> felix@7418: </dc:call-macro> aheinecke@6053: </waterlevels> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="fix-wq-curve"> aheinecke@6111: <dc:filter expr="$out_name = 'fix_wq_curve' and aheinecke@6111: (starts-with($facet_name, 'fix_analysis_events_wq') or aheinecke@6111: starts-with($facet_name, 'fix_reference_events_wq') or aheinecke@6111: starts-with($facet_name, 'fix_sector_average_wq') or aheinecke@6111: $facet_name = 'fix_wq_curve')"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <waterlevels> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <waterlevels description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="fixanalysis"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="fix_wq_curve"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </waterlevels> felix@7418: </dc:call-macro> aheinecke@6053: </waterlevels> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7267: felix@7267: <dc:macro name="discharge-curve"> felix@7267: <dc:filter expr="$facet_name = 'discharge_curve.curve'"> felix@7267: <dc:if test="dc:has-result()"> tom@7269: <discharge_curves> felix@7267: <dc:for-each> felix@7267: <dc:element name="${facet_name}"> felix@7267: <dc:attribute name="description" value="${facet_description}"/> felix@7267: <dc:attribute name="factory" value="winfo"/> felix@7267: <dc:attribute name="target_out" value="${out}"/> felix@7267: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7267: <dc:attribute name="ids" value="${a_gid}"/> felix@7267: <dc:attribute name="out" value="discharge_curve"/> felix@7267: </dc:element> felix@7267: </dc:for-each> felix@7267: </discharge_curves> felix@7267: </dc:if> felix@7267: </dc:filter> felix@7267: </dc:macro> felix@7267: felix@7267: <dc:macro name="extreme-wq-curve"> felix@7424: <dc:filter expr="$facet_name = 'extreme_wq_curve' or $facet_name = 'extreme_wq_curve_base'"> felix@7267: <dc:if test="dc:has-result()"> felix@7267: <computed_discharge_curves> felix@7267: <dc:for-each> felix@7267: <dc:element name="${facet_name}"> felix@7267: <dc:attribute name="description" value="${facet_description}"/> felix@7267: <dc:attribute name="factory" value="fixanalysis"/> felix@7267: <dc:attribute name="target_out" value="${out}"/> felix@7267: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7267: <dc:attribute name="ids" value="${a_gid}"/> felix@7267: <dc:attribute name="out" value="computed_discharge_curve"/> felix@7267: </dc:element> felix@7267: </dc:for-each> felix@7267: </computed_discharge_curves> felix@7267: </dc:if> felix@7267: </dc:filter> felix@7267: </dc:macro> felix@7267: felix@7264: <dc:macro name="computed-discharge-curve"> felix@7264: <dc:filter expr="$facet_name = 'computed_discharge_curve.q'"> felix@7264: <dc:if test="dc:has-result()"> felix@7264: <computed_discharge_curves> felix@7264: <dc:for-each> felix@7264: <dc:element name="${facet_name}"> felix@7264: <dc:attribute name="description" value="${facet_description}"/> felix@7264: <dc:attribute name="factory" value="winfo"/> felix@7264: <dc:attribute name="target_out" value="${out}"/> felix@7264: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7264: <dc:attribute name="ids" value="${a_gid}"/> felix@7264: <dc:attribute name="out" value="computed_discharge_curve"/> felix@7264: </dc:element> felix@7264: </dc:for-each> felix@7264: </computed_discharge_curves> felix@7264: </dc:if> felix@7264: </dc:filter> felix@7264: </dc:macro> felix@7264: aheinecke@6053: <dc:macro name="duration-curve"> aheinecke@6111: <dc:filter expr="$facet_name = 'duration_curve.q' or $facet_name = 'duration_curve.w'"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <computed_discharge_curves> aheinecke@6053: <dc:for-each> aheinecke@6053: <dc:element name="${facet_name}"> aheinecke@6053: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6053: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_id}"/> aheinecke@6111: <dc:attribute name="ids" value="${a_id}"/> aheinecke@6053: <dc:attribute name="out" value="duration_curve"/> aheinecke@6053: </dc:element> aheinecke@6053: </dc:for-each> aheinecke@6053: </computed_discharge_curves> aheinecke@6053: </dc:if> aheinecke@6111: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6111: <dc:comment>TODO doesnt work nicely for fix/wq-diags. Aheinecke (27.5.2013): Why?</dc:comment> aheinecke@6053: <dc:macro name="waterlevels-fix"> aheinecke@6324: <dc:filter expr="($out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w') and aheinecke@6324: (not ($current-state-id = 'state.winfo.uesk.wsp' and $ld_m = 'location'))"> aheinecke@6111: <dc:if test="dc:has-result()"> aheinecke@6111: <waterlevels> felix@7420: <dc:call-macro name="collection-group"> aheinecke@6111: <waterlevels description="{dc:group-key()}"> aheinecke@6095: <dc:for-each> aheinecke@6324: <dc:choose> aheinecke@6324: <dc:when test="$ld_m = 'location'"> aheinecke@6324: <dc:variable name="combined_desc" expr="concat($facet_description, ' an KM ', $deffrom)"/> aheinecke@6324: </dc:when> aheinecke@6324: <dc:otherwise> aheinecke@6324: <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ', aheinecke@6324: $deffrom, ' bis KM ', $defto)"/> aheinecke@6324: </dc:otherwise> aheinecke@6324: </dc:choose> aheinecke@6095: <dc:element name="${facet_name}"> aheinecke@6279: <dc:attribute name="description" value="${combined_desc}"/> aheinecke@6095: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6095: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6095: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6095: <dc:attribute name="out" value="longitudinal_section"/> aheinecke@6095: </dc:element> aheinecke@6095: </dc:for-each> aheinecke@6095: </waterlevels> felix@7420: </dc:call-macro> aheinecke@6111: </waterlevels> aheinecke@6111: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@6581: <dc:comment comment="For building differences." /> felix@6581: <dc:macro name="differenceable-fix"> felix@6615: <dc:comment> felix@6615: No diffs between beddiffs and others, for now. felix@6615: <beddifferences> felix@6615: <dc:call-macro name="bedheight_differences"/> felix@6615: </beddifferences> felix@6615: </dc:comment> felix@6587: <dc:comment comment="Vollmer curves need own factory"/> felix@6649: <dc:filter expr="$a_state = 'state.fix.vollmer.compute' and $facet_name = 'longitudinal_section.w'"> felix@6581: <dc:if test="dc:has-result()"> felix@6587: <vollmer_waterlevels> felix@7420: <dc:call-macro name="collection-group"> felix@6581: <waterlevels description="{dc:group-key()}"> felix@6581: <dc:for-each> felix@6581: <dc:choose> felix@6581: <dc:when test="$ld_m = 'location'"> felix@6581: <dc:variable name="combined_desc" expr="concat($facet_description, ' an KM ', $deffrom)"/> felix@6581: </dc:when> felix@6581: <dc:otherwise> felix@6581: <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ', felix@6581: $deffrom, ' bis KM ', $defto)"/> felix@6581: </dc:otherwise> felix@6581: </dc:choose> felix@6587: <dc:element name="${facet_name}"> felix@6587: <dc:attribute name="description" value="${combined_desc}"/> felix@6587: <dc:attribute name="ids" value="${facet_num}"/> felix@6587: <dc:attribute name="factory" value="fixanalysis"/> felix@6587: <dc:attribute name="target_out" value="${out}"/> felix@6587: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@6587: <dc:attribute name="out" value="longitudinal_section"/> felix@6587: </dc:element> felix@6581: </dc:for-each> felix@6581: </waterlevels> felix@7420: </dc:call-macro> felix@6587: </vollmer_waterlevels> felix@6587: </dc:if> felix@6587: </dc:filter> felix@6587: <dc:filter expr="not($a_state = 'state.fix.vollmer.compute') and (($out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w') and felix@6587: (not ($current-state-id = 'state.winfo.uesk.wsp' and $ld_m = 'location')))"> felix@6587: <dc:if test="dc:has-result()"> felix@6581: <waterlevels> felix@7420: <dc:call-macro name="collection-group"> felix@6581: <waterlevels description="{dc:group-key()}"> felix@6581: <dc:for-each> felix@6581: <dc:choose> felix@6581: <dc:when test="$ld_m = 'location'"> felix@6581: <dc:variable name="combined_desc" expr="concat($facet_description, ' an KM ', $deffrom)"/> felix@6581: </dc:when> felix@6581: <dc:otherwise> felix@6581: <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ', felix@6581: $deffrom, ' bis KM ', $defto)"/> felix@6581: </dc:otherwise> felix@6581: </dc:choose> felix@6587: <dc:element name="${facet_name}"> felix@6587: <dc:attribute name="description" value="${combined_desc}"/> felix@6587: <dc:attribute name="ids" value="${facet_num}"/> felix@6587: <dc:attribute name="factory" value="winfo"/> felix@6587: <dc:attribute name="target_out" value="${out}"/> felix@6587: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@6587: <dc:attribute name="out" value="longitudinal_section"/> felix@6587: </dc:element> felix@6581: </dc:for-each> felix@6581: </waterlevels> felix@7420: </dc:call-macro> felix@6581: </waterlevels> felix@6581: </dc:if> felix@6581: </dc:filter> felix@6581: </dc:macro> felix@6581: felix@6581: aheinecke@6053: <dc:macro name="floodmap-hws-user"> aheinecke@6111: <dc:comment>No grouping in this?</dc:comment> aheinecke@6111: <dc:filter expr="$out_name = 'floodmap' and $facet_name = 'floodmap.usershape'"> aheinecke@6111: <own-hws> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@6111: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="floodmap"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6111: </own-hws> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7443: <dc:macro name="bedquality"> aheinecke@6111: <dc:filter expr="$out_name = 'bed_longitudinal_section' and aheinecke@6111: ($facet_name = 'bed_longitudinal_section.bed_diameter_toplayer' or felix@7443: $facet_name = 'bed_longitudinal_section.bed_diameter_sublayer' or felix@7443: $facet_name = 'bed_longitudinal_section.bedload_diameter' or felix@7443: $facet_name = 'bed_longitudinal_section.sediment_density_toplayer' or felix@7443: $facet_name = 'bed_longitudinal_section.sediment_density_sublayer' or felix@7443: $facet_name = 'bed_longitudinal_section.porosity_toplayer' or felix@7443: $facet_name = 'bed_longitudinal_section.porosity_sublayer')"> aheinecke@6053: <dc:if test="dc:has-result()"> felix@7443: <bed_quality> felix@7420: <dc:call-macro name="collection-group"> aheinecke@6111: <quality-bed description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="factory" value="minfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}-${facet_name}"/> aheinecke@7177: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@6111: <dc:attribute name="out" value="bed_longitudinal_section"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6053: </quality-bed> felix@7420: </dc:call-macro> felix@7443: </bed_quality> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flow-velocity"> tom@6638: <dc:filter expr="$out_name = 'flow_velocity' and felix@7469: starts-with($facet_name, 'flow_velocity')"> aheinecke@6053: <dc:if test="dc:has-result()"> felix@7441: <flow_velocity> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <flow description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="factory" value="minfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> felix@7470: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@7177: <dc:attribute name="artifact-id" value="${a_gid}"/> tom@6638: <dc:attribute name="out" value="flow_velocity"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6053: </flow> felix@7418: </dc:call-macro> felix@7441: </flow_velocity> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="sediment-load"> tom@6638: <dc:filter expr="$out_name = 'sedimentload_ls' and starts-with($facet_name, 'sedimentload')"> aheinecke@6053: <dc:if test="dc:has-result()"> felix@7441: <sediment_load> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <load description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="factory" value="minfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> felix@7662: <dc:attribute name="ids" value="${facet_num}"/> felix@7662: <dc:comment> felix@7662: <!--dc:attribute name="info" value="debug: ${facet_num}-${facet_name}"/--> felix@7662: </dc:comment> aheinecke@7177: <dc:attribute name="artifact-id" value="${a_gid}"/> tom@6638: <dc:attribute name="out" value="sedimentload_ls"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6053: </load> felix@7418: </dc:call-macro> felix@7441: </sediment_load> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: rrenkert@8004: <dc:macro name="middle_bedheights"> rrenkert@8004: <dc:filter expr="($out_name = 'bedheight_middle') and rrenkert@8004: (starts-with($facet_name, 'bedheight_middle.single'))"> rrenkert@8004: <dc:if test="dc:has-result()"> rrenkert@8004: <middle_bedheights> rrenkert@8004: <dc:call-macro name="collection-group"> rrenkert@8004: <middle_bedheight description="{dc:group-key()}"> rrenkert@8004: <dc:for-each> rrenkert@8004: <dc:element name="${facet_name}"> rrenkert@8004: <dc:attribute name="factory" value="minfo"/> rrenkert@8004: <dc:attribute name="target_out" value="${out}"/> rrenkert@8004: <dc:attribute name="description" value="${facet_description}"/> rrenkert@8004: <dc:attribute name="ids" value="${facet_num}"/> rrenkert@8004: <dc:attribute name="artifact-id" value="${a_gid}"/> rrenkert@8004: <dc:attribute name="out" value="${out_name}"/> rrenkert@8004: </dc:element> rrenkert@8004: </dc:for-each> rrenkert@8004: </middle_bedheight> rrenkert@8004: </dc:call-macro> rrenkert@8004: </middle_bedheights> rrenkert@8004: </dc:if> rrenkert@8004: </dc:filter> rrenkert@8004: </dc:macro> rrenkert@8004: felix@6595: <dc:macro name="bedheight_differences"> rrenkert@7923: <dc:filter expr="($out_name = 'bed_difference_year' or $out_name = 'bed_difference_height_year') and rrenkert@7923: (starts-with($facet_name, 'bedheight_difference.year') or starts-with($facet_name, 'bedheight_difference.height'))"> aheinecke@6053: <dc:if test="dc:has-result()"> felix@6595: <bedheight_differences> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <difference description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="factory" value="minfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> felix@6615: <dc:attribute name="ids" value="${facet_num}"/> felix@6572: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@6589: <dc:attribute name="out" value="${out_name}"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6053: </difference> felix@7418: </dc:call-macro> felix@6595: </bedheight_differences> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@7348: <dc:macro name="sqrelations_user"> aheinecke@7348: <dc:filter expr=" aheinecke@7362: ($out = 'sq_relation_a' and starts-with($facet_name, 'sq_a_')) or aheinecke@7362: ($out = 'sq_relation_b' and starts-with($facet_name, 'sq_b_')) or aheinecke@7362: ($out = 'sq_relation_c' and starts-with($facet_name, 'sq_c_')) or aheinecke@7362: ($out = 'sq_relation_d' and starts-with($facet_name, 'sq_d_')) or aheinecke@7362: ($out = 'sq_relation_e' and starts-with($facet_name, 'sq_e_')) or aheinecke@7362: ($out = 'sq_relation_f' and starts-with($facet_name, 'sq_f_'))"> aheinecke@7348: <dc:if test="dc:has-result()"> aheinecke@7348: <sq_relations> felix@7418: <dc:call-macro name="collection-group"> aheinecke@7348: <sqrel description="{dc:group-key()}"> aheinecke@7348: <dc:for-each> aheinecke@7348: <dc:element name="${facet_name}"> aheinecke@7348: <dc:attribute name="factory" value="minfo"/> aheinecke@7348: <dc:attribute name="target_out" value="${out}"/> aheinecke@7348: <dc:attribute name="description" value="${facet_description}"/> aheinecke@7348: <dc:attribute name="ids" value="${facet_num}"/> aheinecke@7348: <dc:attribute name="artifact-id" value="${a_gid}"/> aheinecke@7348: <dc:attribute name="out" value="${out_name}"/> aheinecke@7348: </dc:element> aheinecke@7348: </dc:for-each> aheinecke@7348: </sqrel> felix@7418: </dc:call-macro> aheinecke@7348: </sq_relations> aheinecke@7348: </dc:if> aheinecke@7348: </dc:filter> aheinecke@7348: </dc:macro> aheinecke@7348: aheinecke@6053: <dc:macro name="waterlevels-discharge"> felix@7426: <dc:filter expr="$out_name = 'discharge_longitudinal_section'"> aheinecke@6053: <dc:if test="dc:has-result()"> felix@7332: <waterlevels_discharge> felix@7418: <dc:call-macro name="collection-group"> aheinecke@6111: <discharge description="{dc:group-key()}"> aheinecke@6111: <dc:for-each> aheinecke@6111: <dc:element name="${facet_name}"> aheinecke@6111: <dc:attribute name="factory" value="winfo"/> aheinecke@6124: <dc:attribute name="target_out" value="${out}"/> aheinecke@6111: <dc:attribute name="description" value="${facet_description}"/> aheinecke@6111: <dc:attribute name="ids" value="${facet_num}-${facet_name}"/> aheinecke@7177: <dc:attribute name="artifact-id" value="${a_gid}"/> felix@7407: <dc:attribute name="out" value="discharge_longitudinal_section"/> aheinecke@6111: </dc:element> aheinecke@6111: </dc:for-each> aheinecke@6053: </discharge> felix@7418: </dc:call-macro> felix@7332: </waterlevels_discharge> aheinecke@6053: </dc:if> aheinecke@6095: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: <!-- Macros to load system data --> aheinecke@6053: aheinecke@6053: <dc:macro name="annotations"> aheinecke@6124: <annotation factory="annotations" ids="{$river_id}" target_out="{$out}" /> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="mainvalues"> aheinecke@6124: <wmainvalue factory="mainvalue" ids="{$river_id}:w" target_out="{$out}" /> aheinecke@6124: <qmainvalue factory="mainvalue" ids="{$river_id}:q" target_out="{$out}" /> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="cross_sections"> aheinecke@6053: <cross_sections id="flood-protections-{$river_id}"> aheinecke@6053: <dc:context connection="system"> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: cs.id AS prot_id, aheinecke@6053: cs.description AS prot_description aheinecke@6053: FROM cross_sections cs aheinecke@6053: JOIN cross_section_lines csl ON csl.cross_section_id = cs.id aheinecke@6053: WHERE cs.river_id = ${river_id} aheinecke@6053: AND csl.km BETWEEN ${fromkm} AND ${tokm} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <cross_section name="{$prot_description}" aheinecke@6053: ids="{$prot_id}" aheinecke@6124: factory="crosssections" target_out="{$out}" /> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </cross_sections> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="hyks"> aheinecke@6053: <hyks id="hyk-{$river_id}"> aheinecke@6053: <dc:context connection="system"> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: h.id AS hyk_id, aheinecke@6053: h.description AS hyk_description aheinecke@6053: FROM hyks h aheinecke@6053: JOIN hyk_entries he ON he.hyk_id = h.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND he.km BETWEEN ${fromkm} AND ${tokm} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <hyk name="{$hyk_description}" aheinecke@6053: ids="{$hyk_id}" aheinecke@6124: factory="hyk" target_out="{$out}" /> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </hyks> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="fixings-macro"> aheinecke@6053: <dc:filter expr="$kind=2"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <fixations> aheinecke@6053: <dc:group expr="dc:replace($wst_description, 'Fixierungen/', '')"> aheinecke@6053: <fixation name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <dc:macro-body/> aheinecke@6053: </dc:for-each> aheinecke@6053: </fixation> aheinecke@6053: </dc:group> aheinecke@6053: </fixations> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_2_fixations_wqkms"> aheinecke@6053: <dc:call-macro name="fixings-macro"> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="fixations-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="wqinterpol" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_2_fixations"> aheinecke@6053: <dc:call-macro name="fixings-macro"> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="fixations-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwqkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_3_officials"> aheinecke@6053: <dc:filter expr="$kind=3"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <officiallines> aheinecke@6053: <dc:group expr="$wst_description"> aheinecke@6053: <official name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="additionals-wstv-{$wst_column_position}-{$wst_id}" felix@7621: factory="staticwqkms" felix@7621: target_out="{$out}" felix@7621: info="{$info} [km {$deffrom} - {$defto}]"/> felix@7621: </dc:for-each> felix@7621: </official> felix@7621: </dc:group> felix@7621: </officiallines> felix@7621: </dc:if> felix@7621: </dc:filter> felix@7621: </dc:macro> felix@7621: felix@7621: <dc:macro name="basedata_3_officials_wq"> felix@7621: <dc:filter expr="$kind=3"> felix@7621: <dc:if test="dc:has-result()"> felix@7621: <officiallines> felix@7621: <dc:group expr="$wst_description"> felix@7621: <official name="{dc:group-key()}"> felix@7621: <dc:for-each> felix@7621: <column name="{$wst_column_name}" felix@7621: ids="officials_wq-wstv-{$wst_column_position}-{$wst_id}" felix@7621: factory="wqinterpol" felix@7621: target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </official> aheinecke@6053: </dc:group> aheinecke@6053: </officiallines> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_4_heightmarks-points"> aheinecke@6053: <dc:filter expr="$kind=4"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <heightmarks> aheinecke@6081: <dc:group expr="dc:replace($wst_description, 'HW-Marken/', '')"> aheinecke@6084: <heightmark name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </heightmark> aheinecke@6053: </dc:group> aheinecke@6053: </heightmarks> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_4_heightmarks-points-relative_points"> aheinecke@6053: <dc:filter expr="$kind=4"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <heightmarks> aheinecke@6081: <dc:group expr="dc:replace($wst_description, 'HW-Marken/', '')"> aheinecke@6084: <relativepoint name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </relativepoint> aheinecke@6053: </dc:group> aheinecke@6053: </heightmarks> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7265: <dc:macro name="discharge-curve-prototype"> felix@7265: <dc:call-macro name="discharge_table_gauge"/> felix@7265: <dc:call-macro name="historical_discharge_curve"/> felix@7265: <dc:call-macro name="basedata_0_wq"/> felix@7621: <dc:call-macro name="basedata_3_officials_wq"/> felix@7265: <dc:call-macro name="basedata_2_fixations_wqkms"/> felix@7265: <dc:call-macro name="basedata_4_heightmarks-points"/> felix@7265: </dc:macro> felix@7265: aheinecke@6053: <dc:macro name="longitudinal-section-prototype"> aheinecke@6053: <dc:call-macro name="basedata_0"/> aheinecke@6053: <dc:call-macro name="basedata_1_additionals"/> aheinecke@6053: <dc:call-macro name="basedata_2_fixations"/> felix@7421: <dc:call-macro name="basedata_3_officials"/> aheinecke@6053: <dc:call-macro name="basedata_4_heightmarks-points"/> aheinecke@6053: <dc:call-macro name="basedata_5_flood-protections"/> aheinecke@6053: <dc:call-macro name="annotations_per_type"/> felix@7171: <minfo> felix@7329: <fixanalysis> felix@7329: <dc:call-macro name="basedata_6_delta_w"/> felix@7329: <dc:call-macro name="basedata_7_waterlevels"/> felix@7329: </fixanalysis> felix@7190: <dc:call-macro name="yields"/> felix@7209: <dc:call-macro name="densities"/> felix@7218: <dc:call-macro name="minfo-heights"/> felix@7229: <dc:call-macro name="sounding-width"/> felix@7218: <dc:call-macro name="morph_width"/> rrenkert@7851: <dc:call-macro name="porosities"/> felix@7474: <flow_velocities> felix@7474: <dc:call-macro name="flow_velocity_measurements"/> felix@7474: <dc:call-macro name="flow_velocity_models"/> felix@7474: </flow_velocities> felix@7171: </minfo> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7333: <dc:macro name="longitudinal-section-user-prototype"> teichmann@7419: <dc:comment> WINFO/DIFF/FIX </dc:comment> teichmann@7419: <dc:call-macro name="longitudinal"/> teichmann@7419: <dc:call-macro name="differences"/> teichmann@7419: <dc:call-macro name="waterlevels-discharge"/> teichmann@7419: <dc:call-macro name="longitudinal-section-fix"/> felix@7491: <dc:call-macro name="longitudinal-section-fix-vollmer"/> teichmann@7419: <dc:comment> MINFO </dc:comment> rrenkert@8004: <dc:call-macro name="middle_bedheights"/> teichmann@7419: <dc:call-macro name="bedheight_differences"/> felix@7443: <dc:call-macro name="bedquality"/> teichmann@7419: <dc:call-macro name="flow-velocity"/> teichmann@7419: <dc:call-macro name="sediment-load"/> felix@7333: </dc:macro> felix@7333: rrenkert@7851: <dc:macro name="porosities"> rrenkert@7851: <porosities> rrenkert@7851: <dc:context> rrenkert@7851: <dc:statement> rrenkert@7851: SELECT DISTINCT rrenkert@7851: p.id AS pid, rrenkert@7851: p.description AS description, rrenkert@7851: d.lower AS depth_lower, tom@7905: d.upper AS depth_upper, tom@7905: p.description || '<BR>' || tom@7905: 'Tiefe: ' || d.lower || ' - ' || d.upper tom@7905: || ' cm <BR>' || tom@7905: 'Zeitraum: ' || t.start_time || ' - ' || t.stop_time tom@7905: AS info rrenkert@7851: FROM porosity p rrenkert@7851: JOIN depths d ON p.depth_id = d.id tom@7905: JOIN time_intervals t ON p.time_interval_id=t.id rrenkert@7851: WHERE p.river_id = ${river_id} rrenkert@7851: ORDER BY depth_lower, depth_upper rrenkert@7851: </dc:statement> rrenkert@7851: <dc:if test="dc:has-result()"> rrenkert@7851: <dc:for-each> rrenkert@7851: <porosity description="{$depth_lower}-{$depth_upper} cm" rrenkert@7851: factory="porosity" rrenkert@7851: target_out="{$out}" tom@7905: info="{$info}" rrenkert@7881: ids="{$pid};{$description}" /> rrenkert@7851: </dc:for-each> rrenkert@7851: </dc:if> rrenkert@7851: </dc:context> rrenkert@7851: </porosities> rrenkert@7851: </dc:macro> felix@7333: felix@7208: <dc:macro name="densities"> felix@7208: <densities> felix@7208: <dc:context> felix@7208: <dc:statement> felix@7208: SELECT DISTINCT felix@7208: sd.id AS sdid, felix@7208: sd.description AS description, felix@7208: d.lower AS depth_lower, felix@7451: d.upper AS depth_upper, felix@7451: min(sdv.year) AS year felix@7208: FROM sediment_density sd felix@7208: JOIN depths d ON sd.depth_id = d.id felix@7451: JOIN sediment_density_values sdv on sdv.sediment_density_id = sd.id felix@7450: WHERE sd.river_id = ${river_id} felix@7451: GROUP BY sd.id, sd.description, d.upper, d.lower felix@7451: ORDER BY year, depth_lower, depth_upper felix@7208: </dc:statement> felix@7208: <dc:if test="dc:has-result()"> felix@7208: <dc:for-each> felix@7429: <density description="{$depth_lower}-{$depth_upper} cm" felix@7208: factory="sedimentdensity" felix@7208: target_out="{$out}" felix@7429: info="{$description}" felix@7208: ids="{$sdid}" /> felix@7208: </dc:for-each> felix@7208: </dc:if> felix@7208: </dc:context> felix@7208: </densities> felix@7208: </dc:macro> felix@7208: felix@7277: <dc:macro name="one-load"> felix@7277: <dc:for-each> felix@7277: <dc:variable name="syear" type="string" expr="dc:date-format('yyyy', $year)"/> felix@7277: <year description="{$syear}" felix@7277: factory="sedimentyield" felix@7277: target_out="{$out}" felix@7277: info="{$description}" felix@7277: ids="{$syid}" /> felix@7277: </dc:for-each> felix@7277: </dc:macro> felix@7278: felix@7279: <dc:macro name="epoch-load"> felix@7279: <dc:for-each> felix@7279: <dc:variable name="syear" type="string" expr="dc:date-format('yyyy', $startyear)"/> felix@7280: <dc:variable name="eyear" type="string" expr="dc:date-format('yyyy', $endyear)"/> felix@7294: <year description="{$syear}-{$eyear}" felix@7279: factory="sedimentyield" felix@7279: target_out="{$out}" felix@7279: info="{$description}" felix@7279: ids="{$syid}" /> felix@7279: </dc:for-each> felix@7279: </dc:macro> felix@7279: felix@7278: <dc:macro name="loads"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <dc:filter expr="$fraction='sand'"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <sand> felix@7280: <dc:macro-body/> felix@7278: </sand> felix@7278: </dc:if> felix@7278: </dc:filter> felix@7278: <dc:filter expr="$fraction='fine_middle'"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <fine_middle> felix@7280: <dc:macro-body/> felix@7278: </fine_middle> felix@7278: </dc:if> felix@7278: </dc:filter> felix@7278: <dc:filter expr="$fraction='coarse'"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <coarse> felix@7280: <dc:macro-body/> felix@7278: </coarse> felix@7278: </dc:if> felix@7278: </dc:filter> felix@7278: <dc:filter expr="$fraction='suspended_sediment'"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <susp_sediment> felix@7280: <dc:macro-body/> felix@7278: </susp_sediment> felix@7278: </dc:if> felix@7278: </dc:filter> felix@7278: <dc:filter expr="$fraction='susp_sand'"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <susp_sand> felix@7280: <dc:macro-body/> felix@7278: </susp_sand> felix@7278: </dc:if> felix@7278: </dc:filter> felix@7278: <dc:filter expr="$fraction='susp_sand_bed'"> felix@7278: <dc:if test="dc:has-result()"> felix@7278: <susp_sand_bed> felix@7280: <dc:macro-body/> felix@7278: </susp_sand_bed> felix@7278: </dc:if> felix@7278: </dc:filter> felix@7359: <dc:filter expr="$fraction='total'"> felix@7359: <dc:if test="dc:has-result()"> felix@7359: <total_load> felix@7359: <dc:macro-body/> felix@7359: </total_load> felix@7359: </dc:if> felix@7359: </dc:filter> felix@7278: </dc:if> felix@7278: </dc:macro> felix@7277: felix@7190: <dc:macro name="yields"> felix@7191: <yields> tom@7665: <dc:call-macro name="annotations_sediment_yield"/> felix@7191: <years> felix@7190: <dc:context> felix@7190: <dc:statement> felix@7190: SELECT DISTINCT felix@7278: sy.id AS syid, felix@7190: sy.description AS description, felix@7223: ti.start_time AS year, felix@7223: gf.name AS fraction felix@7190: FROM sediment_yield sy felix@7190: JOIN rivers r ON sy.river_id = r.id felix@7190: JOIN sediment_yield_values syv ON sy.id = syv.sediment_yield_id felix@7190: JOIN time_intervals ti ON sy.time_interval_id = ti.id felix@7223: JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id felix@7195: WHERE r.id = ${river_id} felix@7190: AND ti.stop_time IS NULL felix@7190: AND syv.station BETWEEN ${fromkm} AND ${tokm} tom@7666: ORDER BY fraction, year DESC felix@7190: </dc:statement> felix@7280: <dc:call-macro name="loads"> felix@7280: <dc:call-macro name="one-load"/> felix@7280: </dc:call-macro> felix@7190: </dc:context> felix@7191: </years> felix@7191: <epochs> felix@7191: <dc:context> felix@7191: <dc:statement> felix@7191: SELECT DISTINCT felix@7278: sy.id AS syid, felix@7191: sy.description AS description, felix@7279: ti.start_time AS startyear, felix@7279: ti.stop_time AS endyear, felix@7278: gf.name AS fraction felix@7191: FROM sediment_yield sy felix@7191: JOIN rivers r ON sy.river_id = r.id felix@7191: JOIN sediment_yield_values syv ON sy.id = syv.sediment_yield_id felix@7191: JOIN time_intervals ti ON sy.time_interval_id = ti.id felix@7278: JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id felix@7195: WHERE r.id = ${river_id} felix@7191: AND ti.stop_time IS NOT NULL felix@7191: AND syv.station BETWEEN ${fromkm} AND ${tokm} tom@7666: ORDER BY fraction, startyear DESC, endyear DESC felix@7191: </dc:statement> felix@7280: <dc:call-macro name="loads"> felix@7280: <dc:call-macro name="epoch-load"/> felix@7280: </dc:call-macro> felix@7191: </dc:context> felix@7191: </epochs> felix@7191: </yields> felix@7190: </dc:macro> felix@7190: felix@7190: aheinecke@6053: <dc:macro name="basedata_5_flood-protections"> aheinecke@6053: <dc:filter expr="$kind=5"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <flood_protections> aheinecke@6053: <dc:group expr="dc:replace($wst_description, 'HW-Schutzanlagen/', '')"> aheinecke@6053: <flood_protection name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </flood_protection> aheinecke@6053: </dc:group> aheinecke@6053: </flood_protections> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="annotations_per_type"> aheinecke@6053: <annotations> aheinecke@6053: <dc:context> aheinecke@6124: <all_annotations factory="annotations" ids="{$river_id}" target_out="{$out}" /> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT id AS anno_id, aheinecke@6053: name AS anno_description aheinecke@6053: FROM annotation_types aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <annotation name="{$anno_description}" aheinecke@6124: factory="annotations" target_out="{$out}" aheinecke@6053: ids="{$river_id}:{$anno_description}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </annotations> aheinecke@6053: </dc:macro> aheinecke@6053: tom@7665: <dc:macro name="annotations_sediment_yield"> tom@7665: <sources_sinks> tom@7665: <dc:context> tom@7665: <dc:statement> tom@7665: SELECT id AS anno_id, tom@7665: name AS anno_description tom@7665: FROM annotation_types tom@7978: WHERE name LIKE 'Quelle %' OR name LIKE 'Senke %' tom@7665: </dc:statement> tom@7665: <dc:for-each> tom@7665: <annotation name="{$anno_description}" tom@7665: factory="annotations" target_out="{$out}" tom@7665: ids="{$river_id}:{$anno_description}"/> tom@7665: </dc:for-each> tom@7665: </dc:context> tom@7665: </sources_sinks> tom@7665: </dc:macro> tom@7665: aheinecke@6053: <dc:macro name="basedata_2_fixations_relative_point"> aheinecke@6053: <dc:filter expr="$kind=2"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <fixations> aheinecke@6053: <dc:group expr="dc:replace($wst_description, 'Fixierungen/', '')"> aheinecke@6053: <relativepoint name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="fixations-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </relativepoint> aheinecke@6053: </dc:group> aheinecke@6053: </fixations> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_5_flood-protections_relative_points"> aheinecke@6053: <dc:filter expr="$kind=5"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <flood_protections> aheinecke@6053: <dc:group expr="$wst_description"> aheinecke@6053: <relativepoint name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </relativepoint> aheinecke@6053: </dc:group> aheinecke@6053: </flood_protections> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_1_additionals-relative_point"> aheinecke@6053: <dc:filter expr="$kind=1"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <additionals> aheinecke@6053: <dc:group expr="$wst_description"> aheinecke@6053: <relativepoint name="{dc:group-key()}"> aheinecke@6053: <dc:for-each> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="additionals-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </relativepoint> aheinecke@6053: </dc:group> aheinecke@6053: </additionals> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7171: felix@7171: <dc:macro name="basedata_7_waterlevels"> felix@7171: <dc:filter expr="$kind=7"> felix@7171: <dc:if test="dc:has-result()"> felix@7171: <wlevel> tom@7173: <dc:group expr="dc:replace($wst_description, 'CSV/', '')"> felix@7171: <relativepoint name="{dc:group-key()}"> felix@7171: <dc:for-each> felix@7171: <column name="{$wst_column_name}" felix@7171: ids="additionals-wstv-{$wst_column_position}-{$wst_id}" felix@7171: factory="staticwqkms" target_out="{$out}" felix@7171: info="{$info} [km {$deffrom} - {$defto}]"/> felix@7171: </dc:for-each> felix@7171: </relativepoint> felix@7171: </dc:group> felix@7171: </wlevel> felix@7171: </dc:if> felix@7171: </dc:filter> felix@7171: </dc:macro> felix@7171: felix@7171: rrenkert@6226: <dc:macro name="basedata_6_delta_w"> rrenkert@6226: <dc:filter expr="$kind=6"> rrenkert@6226: <dc:if test="dc:has-result()"> rrenkert@6226: <delta_w> tom@7174: <delta_w_cm> tom@7174: <dc:filter expr="contains($wst_description, 'cm.csv')"> tom@7174: <dc:group expr="dc:replace($wst_description, 'CSV/', '')"> tom@7174: <relativepoint name="{dc:group-key()}"> tom@7174: <dc:for-each> tom@7174: <column name="{$wst_column_name}" tom@7174: ids="delta_w-wstv-{$wst_column_position}-{$wst_id}" felix@7524: factory="staticwkms" felix@7524: target_out="{$out}" tom@7174: info="{$info} [km {$deffrom} - {$defto}]"/> tom@7174: </dc:for-each> tom@7174: </relativepoint> tom@7174: </dc:group> tom@7174: </dc:filter> tom@7174: </delta_w_cm> tom@7174: <delta_w_cma> tom@7174: <dc:filter expr="contains($wst_description, 'cm-a.csv')"> tom@7174: <dc:group expr="dc:replace($wst_description, 'CSV/', '')"> tom@7174: <relativepoint name="{dc:group-key()}"> tom@7174: <dc:for-each> tom@7174: <column name="{$wst_column_name}" felix@7524: ids="delta_w_cma-wstv-{$wst_column_position}-{$wst_id}" tom@7174: factory="staticwkms" target_out="{$out}" tom@7174: info="{$info} [km {$deffrom} - {$defto}]"/> tom@7174: </dc:for-each> tom@7174: </relativepoint> tom@7174: </dc:group> tom@7174: </dc:filter> tom@7174: </delta_w_cma> rrenkert@6226: </delta_w> rrenkert@6226: </dc:if> rrenkert@6226: </dc:filter> rrenkert@6226: </dc:macro> rrenkert@6226: aheinecke@6053: <dc:macro name="discharge_table_gauge"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6690: SELECT g.id AS gauge_id, aheinecke@6717: g.name AS gauge_name, aheinecke@6717: t.start_time AS start_time, aheinecke@6717: t.stop_time AS stop_time aheinecke@6690: FROM gauges g aheinecke@6717: JOIN discharge_tables dt ON g.id = dt.gauge_id aheinecke@6717: LEFT JOIN time_intervals t ON dt.time_interval_id = t.id aheinecke@6690: WHERE g.river_id = ${river_id} aheinecke@6717: AND dt.kind = 0 aheinecke@6849: AND ((g.station = ${fromkm} AND g.station = ${tokm}) aheinecke@6849: OR g.official_number = ${refgauge}) aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6851: <dc:for-each> aheinecke@6851: <current_gauge factory="gaugedischarge" target_out="{$out}" aheinecke@6851: ids="{$gauge_name}"/> aheinecke@6851: </dc:for-each> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="qsectors"> aheinecke@6124: <qsector factory="qsectors" ids="{$river_id}" target_out="{$out}" /> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-recommended"> aheinecke@6053: <kilometrage> aheinecke@6124: <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}" /> aheinecke@6053: </kilometrage> aheinecke@6053: <rastermap> aheinecke@6124: <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" /> aheinecke@6053: </rastermap> aheinecke@6053: </dc:macro> aheinecke@6053: rrenkert@7961: <dc:macro name="minfo-heights-diff"> rrenkert@7961: <dc:call-macro name="minfo-heights-years"> rrenkert@7961: <dc:context> rrenkert@7961: <dc:statement> rrenkert@7961: WITH sta rrenkert@7961: AS (SELECT bhs.id, rrenkert@7961: bhs.description, rrenkert@7961: bhsv.station, rrenkert@7961: bhs.year rrenkert@7961: FROM bed_height_single bhs rrenkert@7961: JOIN bed_height_single_values bhsv rrenkert@7961: ON bhsv.bed_height_single_id = bhs.id rrenkert@7970: WHERE bhs.river_id = ${river_id}), rrenkert@7961: csta rrenkert@7970: AS (SELECT b1.id AS b1id, rrenkert@7961: b1.description AS b1desc, rrenkert@7961: b1.year AS b1year, rrenkert@7970: b2.id AS b2id, rrenkert@7970: b2.description AS b2desc, rrenkert@7961: b2.year AS b2year rrenkert@7961: FROM sta b1 rrenkert@7961: JOIN sta b2 rrenkert@7961: ON b1.station = b2.station rrenkert@7975: AND b1.id <> b2.id) rrenkert@7970: SELECT DISTINCT b1id, b1desc, b1year, rrenkert@7970: b2id, b2desc, b2year rrenkert@7961: FROM csta rrenkert@7970: ORDER BY b1desc, b2desc rrenkert@7961: </dc:statement> rrenkert@7961: <dc:if test="dc:has-result()"> rrenkert@7961: <bedheights> rrenkert@7961: <dc:call-macro name="bed-heights-single-diff"/> rrenkert@7961: <dc:call-macro name="bed-heights-epoch-diff"/> rrenkert@7961: </bedheights> rrenkert@7961: </dc:if> rrenkert@7961: </dc:context> rrenkert@7961: </dc:call-macro> rrenkert@7961: </dc:macro> rrenkert@7961: rrenkert@7961: <dc:macro name="bed-heights-single-diff"> rrenkert@7970: <dc:filter expr="not(contains(dc:lowercase($b1desc), 'epoche') or contains(dc:lowercase($b2desc), 'epoche'))"> rrenkert@7961: <years> rrenkert@7970: <dc:call-macro name="minfo-heights-diff-tree"/> rrenkert@7961: </years> rrenkert@7961: </dc:filter> rrenkert@7961: </dc:macro> rrenkert@7961: rrenkert@7961: <dc:macro name="bed-heights-epoch-diff"> rrenkert@7970: <dc:filter expr="contains(dc:lowercase($b1desc), 'epoche') and contains(dc:lowercase($b2desc), 'epoche')"> rrenkert@7961: <epochs> rrenkert@7970: <dc:call-macro name="minfo-heights-diff-tree"/> rrenkert@7961: </epochs> rrenkert@7961: </dc:filter> rrenkert@7961: </dc:macro> rrenkert@7961: rrenkert@7961: <dc:macro name="minfo-heights-diff-tree"> rrenkert@7975: <dc:group expr="dc:coalesce($b1year, 'sonstige')"> rrenkert@7970: <minfo-diff name="{dc:group-key()}"> rrenkert@7961: <dc:for-each> rrenkert@7970: <dc:choose> rrenkert@7970: <dc:when test="dc:group-key() = $b1year"> rrenkert@7970: <height factory="bedheight" rrenkert@7970: target_out="{$out}" rrenkert@7970: ids="bedheight-single-{$b1id}-{$b1year}#bedheight-single-{$b2id}-{$b2year}" rrenkert@7970: info="{$b1desc}#{$b2desc}" rrenkert@7970: description="{$b1desc} - {$b2desc}"/> rrenkert@7970: </dc:when> rrenkert@7970: <dc:when test="dc:group-key() = 'sonstige'"> rrenkert@7970: <height factory="bedheight" rrenkert@7970: target_out="{$out}" rrenkert@7970: ids="bedheight-single-{$b1id}-{$b1year}#bedheight-single-{$b2id}-{$b2year}" rrenkert@7970: info="{$b1desc}#{$b2desc}" rrenkert@7970: description="{$b1desc} - {$b2desc}"/> rrenkert@7970: <height factory="bedheight" rrenkert@7970: target_out="{$out}" rrenkert@7970: ids="bedheight-single-{$b2id}-{$b2year}#bedheight-single-{$b1id}-{$b1year}" rrenkert@7973: info="{$b2desc}#{$b1desc}" rrenkert@7970: description="{$b2desc} - {$b1desc}"/> rrenkert@7970: </dc:when> rrenkert@7970: </dc:choose> rrenkert@7961: </dc:for-each> rrenkert@7970: </minfo-diff> rrenkert@7961: </dc:group> rrenkert@7961: </dc:macro> rrenkert@7961: aheinecke@6053: <dc:macro name="minfo-heights"> teichmann@7947: <dc:call-macro name="minfo-heights-years"> teichmann@7947: <bedheights> teichmann@7947: <dc:call-macro name="bed-heights-single"/> teichmann@7947: <dc:call-macro name="bed-heights-epoch"/> teichmann@7947: </bedheights> teichmann@7947: </dc:call-macro> teichmann@7947: </dc:macro> teichmann@7947: teichmann@7947: <dc:macro name="minfo-heights-years"> teichmann@7411: <dc:comment> aheinecke@7406: The input here is a list differenc ids noted in the aheinecke@7406: form: aheinecke@7406: [2726deb8-e71f-4acc-bc57-c7ae6062df2e;bedheight;0;FP-Mai2006vHW]# aheinecke@7406: [df79ba16-7e2a-43d6-b15b-34dca1fd9bff;bedheight;0;FP-2007_0-286]# aheinecke@7406: [027ba0ac-5453-4e63-a99b-1feeb82a4e06;bedheight;0;QP-2002nHW]# aheinecke@7406: [26b9b6eb-1ce5-4011-83c7-b88e15e99870;bedheight;0;FP-Nov2008] aheinecke@7406: aheinecke@7406: (Linebreaks inserted for readability) aheinecke@7406: aheinecke@7406: We take this string and look for all 4 digit numbers (\d{4}) after aheinecke@7406: we have removed the uuids from the input string (dc:replace all). aheinecke@7406: On this list of numbers we use the dc:min/max-number functions to aheinecke@7406: get the extreme values and interpret the result as a number. aheinecke@7406: </dc:comment> aheinecke@7427: <dc:choose> aheinecke@7427: <dc:when test="dc:contains($parameters, 'diffids')"> aheinecke@7427: <dc:variable name="year_from" expr=" aheinecke@7427: dc:min-number( aheinecke@7427: dc:find-all( aheinecke@7427: '\d{4}', aheinecke@7427: dc:replace-all( teichmann@7549: $diffids, teichmann@7549: '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))" aheinecke@7427: type="number"/> teichmann@7549: <dc:if test="$year_from = dc:min-number('x')"> teichmann@7549: <dc:variable name="year_from" expr="0" type="number"/> teichmann@7549: </dc:if> aheinecke@7427: <dc:variable name="year_to" expr=" aheinecke@7427: dc:max-number( aheinecke@7427: dc:find-all( aheinecke@7427: '\d{4}', aheinecke@7427: dc:replace-all( teichmann@7549: $diffids, teichmann@7549: '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))" aheinecke@7427: type="number"/> teichmann@7549: <dc:if test="$year_to = dc:max-number('x')"> teichmann@7549: <dc:variable name="year_to" expr="9999" type="number"/> teichmann@7549: </dc:if> aheinecke@7427: </dc:when> aheinecke@7427: <dc:otherwise> aheinecke@7427: <dc:comment>Just show everything</dc:comment> aheinecke@7427: <dc:variable name="year_to" expr="9999" type="number"/> aheinecke@7427: <dc:variable name="year_from" expr="0" type="number"/> aheinecke@7427: </dc:otherwise> aheinecke@7427: </dc:choose> teichmann@7947: <dc:macro-body/> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="bed-heights-single"> aheinecke@6053: <single> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> felix@7327: SELECT bhs.id AS bedh_id, felix@7327: bhs.year AS bedh_year, felix@7327: bhs.description AS bedh_descr, felix@7330: bht.name AS type_name felix@7327: FROM bed_height_single bhs felix@7327: JOIN bed_height_type bht ON bht.id = bhs.type_id felix@7327: WHERE bhs.river_id = ${river_id} aheinecke@7405: AND lower(bhs.description) NOT LIKE '%epoch%' aheinecke@7405: AND bhs.year BETWEEN ${year_from} AND ${year_to} aheinecke@6053: </dc:statement> felix@7327: <dc:if test="dc:has-result()"> felix@7327: <dc:group expr="$bedh_year"> felix@7327: <cross-sections name="{dc:group-key()}"> felix@7327: <dc:for-each> felix@7330: <height factory="bedheight" felix@7330: target_out="{$out}" felix@7330: ids="bedheight-single-{$bedh_id}-{$bedh_year}" felix@7330: info="{$type_name}" felix@7330: description="{$bedh_descr}"/> felix@7327: </dc:for-each> felix@7327: </cross-sections> felix@7327: </dc:group> felix@7330: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </single> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="bed-heights-epoch"> aheinecke@6053: <epoch> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> rrenkert@6214: SELECT id AS bedh_id, rrenkert@6214: year AS bedh_year, rrenkert@6214: description AS bedh_descr rrenkert@6214: FROM bed_height_single rrenkert@6214: WHERE river_id = ${river_id} rrenkert@6214: AND lower(description) LIKE '%epoch%' aheinecke@7405: AND year BETWEEN ${year_from} AND ${year_to} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <height factory="bedheight" target_out="{$out}" rrenkert@6214: ids="bedheight-single-{$bedh_id}-{$bedh_year}" aheinecke@6053: description="{$bedh_descr}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </epoch> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7292: <dc:macro name="flow_velocity_models"> felix@7292: <dc:context> felix@7292: <dc:statement> felix@7421: SELECT fvm.id AS fvmid, felix@7421: fvm.description AS fvmd, felix@7402: dz.upper_discharge AS upperQ, felix@7402: dz.lower_discharge AS lowerQ felix@7292: FROM flow_velocity_model fvm felix@7292: JOIN discharge_zone dz ON dz.id = fvm.discharge_zone_id felix@7292: WHERE dz.river_id = ${river_id} felix@7409: ORDER BY dz.value felix@7292: </dc:statement> felix@7292: <dc:if test="dc:has-result()"> felix@7292: <flowvelocitymodel> felix@7292: <dc:for-each> felix@7402: <measurement_value name="{$fvmd}" felix@7402: ids="{$fvmid}" felix@7402: factory="flowvelocitymodel" felix@7402: info="{$lowerQ} - {$upperQ}" felix@7402: target_out="{$out}" /> felix@7292: </dc:for-each> felix@7292: </flowvelocitymodel> felix@7292: </dc:if> felix@7292: </dc:context> felix@7292: </dc:macro> felix@7292: felix@7292: aheinecke@6053: <dc:macro name="flow_velocity_measurements"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT id AS fvmid, aheinecke@6053: description AS fvmd aheinecke@6053: FROM flow_velocity_measurements WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <flowvelocitymeasurement> aheinecke@6053: <dc:for-each> felix@7455: <flow_velocity_measurement name="{$fvmd}"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT id, description, station, datetime, v, w, q aheinecke@6053: FROM flow_velocity_measure_values aheinecke@6053: WHERE measurements_id = ${fvmid} aheinecke@6053: AND station BETWEEN ${fromkm} AND ${tokm} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <measurement_value name="{$description} - {$station} - {$datetime}" aheinecke@6053: ids="{$id}" aheinecke@6124: factory="flowvelocity" target_out="{$out}" /> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </flow_velocity_measurement> aheinecke@6053: </dc:for-each> aheinecke@6053: </flowvelocitymeasurement> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="morph_width"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT id AS width_id aheinecke@6053: FROM morphologic_width aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <morph_width> aheinecke@6053: <dc:for-each> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT min(station) AS from_station, aheinecke@6053: max(station) AS to_station aheinecke@6053: FROM morphologic_width_values aheinecke@6053: WHERE morphologic_width_id = ${width_id} aheinecke@5976: </dc:statement> aheinecke@5976: <dc:for-each> aheinecke@6053: <morphologic-width name="{$from_station} - {$to_station}" aheinecke@6053: ids="{$width_id}" aheinecke@6124: factory="morph-width" target_out="{$out}" /> teichmann@5523: </dc:for-each> teichmann@5523: </dc:context> aheinecke@6053: </dc:for-each> aheinecke@6053: </morph_width> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@5405: aheinecke@6053: <dc:macro name="sounding-width"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT id AS bedh_id, aheinecke@6053: year AS bedh_year, aheinecke@6053: description AS bedh_descr aheinecke@6053: FROM bed_height_single WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <soundings_width> aheinecke@6053: <dc:for-each> felix@7478: <height factory="bedheight" felix@7478: target_out="{$out}" felix@7478: ids="bedheight-soundings-{$bedh_id}-{$bedh_year}" aheinecke@6053: description="{$bedh_descr}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </soundings_width> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@7236: <dc:macro name="sqrelations"> aheinecke@7236: <dc:context> aheinecke@7236: <dc:statement> aheinecke@7236: SELECT sq.description AS description, aheinecke@7236: ti.start_time AS start_time, aheinecke@7236: ti.stop_time AS stop_time, aheinecke@7236: ms.name AS station_name, aheinecke@7236: lower(sqv.parameter) AS parameter, aheinecke@7672: sqv.id AS sqvid, aheinecke@7672: ra.a AS station_km aheinecke@7236: FROM sq_relation sq aheinecke@7236: JOIN time_intervals ti ON ti.id = sq.time_interval_id aheinecke@7236: JOIN rivers r ON r.id = sq.river_id aheinecke@7236: JOIN sq_relation_value sqv ON sqv.sq_relation_id = sq.id aheinecke@7236: JOIN measurement_station ms ON sqv.measurement_station_id = ms.id aheinecke@7672: JOIN ranges ra ON ms.range_id = ra.id aheinecke@7236: WHERE r.id = ${river_id} aheinecke@7672: ORDER BY station_km, start_time, stop_time aheinecke@7236: </dc:statement> aheinecke@7236: <dc:if test="dc:has-result()"> aheinecke@7236: <sq_relations> aheinecke@7236: <dc:filter expr="$out = concat('sq_relation_', $parameter)"> aheinecke@7672: <dc:group expr="$station_km" type="number"> aheinecke@7672: <dc:group expr="concat('km ', $station_km, ': ', $station_name)"> aheinecke@7672: <station description="{dc:group-key()}"> aheinecke@7672: <dc:for-each> aheinecke@7672: <dc:variable name="combined_desc" expr="concat(dc:date-format('yyyy', $start_time), ' bis ', dc:date-format('yyyy', $stop_time))"/> aheinecke@7672: <sqvalue factory="staticsqrelation" target_out="{$out}" aheinecke@7672: ids="{$sqvid};{$station_name}: {$combined_desc}" description="{$combined_desc}"/> aheinecke@7672: </dc:for-each> aheinecke@7672: </station> aheinecke@7672: </dc:group> aheinecke@7236: </dc:group> aheinecke@7236: </dc:filter> aheinecke@7236: </sq_relations> aheinecke@7236: </dc:if> aheinecke@7236: </dc:context> aheinecke@7236: </dc:macro> aheinecke@7236: aheinecke@6053: <dc:macro name="basedata_0_macro"> felix@6073: <dc:filter expr="$kind = 0"> felix@6073: <dc:if test="dc:has-result()"> felix@6073: <basedata> felix@6073: <dc:group expr="$wst_description"> felix@6073: <basedata name="{dc:group-key()}"> felix@6073: <dc:for-each> felix@6073: <dc:macro-body/> felix@6073: </dc:for-each> felix@6073: </basedata> felix@6073: </dc:group> felix@6073: </basedata> felix@6073: </dc:if> felix@6073: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_0"> aheinecke@6053: <dc:call-macro name="basedata_0_macro"> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="base_data-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwqkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_0_wq"> aheinecke@6053: <dc:call-macro name="basedata_0_macro"> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="base_data-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="wqinterpol" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_1_additionals_macro"> felix@6073: <dc:filter expr="$kind=1"> felix@6073: <dc:if test="dc:has-result()"> felix@6073: <additionals> felix@6073: <dc:group expr="dc:replace($wst_description, 'Zus.Längsschnitte/', '')"> felix@6073: <additional name="{dc:group-key()}"> aheinecke@6081: <dc:for-each> aheinecke@6081: <dc:macro-body/> aheinecke@6081: </dc:for-each> felix@6073: </additional> felix@6073: </dc:group> felix@6073: </additionals> felix@6073: </dc:if> felix@6073: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_1_additionals"> aheinecke@6053: <dc:call-macro name="basedata_1_additionals_macro"> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="additionals-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwqkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="basedata_1_additionals_marks"> aheinecke@6053: <dc:call-macro name="basedata_1_additionals_macro"> aheinecke@6053: <column name="{$wst_column_name}" aheinecke@6053: ids="additionalsmarks-wstv-{$wst_column_position}-{$wst_id}" aheinecke@6124: factory="staticwkms" target_out="{$out}" aheinecke@6053: info="{$info} [km {$deffrom} - {$defto}]"/> aheinecke@6053: </dc:call-macro> aheinecke@6053: </dc:macro> aheinecke@6053: felix@7276: <dc:macro name="basedata_1_additionals_wq"> felix@7276: <dc:call-macro name="basedata_1_additionals_macro"> felix@7276: <column name="{$wst_column_name}" felix@7276: ids="base_data-wstv-{$wst_column_position}-{$wst_id}" felix@7276: factory="wqinterpol" target_out="{$out}" felix@7276: info="{$info} [km {$deffrom} - {$defto}]"/> felix@7276: </dc:call-macro> felix@7276: </dc:macro> felix@7276: aheinecke@6053: <!-- Floodmap part --> aheinecke@6053: <dc:macro name="flood-map-complete"> aheinecke@6053: <dc:call-macro name="flood-map-buildings"/> aheinecke@6053: <dc:call-macro name="catchments"/> aheinecke@6053: <dc:call-macro name="floodmarks"/> aheinecke@6053: <hws> aheinecke@6053: <dc:call-macro name="hwslines"/> aheinecke@6053: <dc:call-macro name="hwspoints"/> aheinecke@6053: </hws> aheinecke@6053: <dc:call-macro name="flood-map-routing"/> aheinecke@6053: <hydrboundaries> aheinecke@6053: <dc:call-macro name="flood-map-floodplain"/> aheinecke@6053: <dc:call-macro name="flood-map-hydr-boundaries"/> aheinecke@6053: </hydrboundaries> aheinecke@6053: <dc:call-macro name="flood-map-uesk"/> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-routing"> aheinecke@6053: <route_data> aheinecke@6053: <dc:call-macro name="flood-map-qps"/> aheinecke@6053: <dc:call-macro name="flood-map-fixpoints"/> aheinecke@6053: <dc:call-macro name="flood-map-km"/> aheinecke@6053: <dc:call-macro name="flood-map-riveraxis"/> aheinecke@6053: </route_data> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-hydr-boundaries"> aheinecke@6053: <bfg_model> aheinecke@6053: <dc:call-macro name="flood-map-hydr-boundaries-poly"/> aheinecke@6053: <dc:call-macro name="flood-map-hydr-boundaries-lines"/> aheinecke@6053: </bfg_model> aheinecke@6053: <dc:call-macro name="flood-map-hydr-boundaries-state"/> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-dem"> aheinecke@6053: <dems> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT d.id AS dem_id, aheinecke@6053: r.a AS dem_lower, aheinecke@6053: r.b AS dem_upper, aheinecke@6053: d.name AS name, aheinecke@6053: t.start_time AS start_time, aheinecke@6053: t.stop_time AS stop_time, aheinecke@6183: 'Projektion: ' || d.projection || '<BR>' || aheinecke@6183: 'Rasterweite: ' || d.resolution || 'm<BR>' || aheinecke@6183: 'Format: ' || d.format || '<BR>' || aheinecke@6053: 'Zeitraum: ' aheinecke@6053: AS info aheinecke@6053: FROM dem d aheinecke@6053: JOIN ranges r ON d.range_id = r.id aheinecke@6053: LEFT JOIN time_intervals t ON d.time_interval_id = t.id aheinecke@6183: WHERE d.river_id = ${river_id} aheinecke@6183: AND NOT((${tokm} < r.a) or (${fromkm} > r.b)) aheinecke@6183: </dc:statement> aheinecke@6183: <dc:for-each> aheinecke@6124: <dem factory="demfactory" target_out="{$out}" aheinecke@6053: ids="{$dem_id}" aheinecke@6053: name="{$name}" aheinecke@6183: info="{$info}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </dems> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="filter_hws_ddg"> aheinecke@6053: <dc:macro name="durchlass_damm_graben"> aheinecke@6053: <dc:macro name="ddg_factory"> aheinecke@6053: <dc:for-each> aheinecke@6124: <hws factory="hwsfactory" name="{$hws_name}" target_out="{$out}" /> aheinecke@6053: </dc:for-each> aheinecke@5976: </dc:macro> aheinecke@5976: aheinecke@6053: <dc:filter expr="$hws_kind=1"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Durchlass><dc:call-macro name="ddg_factory"/></Durchlass> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@5976: aheinecke@6053: <dc:filter expr="$hws_kind=2"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Damm><dc:call-macro name="ddg_factory"/></Damm> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> teichmann@5523: aheinecke@6053: <dc:filter expr="$hws_kind=3"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Graben><dc:call-macro name="ddg_factory"/></Graben> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> teichmann@5523: aheinecke@6053: <dc:filter expr="$hws_official=1"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <official> aheinecke@6053: <dc:call-macro name="durchlass_damm_graben"/> aheinecke@6053: </official> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> teichmann@5524: aheinecke@6053: <dc:filter expr="$hws_official=0"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <inofficial> aheinecke@6053: <dc:call-macro name="durchlass_damm_graben"/> aheinecke@6053: </inofficial> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> teichmann@5524: aheinecke@6054: <dc:macro name="flood-map-hws-lines"> aheinecke@6054: <dc:context> aheinecke@6054: <dc:statement> aheinecke@6054: SELECT DISTINCT aheinecke@6054: name AS hws_name, aheinecke@6054: official AS hws_official, aheinecke@6054: kind_id AS hws_kind aheinecke@6054: FROM hws_lines aheinecke@6054: WHERE river_id = ${river_id} aheinecke@6054: </dc:statement> aheinecke@6054: <dc:if test="dc:has-result()"> aheinecke@6054: <lines> aheinecke@6054: <dc:call-macro name="filter_hws_ddg"/> aheinecke@6054: </lines> aheinecke@6054: </dc:if> aheinecke@6054: </dc:context> aheinecke@6054: </dc:macro> aheinecke@6054: aheinecke@6054: <dc:macro name="flood-map-hws-points"> aheinecke@6054: <dc:context> aheinecke@6054: <dc:statement> aheinecke@6054: SELECT DISTINCT aheinecke@6054: name AS hws_name, aheinecke@6054: official AS hws_official, aheinecke@6054: kind_id AS hws_kind aheinecke@6054: FROM hws_points aheinecke@6054: WHERE river_id = ${river_id} aheinecke@6054: </dc:statement> aheinecke@6054: <dc:if test="dc:has-result()"> aheinecke@6054: <points> aheinecke@6054: <dc:call-macro name="filter_hws_ddg"/> aheinecke@6054: </points> aheinecke@6054: </dc:if> aheinecke@6054: </dc:context> aheinecke@6054: </dc:macro> aheinecke@6054: aheinecke@6053: <dc:macro name="flood-map-hydr-boundaries-state"> aheinecke@6053: <federal> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name aheinecke@6053: FROM hydr_boundaries aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND kind = 2 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <line factory="wmshydrboundariesfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name};2" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name aheinecke@6053: FROM hydr_boundaries_poly aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND kind = 2 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <line factory="wmshydrboundariespolyfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name};2" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </federal> aheinecke@6053: </dc:macro> teichmann@5524: aheinecke@6053: <dc:macro name="flood-map-hydr-boundaries-lines"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name aheinecke@6053: FROM hydr_boundaries aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND kind = 1 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:comment> What about all other line kinds?</dc:comment> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <lines> aheinecke@6053: <dc:for-each> aheinecke@6124: <line factory="wmshydrboundariesfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name};1" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </lines> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> teichmann@5524: aheinecke@6053: <dc:macro name="flood-map-hydr-boundaries-poly"> aheinecke@6053: <areas> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: b.sectie AS sectie_id, aheinecke@6053: sk.name AS sectie aheinecke@6053: FROM hydr_boundaries_poly b aheinecke@6053: JOIN sectie_kinds sk ON b.sectie = sk.id aheinecke@6053: WHERE b.river_id = ${river_id} aheinecke@6053: AND b.kind = 1 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <sobek_areas> aheinecke@6053: <dc:for-each> aheinecke@6053: <boundary name="{$sectie}" aheinecke@6124: factory="wmshydrboundariespolyfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$sectie};1;{$sectie_id};-1"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </sobek_areas> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: b.sobek AS sobek_id, aheinecke@6053: sk.name AS sobek aheinecke@6053: FROM hydr_boundaries_poly b aheinecke@6053: JOIN sobek_kinds sk ON b.sobek = sk.id aheinecke@6053: WHERE b.river_id = ${river_id} aheinecke@6053: AND b.kind = 1 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <sobek_flooded> aheinecke@6053: <dc:for-each> aheinecke@6053: <boundary name="{$sobek}" aheinecke@6124: factory="wmshydrboundariespolyfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </sobek_flooded> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: b.name AS name aheinecke@6053: FROM hydr_boundaries_poly b aheinecke@6053: WHERE b.river_id = ${river_id} aheinecke@6053: AND b.kind = 1 aheinecke@6053: AND b.sobek IS NULL aheinecke@6053: AND b.sectie is NULL aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <boundary name="{$name}" aheinecke@6124: factory="wmshydrboundariespolyfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </areas> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-uesk"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT 1 FROM floodmaps WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <uesk> aheinecke@6053: <calculations> teichmann@5523: <dc:context> teichmann@5523: <dc:statement> aheinecke@6053: SELECT DISTINCT 1 FROM floodmaps WHERE river_id = ${river_id} aheinecke@6053: AND (kind = 112 OR kind = 111) teichmann@5523: </dc:statement> teichmann@5523: <dc:if test="dc:has-result()"> aheinecke@6053: <current> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT name AS name aheinecke@6053: FROM floodmaps aheinecke@6053: WHERE river_id = ${river_id} AND kind = 111 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <bfg> aheinecke@6053: <dc:for-each> aheinecke@6124: <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </bfg> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT name AS name aheinecke@6053: FROM floodmaps aheinecke@6053: WHERE river_id = ${river_id} AND kind = 112 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <federal> aheinecke@6053: <dc:for-each> aheinecke@6124: <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </federal> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </current> teichmann@5523: </dc:if> teichmann@5523: </dc:context> aheinecke@5760: <dc:context> aheinecke@5760: <dc:statement> aheinecke@6053: SELECT DISTINCT 1 from floodmaps where river_id = ${river_id} aheinecke@6053: AND (kind = 122 OR kind = 121) aheinecke@5435: </dc:statement> aheinecke@5796: <dc:if test="dc:has-result()"> aheinecke@6053: <potential> aheinecke@5534: <dc:context> aheinecke@5534: <dc:statement> aheinecke@6053: SELECT DISTINCT name AS name aheinecke@6053: FROM floodmaps aheinecke@6053: WHERE river_id = ${river_id} AND kind = 121 aheinecke@5534: </dc:statement> aheinecke@5534: <dc:if test="dc:has-result()"> aheinecke@6053: <bfg> aheinecke@6053: <dc:for-each> aheinecke@6124: <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </bfg> aheinecke@5534: </dc:if> aheinecke@5534: </dc:context> aheinecke@5534: <dc:context> aheinecke@5534: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name AS name aheinecke@6053: FROM floodmaps aheinecke@6053: WHERE river_id = ${river_id} AND kind = 122 aheinecke@5534: </dc:statement> aheinecke@5534: <dc:if test="dc:has-result()"> aheinecke@6053: <federal> aheinecke@6053: <dc:for-each> aheinecke@6124: <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </federal> aheinecke@5534: </dc:if> aheinecke@5534: </dc:context> aheinecke@6053: </potential> aheinecke@5547: </dc:if> aheinecke@5547: </dc:context> aheinecke@6053: </calculations> aheinecke@6053: <dc:context> teichmann@5523: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: source AS source aheinecke@6053: FROM floodmaps aheinecke@6053: WHERE river_id = ${river_id} AND kind = 200 teichmann@5523: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <measurements> teichmann@5523: <dc:for-each> aheinecke@6053: <year name="{$source}"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name AS name aheinecke@6053: FROM floodmaps aheinecke@6053: WHERE river_id = ${river_id} AND kind = 200 AND source = aheinecke@6053: ${source} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}" aheinecke@6053: name="{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </year> teichmann@5523: </dc:for-each> aheinecke@6053: </measurements> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </uesk> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> teichmann@5523: aheinecke@6053: <dc:macro name="flood-map-floodplain"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: fp.kind_id AS kind_id, aheinecke@6053: flk.name AS kind_name aheinecke@6053: FROM floodplain fp aheinecke@6053: JOIN floodplain_kinds flk on fp.kind_id = flk.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <floodplain> aheinecke@6053: <dc:filter expr="$kind_id=1"> aheinecke@6053: <dc:for-each> aheinecke@6124: <floody factory="wmsfloodplainfactory" target_out="{$out}" aheinecke@6053: description="{$kind_name}" aheinecke@6053: ids="{$river_id};{$kind_name};{$kind_id}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:filter> teichmann@6098: <dc:filter expr="$kind_id != 1"> teichmann@6098: <dc:if test="dc:has-result()"> teichmann@6098: <other> teichmann@6098: <dc:for-each> aheinecke@6124: <floody factory="wmsfloodplainfactory" target_out="{$out}" teichmann@6098: description="{$layer_name}" teichmann@6098: ids="{$river_id};{$layer_name};{$kind_id}"/> teichmann@6098: </dc:for-each> teichmann@6098: </other> teichmann@6098: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </floodplain> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> rrenkert@5015: aheinecke@6053: <dc:macro name="hwspoints_by_kind"> aheinecke@6053: <dc:comment> aheinecke@6053: Call from a context where fed_name hws_kind hws_name and river_id is aheinecke@6053: availble aheinecke@6053: </dc:comment> rrenkert@5015: aheinecke@6053: <dc:macro name="hwspoints_by_kind_factory"> aheinecke@6053: <dc:for-each> aheinecke@6124: <hws factory="wmshwspointsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$hws_name}" aheinecke@6053: name="{$hws_name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:macro> teichmann@5523: aheinecke@6053: <dc:filter expr="$hws_kind=1"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Durchlass> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind_factory"/> aheinecke@6053: </Durchlass> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> teichmann@5523: aheinecke@6053: <dc:filter expr="$hws_kind=2"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Damm> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind_factory"/> aheinecke@6053: </Damm> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> ingo@2096: aheinecke@6053: <dc:filter expr="$hws_kind=3"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Graben> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind_factory"/> aheinecke@6053: </Graben> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> teichmann@5523: aheinecke@6053: <dc:macro name="hwspoints"> aheinecke@6053: <hws_points> aheinecke@6053: <official> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: fs.name AS fed_name, aheinecke@6053: fs.id AS fed_id aheinecke@6053: FROM hws_points hws aheinecke@6053: JOIN fed_states fs ON hws.fed_state_id = fs.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND hws.official=1 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> teichmann@5523: <dc:context> teichmann@5523: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_points aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=1 aheinecke@6053: AND fed_state_id = ${fed_id} ORDER BY name teichmann@5523: </dc:statement> aheinecke@6053: <fedstate description="{$fed_name}"> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind"/> aheinecke@6053: </fedstate> teichmann@5523: </dc:context> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT distinct aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_points aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=1 aheinecke@6053: AND fed_state_id IS NULL aheinecke@6053: ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <hws_fed_unknown> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind"/> aheinecke@6053: </hws_fed_unknown> aheinecke@6053: </dc:context> aheinecke@6053: </official> aheinecke@6053: <inofficial> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: fs.name AS fed_name, aheinecke@6053: fs.id AS fed_id aheinecke@6053: FROM hws_points hws aheinecke@6053: JOIN fed_states fs ON hws.fed_state_id = fs.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND hws.official=0 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_points aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=0 aheinecke@6053: AND fed_state_id = ${fed_id} ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <fedstate description="{$fed_name}"> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind"/> aheinecke@6053: </fedstate> aheinecke@6053: </dc:context> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT distinct aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_points aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=0 aheinecke@6053: AND fed_state_id IS NULL ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <hws_fed_unknown> aheinecke@6053: <dc:call-macro name="hwspoints_by_kind"/> aheinecke@6053: </hws_fed_unknown> aheinecke@6053: </dc:context> aheinecke@6053: </inofficial> aheinecke@6053: </hws_points> aheinecke@6053: </dc:macro> teichmann@5523: aheinecke@6053: <dc:macro name="hwslines_by_kind"> aheinecke@6053: <dc:comment> aheinecke@6053: Call from a context where fed_name hws_kind hws_name and river_id is aheinecke@6053: availble aheinecke@6053: </dc:comment> rrenkert@5549: aheinecke@6053: <dc:macro name="hwslines_by_kind_factory"> aheinecke@6053: <dc:for-each> aheinecke@6124: <hws factory="wmshwslinesfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$hws_name}" aheinecke@6053: name="{$hws_name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:macro> rrenkert@5549: aheinecke@6053: <dc:filter expr="$hws_kind=1"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Durchlass> aheinecke@6053: <dc:call-macro name="hwslines_by_kind_factory"/> aheinecke@6053: </Durchlass> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: aheinecke@6053: <dc:filter expr="$hws_kind=2"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Damm> aheinecke@6053: <dc:call-macro name="hwslines_by_kind_factory"/> aheinecke@6053: </Damm> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: aheinecke@6053: <dc:filter expr="$hws_kind=3"> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <Graben> aheinecke@6053: <dc:call-macro name="hwslines_by_kind_factory"/> aheinecke@6053: </Graben> aheinecke@6053: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="hwslines"> aheinecke@6053: <hws_lines> aheinecke@6053: <official> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: fs.name AS fed_name, aheinecke@6053: fs.id AS fed_id aheinecke@6053: FROM hws_lines hws aheinecke@6053: JOIN fed_states fs ON hws.fed_state_id = fs.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND hws.official=1 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_lines aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=1 aheinecke@6053: AND fed_state_id = ${fed_id} ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <fedstate description="{$fed_name}"> aheinecke@6053: <dc:call-macro name="hwslines_by_kind"/> aheinecke@6053: </fedstate> aheinecke@6053: </dc:context> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT distinct aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_lines aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=1 aheinecke@6053: AND fed_state_id IS NULL aheinecke@6053: ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <hws_fed_unknown> aheinecke@6053: <dc:call-macro name="hwslines_by_kind"/> aheinecke@6053: </hws_fed_unknown> aheinecke@6053: </dc:context> aheinecke@6053: </official> aheinecke@6053: <inofficial> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: fs.name AS fed_name, aheinecke@6053: fs.id AS fed_id aheinecke@6053: FROM hws_lines hws aheinecke@6053: JOIN fed_states fs ON hws.fed_state_id = fs.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND hws.official=0 aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_lines aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=0 aheinecke@6053: AND fed_state_id = ${fed_id} ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <fedstate description="{$fed_name}"> aheinecke@6053: <dc:call-macro name="hwslines_by_kind"/> aheinecke@6053: </fedstate> aheinecke@6053: </dc:context> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT distinct aheinecke@6053: name AS hws_name, aheinecke@6053: kind_id AS hws_kind aheinecke@6053: FROM hws_lines aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: AND official=0 aheinecke@6053: AND fed_state_id IS NULL ORDER BY name aheinecke@6053: </dc:statement> aheinecke@6053: <hws_fed_unknown> aheinecke@6053: <dc:call-macro name="hwslines_by_kind"/> aheinecke@6053: </hws_fed_unknown> aheinecke@6053: </dc:context> aheinecke@6053: </inofficial> aheinecke@6053: </hws_lines> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="floodmarks"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: COALESCE(CAST (year AS VARCHAR(64)), 'Unbekanntes Jahr') AS year aheinecke@6053: FROM flood_marks aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <floodmarks> aheinecke@6053: <dc:for-each> aheinecke@6053: <floodmark name="{$year}" aheinecke@6124: factory="wmsfloodmarkfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$year};{$year}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </floodmarks> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-gaugelocations"> aheinecke@6053: <gaugelocations> aheinecke@6124: <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)" target_out="{$out}" /> aheinecke@6124: <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)" target_out="{$out}" /> aheinecke@6124: <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)" target_out="{$out}" /> aheinecke@6124: <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)" target_out="{$out}" /> aheinecke@6053: </gaugelocations> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-riveraxis"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: ak.name AS kind_name, aheinecke@6053: ax.kind_id AS kind_id, aheinecke@6053: ax.name AS layer_name aheinecke@6053: FROM river_axes ax aheinecke@6053: JOIN axis_kinds ak on ax.kind_id = ak.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <axis> aheinecke@6053: <dc:filter expr="$kind_id=1"> aheinecke@6053: <dc:for-each> aheinecke@6053: <actual description="{$kind_name}" aheinecke@6053: ids="{$river_id};{$kind_name};{$kind_id}" aheinecke@6124: factory="riveraxis" target_out="{$out}" /> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:filter> aheinecke@6053: <dc:filter expr="$kind_id!=1"> aheinecke@6053: <other> rrenkert@5591: <dc:for-each> aheinecke@6053: <misc-axis description="{$layer_name}" aheinecke@6053: ids="{$river_id};{$layer_name};{$kind_id}" aheinecke@6124: factory="riveraxis" target_out="{$out}" /> rrenkert@5591: </dc:for-each> aheinecke@6053: </other> aheinecke@6053: </dc:filter> aheinecke@6053: </axis> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> rrenkert@5631: aheinecke@6053: <dc:macro name="flood-map-km"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <kilometrage factory="wmskmfactory" ids="{$river_id}" target_out="{$out}" /> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> rrenkert@5631: aheinecke@6053: <dc:macro name="flood-map-fixpoints"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT name AS name aheinecke@6053: FROM fixpoints aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: GROUP BY name aheinecke@6053: </dc:statement> aheinecke@6053: <dc:for-each> aheinecke@6124: <fixpoints factory="wmsfixpointsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6053: <dc:macro name="flood-map-qps"> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: cs.kind_id AS kind_id, aheinecke@6053: cs.name AS layer_name, aheinecke@6053: ck.name AS kind_name aheinecke@6053: FROM cross_section_tracks cs aheinecke@6053: JOIN cross_section_track_kinds ck ON cs.kind_id = ck.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <qps> aheinecke@6053: <dc:filter expr="$kind_id=1"> aheinecke@6053: <dc:for-each> aheinecke@6053: <actual description="{$kind_name}" aheinecke@6124: factory="wmsqpsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$kind_name};{$kind_id}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:filter> teichmann@6098: <dc:filter expr="$kind_id = 0"> teichmann@6098: <dc:if test="dc:has-result()"> teichmann@6098: <other> teichmann@6098: <dc:for-each> teichmann@6098: <misc-qps description="{$layer_name}" aheinecke@6124: factory="wmsqpsfactory" target_out="{$out}" teichmann@6098: ids="{$river_id};{$layer_name};{$kind_id}"/> teichmann@6098: </dc:for-each> teichmann@6098: </other> teichmann@6098: </dc:if> aheinecke@6053: </dc:filter> aheinecke@6053: </qps> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> rrenkert@5549: aheinecke@6053: <dc:macro name="flood-map-buildings"> aheinecke@6053: <buildings> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: b.name AS building_name, aheinecke@6053: bk.name AS building_kind, aheinecke@6053: b.kind_id AS building_kind_id aheinecke@6053: FROM buildings b aheinecke@6053: JOIN building_kinds bk ON b.kind_id = bk.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <dc:filter expr="$building_kind_id!=0"> aheinecke@6053: <dc:for-each> aheinecke@6053: <buildings description="{$building_kind}" aheinecke@6124: factory="wmsbuildingsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$building_kind};{$building_kind_id}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </dc:filter> aheinecke@6053: <dc:filter expr="$building_kind_id=0"> aheinecke@6053: <other> aheinecke@6053: <dc:for-each> aheinecke@6053: <buildings description="{$building_name}" aheinecke@6124: factory="wmsbuildingsfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$building_name}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </other> aheinecke@6053: </dc:filter> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: <dc:context> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT DISTINCT aheinecke@6053: j.kind_id AS jetty_kind_id, aheinecke@6053: jk.name AS jetty_kind aheinecke@6053: FROM jetties j aheinecke@6053: JOIN jetty_kinds jk ON j.kind_id = jk.id aheinecke@6053: WHERE river_id = ${river_id} aheinecke@6053: </dc:statement> aheinecke@6053: <dc:if test="dc:has-result()"> aheinecke@6053: <jetties> aheinecke@6053: <dc:for-each> aheinecke@6053: <jetty description="{$jetty_kind}" aheinecke@6124: factory="wmsjettiesfactory" target_out="{$out}" aheinecke@6053: ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/> aheinecke@6053: </dc:for-each> aheinecke@6053: </jetties> aheinecke@6053: </dc:if> aheinecke@6053: </dc:context> aheinecke@6053: </buildings> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6054: <dc:macro name="officiallines_user"> teichmann@6401: <dc:if test="dc:contains($parameters, 'official-lines')"> teichmann@6401: <dc:container-context container="official-lines"> teichmann@6401: <dc:properties> teichmann@6401: <dc:property name="name" alias="olname"/> rrenkert@6456: <dc:property name="wstId" alias="wstid"/> teichmann@6401: <dc:property name="columnPos" alias="wstcolpos"/> teichmann@6401: </dc:properties> teichmann@6401: <dc:if test="dc:has-result()"> teichmann@6401: <officiallines> teichmann@6401: <dc:for-each> rrenkert@6456: <column name="{$olname}" aheinecke@6598: ids="official-wstv-{$wstcolpos}-{$wstid}" aheinecke@6598: factory="staticwqkms" target_out="{$out}"/> teichmann@6401: </dc:for-each> teichmann@6401: </officiallines> teichmann@6401: </dc:if> teichmann@6401: </dc:container-context> teichmann@6401: </dc:if> aheinecke@6054: </dc:macro> aheinecke@6054: aheinecke@6053: <!-- Common stuff --> aheinecke@6053: aheinecke@6053: <dc:macro name="km-filtered-wsts"> aheinecke@6053: <dc:context connection="system"> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT w.kind AS kind, aheinecke@6053: w.id AS wst_id, aheinecke@6053: wc.id AS wst_column_id, aheinecke@6053: wc.position AS wst_column_position, aheinecke@6053: wc.description AS info, aheinecke@6053: w.description AS wst_description, aheinecke@6111: COALESCE(wc.name, '') AS wst_column_name, aheinecke@6053: wr.a AS deffrom, aheinecke@6053: wr.b AS defto aheinecke@6053: FROM wst_columns wc aheinecke@6053: JOIN wsts w ON wc.wst_id = w.id aheinecke@6053: JOIN wst_ranges wr ON wc.id = wr.wst_column_id aheinecke@6053: WHERE w.river_id = ${river_id} AND aheinecke@6053: NOT((${tokm} < wr.a) or (${fromkm} > wr.b)) aheinecke@6053: </dc:statement> aheinecke@6053: <dc:macro-body/> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6095: <dc:macro name="all-user-artifacts"> felix@6072: <dc:context connection="user"> aheinecke@6655: <dc:comment>Select collections and masterartifacts. aheinecke@6655: XXX: The cast is a quick hack because the ld_* values are aheinecke@6655: now TEXT fields. To properly fix / asses the problems here aheinecke@6655: an SLT evaluation is needed. aheinecke@6655: </dc:comment> aheinecke@6053: <dc:statement> aheinecke@6053: SELECT c.name AS collection_name, aheinecke@6053: ma.id AS a_id, aheinecke@6053: ma.state AS a_state, aheinecke@6053: ma.gid AS a_gid, aheinecke@6053: ma.creation AS a_creation, aheinecke@6655: CAST(COALESCE(ma.ld_mode, '') AS VARCHAR(255)) AS ld_m, aheinecke@6655: CAST(COALESCE(ma.ld_locations, '') AS VARCHAR(255)) AS ld_l, aheinecke@6655: CAST(COALESCE(ma.ld_from, '') AS VARCHAR(255)) AS ld_f, aheinecke@6655: CAST(COALESCE(ma.ld_to, '') AS VARCHAR(255)) AS ld_t, aheinecke@6095: o.name AS out_name, aheinecke@6111: o.id AS out_id, aheinecke@6111: f.name AS facet_name, aheinecke@6111: f.num AS facet_num, aheinecke@6111: f.description AS facet_description, aheinecke@6111: f.id AS fid aheinecke@6053: FROM users u aheinecke@6053: JOIN collections c ON c.user_id = u.id aheinecke@6053: JOIN master_artifacts_range ma ON ma.collection_id = c.id aheinecke@6095: JOIN outs o ON o.artifact_id = ma.id aheinecke@6111: JOIN facets f ON f.out_id = o.id felix@6070: WHERE u.gid = CAST(${user-id} AS UUID) aheinecke@6053: AND ma.gid <> CAST(${artifact-id} AS uuid) felix@7425: AND f.name NOT LIKE '%empty.facet%' aheinecke@6053: AND EXISTS ( aheinecke@6053: SELECT id aheinecke@6053: FROM artifact_data ad aheinecke@6053: WHERE ad.artifact_id = ma.id aheinecke@6053: AND k = 'river' aheinecke@6053: AND v = ${river}) aheinecke@6053: </dc:statement> aheinecke@6095: <dc:virtual-column name="deffrom" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"> aheinecke@6095: <dc:virtual-column name="defto" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"> aheinecke@6095: <dc:macro-body/> aheinecke@6095: </dc:virtual-column> aheinecke@6095: </dc:virtual-column> aheinecke@6053: </dc:context> aheinecke@6053: </dc:macro> aheinecke@6053: aheinecke@6095: <dc:macro name="km-filtered-user-artifacts"> aheinecke@7348: <dc:comment> aheinecke@7348: Apply KM Filtering but pass aheinecke@7348: sq_ facets with no regard about their location. aheinecke@7348: </dc:comment> aheinecke@7348: <dc:filter expr="not($deffrom > $tokm or $defto < $fromkm) or aheinecke@7348: starts-with($facet_name, 'sq_')"> aheinecke@6095: <dc:macro-body/> aheinecke@6095: </dc:filter> aheinecke@6095: </dc:macro> aheinecke@6095: aheinecke@6183: <dc:macro name="artifact-range"> aheinecke@6183: <dc:variable name="fromkm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/> aheinecke@6183: <dc:variable name="tokm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/> aheinecke@6183: <dc:macro-body/> aheinecke@6053: </dc:macro> ingo@1657: aheinecke@6053: </datacage> sascha@1046: </dc:template>