comparison flys-artifacts/doc/conf/meta-data.xml @ 5405:5ca06120b918

Remove river_name and map elements to reduce datacage level depth
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 25 Mar 2013 15:38:54 +0100
parents 08262e0ce57a
children 70026e3b6af3
comparison
equal deleted inserted replaced
5404:08262e0ce57a 5405:5ca06120b918
707 </dc:macro> 707 </dc:macro>
708 708
709 <dc:comment> 709 <dc:comment>
710 + River-Node 710 + River-Node
711 </dc:comment> 711 </dc:comment>
712 <river> 712 <dc:attribute name="name" value="${river_name}"/>
713 <dc:attribute name="name" value="${river_name}"/> 713
714 714 <dc:choose>
715 <dc:choose> 715 <dc:when test="dc:contains($parameters, 'recommended')">
716 <dc:when test="dc:contains($parameters, 'recommended')"> 716 <dc:comment>
717 <dc:comment> 717 Recommendations (client shall load immediately).
718 Recommendations (client shall load immediately). 718 </dc:comment>
719 </dc:comment> 719 <dc:if test="dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section'))">
720 <dc:if test="dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section'))"> 720 <dc:call-macro name="annotations"/>
721 <dc:call-macro name="annotations"/> 721 </dc:if>
722 </dc:if> 722 <dc:if test="dc:contains($artifact-outs, 'historical_discharge_wq')">
723 <dc:if test="dc:contains($artifact-outs, 'historical_discharge_wq')"> 723 <dc:call-macro name="mainvalues"/>
724 <dc:call-macro name="mainvalues"/> 724 </dc:if>
725 </dc:if> 725 <dc:if test="dc:contains($artifact-outs, 'cross_section')">
726 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> 726 <dc:call-macro name="cross_sections"/>
727 <dc:call-macro name="cross_sections"/> 727 <dc:call-macro name="hyks"/>
728 <dc:call-macro name="hyks"/> 728 </dc:if>
729 </dc:if> 729 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
730 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> 730 <dc:call-macro name="mainvalues"/>
731 <dc:call-macro name="mainvalues"/> 731 </dc:if>
732 </dc:if> 732 <dc:if test="dc:contains($artifact-outs, 'duration_curve')">
733 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> 733 <dc:call-macro name="mainvalues"/>
734 <dc:call-macro name="mainvalues"/> 734 </dc:if>
735 </dc:if> 735 <dc:if test="dc:contains($artifact-outs, 'reference_curve')">
736 <dc:if test="dc:contains($artifact-outs, 'reference_curve')"> 736 <dc:call-macro name="annotations"/>
737 <dc:call-macro name="annotations"/> 737 <dc:call-macro name="mainvalues"/>
738 <dc:call-macro name="mainvalues"/> 738 </dc:if>
739 </dc:if> 739 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')">
740 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> 740 <dc:call-macro name="qsectors"/>
741 <dc:call-macro name="qsectors"/> 741 </dc:if>
742 </dc:if> 742 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')">
743 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')"> 743 <dc:call-macro name="annotations"/>
744 <dc:call-macro name="annotations"/> 744 </dc:if>
745 </dc:if> 745 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')">
746 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> 746 <dc:call-macro name="annotations"/>
747 <dc:call-macro name="annotations"/> 747 </dc:if>
748 </dc:if> 748 <dc:if test="dc:contains($artifact-outs, 'bed_difference_epoch')">
749 <dc:if test="dc:contains($artifact-outs, 'bed_difference_epoch')"> 749 <dc:call-macro name="annotations"/>
750 <dc:call-macro name="annotations"/> 750 </dc:if>
751 </dc:if> 751 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year')">
752 <dc:if test="dc:contains($artifact-outs, 'bed_difference_year')"> 752 <dc:call-macro name="annotations"/>
753 <dc:call-macro name="annotations"/> 753 </dc:if>
754 </dc:if> 754 <dc:if test="dc:contains($artifact-outs, 'bed_difference_height_year')">
755 <dc:if test="dc:contains($artifact-outs, 'bed_difference_height_year')"> 755 <dc:call-macro name="annotations"/>
756 <dc:call-macro name="annotations"/> 756 </dc:if>
757 </dc:if> 757 <dc:if test="dc:contains($artifact-outs, 'flow_velocity')">
758 <dc:if test="dc:contains($artifact-outs, 'flow_velocity')"> 758 <dc:call-macro name="annotations"/>
759 <dc:call-macro name="annotations"/> 759 </dc:if>
760 </dc:if> 760 </dc:when>
761 </dc:when> 761 <dc:otherwise>
762 <dc:otherwise> 762 <dc:comment>
763 <dc:comment> 763 Non - Recommendations.
764 Non - Recommendations. 764 </dc:comment>
765 </dc:comment> 765 <dc:if test="dc:contains($artifact-outs, 'cross_section')">
766 <dc:if test="dc:contains($artifact-outs, 'cross_section')"> 766 <dc:call-macro name="basedata_0"/>
767 <dc:call-macro name="basedata_0"/> 767 <dc:call-macro name="basedata_1_additionals"/>
768 <dc:call-macro name="basedata_1_additionals"/> 768 <dc:call-macro name="basedata_2_fixations"/>
769 <dc:call-macro name="basedata_2_fixations"/> 769 <dc:call-macro name="basedata_3_officials"/>
770 <dc:call-macro name="basedata_3_officials"/> 770 <dc:call-macro name="basedata_4_heightmarks-points"/>
771 <dc:call-macro name="basedata_4_heightmarks-points"/> 771 <dc:call-macro name="cross_sections"/>
772 <dc:call-macro name="cross_sections"/> 772 <dc:call-macro name="hyks"/>
773 <dc:call-macro name="hyks"/> 773 </dc:if>
774 </dc:if> 774 <!--dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
775 <!--dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"> 775 <dc:call-macro name="basedata_0_wq"/>
776 <dc:call-macro name="basedata_0_wq"/> 776 <dc:call-macro name="basedata_4_heightmarks-wq"/>
777 <dc:call-macro name="basedata_4_heightmarks-wq"/> 777 </dc:if-->
778 </dc:if--> 778 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')) or (dc:contains($artifact-outs, 'discharge_longitudinal_section'))">
779 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')) or (dc:contains($artifact-outs, 'discharge_longitudinal_section'))"> 779 <dc:call-macro name="longitudinal-section-prototype"/>
780 <dc:call-macro name="longitudinal-section-prototype"/> 780 </dc:if>
781 </dc:if> 781 <dc:if test="dc:contains($artifact-outs, 'duration_curve')">
782 <dc:if test="dc:contains($artifact-outs, 'duration_curve')"> 782 <dc:call-macro name="mainvalues"/>
783 <dc:call-macro name="mainvalues"/>
784 <dc:call-macro name="basedata_2_fixations_relative_point"/>
785 <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/>
786 <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
787 </dc:if>
788 <dc:if test="dc:contains($artifact-outs, 'reference_curve')">
789 <dc:call-macro name="annotations"/>
790 <!--dc:call-macro name="basedata_0"/-->
791 <dc:call-macro name="basedata_1_additionals-relative_point"/>
792 <dc:comment comment=" FIXATIONS ---------------------------"/>
793 <dc:call-macro name="basedata_2_fixations_relative_point"/> 783 <dc:call-macro name="basedata_2_fixations_relative_point"/>
794 <dc:comment comment=" HOEHENMARKEN ---------------------------"/>
795 <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/> 784 <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/>
796 <dc:call-macro name="basedata_5_flood-protections_relative_points"/> 785 <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
797 </dc:if> 786 </dc:if>
798 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')"> 787 <dc:if test="dc:contains($artifact-outs, 'reference_curve')">
799 <dc:call-macro name="basedata_0_wq"/> 788 <dc:call-macro name="annotations"/>
800 <dc:call-macro name="basedata_1_additionals_marks"/> 789 <!--dc:call-macro name="basedata_0"/-->
801 <dc:call-macro name="basedata_2_fixations_wqkms"/> 790 <dc:call-macro name="basedata_1_additionals-relative_point"/>
802 <dc:call-macro name="basedata_3_officials"/> 791 <dc:comment comment=" FIXATIONS ---------------------------"/>
803 <dc:call-macro name="basedata_4_heightmarks-points"/> 792 <dc:call-macro name="basedata_2_fixations_relative_point"/>
804 <dc:call-macro name="basedata_5_flood-protections_relative_points"/> 793 <dc:comment comment=" HOEHENMARKEN ---------------------------"/>
805 </dc:if> 794 <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/>
806 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')"> 795 <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
807 </dc:if> 796 </dc:if>
808 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')"> 797 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')">
809 <dc:call-macro name="annotations"/> 798 <dc:call-macro name="basedata_0_wq"/>
810 </dc:if> 799 <dc:call-macro name="basedata_1_additionals_marks"/>
811 <dc:if test="dc:contains($artifact-outs, 'map')"> 800 <dc:call-macro name="basedata_2_fixations_wqkms"/>
812 <map> 801 <dc:call-macro name="basedata_3_officials"/>
813 <dc:call-macro name="flood-map-complete"/> 802 <dc:call-macro name="basedata_4_heightmarks-points"/>
814 </map> 803 <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
815 </dc:if> 804 </dc:if>
816 <dc:if test="dc:contains($artifact-outs, 'flow_velocity')"> 805 <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')">
817 <dc:call-macro name="annotations"/> 806 </dc:if>
818 <dc:call-macro name="flow_velocity_measurements"/> 807 <dc:if test="dc:contains($artifact-outs, 'fix_longitudinal_section_curve')">
819 </dc:if> 808 <dc:call-macro name="annotations"/>
820 <dc:comment> 809 </dc:if>
821 MINFO bedheight middle 810 <dc:if test="dc:contains($artifact-outs, 'map')">
822 </dc:comment> 811 <dc:call-macro name="flood-map-complete"/>
823 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')"> 812 </dc:if>
824 <dc:call-macro name="sounding-width"/> 813 <dc:if test="dc:contains($artifact-outs, 'flow_velocity')">
825 </dc:if> 814 <dc:call-macro name="annotations"/>
826 <dc:comment comment="--- non-recommendations---"/> 815 <dc:call-macro name="flow_velocity_measurements"/>
827 </dc:otherwise> 816 </dc:if>
828 </dc:choose> 817 <dc:comment>
829 818 MINFO bedheight middle
830 819 </dc:comment>
831 <dc:if test="dc:contains($artifact-outs, 'waterlevels')"> 820 <dc:if test="dc:contains($artifact-outs, 'bedheight_middle')">
832 821 <dc:call-macro name="sounding-width"/>
833 <!-- base data --> 822 </dc:if>
834 <dc:call-macro name="basedata_0"/> 823 <dc:comment comment="--- non-recommendations---"/>
835 824 </dc:otherwise>
836 <!-- extra-longitudinal-sections --> 825 </dc:choose>
837 <dc:call-macro name="basedata_1_additionals"/> 826
838 827
839 <!-- fixations --> 828 <dc:if test="dc:contains($artifact-outs, 'waterlevels')">
840 <dc:call-macro name="basedata_2_fixations"/> 829
841 830 <!-- base data -->
842 <!-- flood water marks--> 831 <dc:call-macro name="basedata_0"/>
843 <dc:call-macro name="basedata_4_heightmarks-points"/> 832
844 833 <!-- extra-longitudinal-sections -->
845 <!-- flood protection --> 834 <dc:call-macro name="basedata_1_additionals"/>
846 <dc:call-macro name="basedata_5_flood-protections"/> 835
847 836 <!-- fixations -->
848 </dc:if> 837 <dc:call-macro name="basedata_2_fixations"/>
849 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and (dc:contains($parameters, 'recommended'))"> 838
850 <!--dc:call-macro name="basedata_2_fixations_wst"/--> 839 <!-- flood water marks-->
851 </dc:if> 840 <dc:call-macro name="basedata_4_heightmarks-points"/>
852 841
853 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and not (dc:contains($parameters, 'recommended'))"> 842 <!-- flood protection -->
854 <discharge_table_nn> 843 <dc:call-macro name="basedata_5_flood-protections"/>
855 <discharge_table_gauge> 844
856 <dc:context> 845 </dc:if>
857 <dc:statement> 846 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and (dc:contains($parameters, 'recommended'))">
858 SELECT id AS gauge_id, 847 <!--dc:call-macro name="basedata_2_fixations_wst"/-->
859 name AS gauge_name 848 </dc:if>
860 FROM gauges WHERE river_id = ${river_id} 849
861 </dc:statement> 850 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and not (dc:contains($parameters, 'recommended'))">
862 <dc:elements> 851 <discharge_table_nn>
863 <gauge> 852 <discharge_table_gauge>
864 <dc:attribute name="name" value="${gauge_name}"/>
865 <dc:attribute name="db-id" value="${gauge_id}"/>
866 <dc:attribute name="factory" value="gaugedischarge"/>
867 <dc:attribute name="from" value="${g_start}"/>
868 <dc:attribute name="to" value="${g_stop}"/>
869 <dc:attribute name="ids" value="${gauge_name}"/>
870 </gauge>
871 <!--
872 <gauge>
873 <dc:attribute name="name" value="${gauge_name}"/>
874 <dc:attribute name="db-id" value="${gauge_id}"/>
875 <dc:context>
876 <dc:statement>
877 SELECT description AS gauge_desc,
878 d.id AS discharge_id,
879 ti.start_time AS g_start,
880 ti.stop_time AS g_stop
881 FROM discharge_tables d JOIN time_intervals ti
882 ON d.time_interval_id = ti.id
883 WHERE d.gauge_id = ${gauge_id} AND d.kind = 1
884 </dc:statement>
885 <dc:elements>
886 <historical>
887 <dc:attribute name="name" value="${gauge_desc}"/>
888 <dc:attribute name="factory" value="gaugedischarge"/>
889 <dc:attribute name="from" value="${g_start}"/>
890 <dc:attribute name="to" value="${g_stop}"/>
891 <dc:attribute name="ids" value="${discharge_id}-${g_start}-${g_stop}"/>
892 </historical>
893 </dc:elements>
894 </dc:context>
895 </gauge>
896 -->
897 </dc:elements>
898 </dc:context>
899 </discharge_table_gauge>
900
901 </discharge_table_nn>
902
903 <dc:call-macro name="basedata_2_fixations_wst"/>
904
905 <dc:call-macro name="basedata_5_flood-protections"/>
906
907 <!-- former waterlevels -->
908 <dc:call-macro name="basedata_0"/>
909
910 <dc:call-macro name="basedata_1_additionals"/>
911
912 <!-- former flood-water-marks -->
913 <dc:call-macro name="basedata_4_heightmarks-points"/>
914 <computed_discharge_curve>
915 <dc:call-macro name="mainvalues"/>
916 </computed_discharge_curve>
917 </dc:if>
918
919 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve') and not (dc:contains($parameters, 'recommended'))">
920 <discharge_table_nn>
921 <discharge_table_gauge>
922 <dc:context>
923 <dc:statement>
924 SELECT id AS gauge_id,
925 name AS gauge_name
926 FROM gauges WHERE river_id = ${river_id}
927 </dc:statement>
928 <dc:elements>
929 <gauge>
930 <dc:attribute name="name" value="${gauge_name}"/>
931 <dc:attribute name="db-id" value="${gauge_id}"/>
932 <dc:attribute name="factory" value="gaugedischarge"/>
933 <dc:attribute name="from" value="${g_start}"/>
934 <dc:attribute name="to" value="${g_stop}"/>
935 <dc:attribute name="ids" value="${gauge_name}"/>
936 </gauge>
937 </dc:elements>
938 </dc:context>
939 </discharge_table_gauge>
940 </discharge_table_nn>
941 </dc:if>
942
943 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'floodmap-hws')">
944 <floodmap>
945 <dc:choose>
946 <dc:when test="dc:contains($parameters, 'recommended')">
947 <dc:call-macro name="flood-map-recommended"/>
948 </dc:when>
949 <dc:when test="dc:contains($parameters, 'dem')">
950 <dc:call-macro name="flood-map-dem"/>
951 </dc:when>
952 <dc:otherwise>
953 <dc:call-macro name="flood-map-complete"/>
954 </dc:otherwise>
955 </dc:choose>
956 </floodmap>
957 <dc:if test="dc:contains($parameters, 'hws')">
958 <hws>
959 <dc:call-macro name="flood-map-hws-lines" />
960 <dc:call-macro name="flood-map-hws-points" />
961 </hws>
962 </dc:if>
963
964 <dc:macro name="flood-map-recommended">
965 <dc:comment>
966 FIXME: Following two macros look identical to me.
967 </dc:comment>
968 <kilometrage>
969 <riveraxis>
970 <dc:attribute name="factory" value="riveraxis"/>
971 <dc:attribute name="ids" value="${river_id}"/>
972 </riveraxis>
973 </kilometrage>
974 <rastermap>
975 <background>
976 <dc:attribute name="factory" value="wmsbackground"/>
977 <dc:attribute name="ids" value="${river_id}"/>
978 </background>
979 </rastermap>
980 </dc:macro>
981 <dc:macro name="flood-map-dem">
982 <dems>
983 <dc:context>
984 <dc:statement>
985 SELECT d.id AS dem_id,
986 r.a AS dem_lower,
987 r.b AS dem_upper,
988 d.name AS name,
989 d.projection || ' | ' || t.start_time || ' - ' || t.stop_time AS info
990 FROM dem d
991 JOIN ranges r ON d.range_id = r.id
992 JOIN time_intervals t ON d.time_interval_id = t.id
993 WHERE d.river_id = ${river_id}
994 </dc:statement>
995 <dc:elements>
996 <dem>
997 <dc:attribute name="factory" value="demfactory"/>
998 <dc:attribute name="ids" value="${dem_id}"/>
999 <dc:attribute name="name" value="${name}"/>
1000 <dc:attribute name="info" value="${info}"/>
1001 </dem>
1002 </dc:elements>
1003 </dc:context>
1004 </dems>
1005 </dc:macro>
1006 <dc:macro name="flood-map-hws-lines">
1007 <dc:context> 853 <dc:context>
1008 <dc:statement> 854 <dc:statement>
1009 SELECT DISTINCT 855 SELECT id AS gauge_id,
1010 name AS hws_name, 856 name AS gauge_name
1011 official AS hws_official, 857 FROM gauges WHERE river_id = ${river_id}
1012 kind_id AS hws_kind
1013 FROM hws_lines
1014 WHERE river_id = ${river_id}
1015 </dc:statement> 858 </dc:statement>
1016 <lines> 859 <dc:elements>
1017 <official> 860 <gauge>
1018 <Durchlass> 861 <dc:attribute name="name" value="${gauge_name}"/>
1019 <dc:elements filter="$hws_kind=1 and $hws_official=1"> 862 <dc:attribute name="db-id" value="${gauge_id}"/>
1020 <hws> 863 <dc:attribute name="factory" value="gaugedischarge"/>
1021 <dc:attribute name="factory" value="hwsfactory"/> 864 <dc:attribute name="from" value="${g_start}"/>
1022 <dc:attribute name="name" value="${hws_name}"/> 865 <dc:attribute name="to" value="${g_stop}"/>
1023 </hws> 866 <dc:attribute name="ids" value="${gauge_name}"/>
867 </gauge>
868 <!--
869 <gauge>
870 <dc:attribute name="name" value="${gauge_name}"/>
871 <dc:attribute name="db-id" value="${gauge_id}"/>
872 <dc:context>
873 <dc:statement>
874 SELECT description AS gauge_desc,
875 d.id AS discharge_id,
876 ti.start_time AS g_start,
877 ti.stop_time AS g_stop
878 FROM discharge_tables d JOIN time_intervals ti
879 ON d.time_interval_id = ti.id
880 WHERE d.gauge_id = ${gauge_id} AND d.kind = 1
881 </dc:statement>
882 <dc:elements>
883 <historical>
884 <dc:attribute name="name" value="${gauge_desc}"/>
885 <dc:attribute name="factory" value="gaugedischarge"/>
886 <dc:attribute name="from" value="${g_start}"/>
887 <dc:attribute name="to" value="${g_stop}"/>
888 <dc:attribute name="ids" value="${discharge_id}-${g_start}-${g_stop}"/>
889 </historical>
1024 </dc:elements> 890 </dc:elements>
1025 </Durchlass> 891 </dc:context>
1026 <Damm> 892 </gauge>
1027 <dc:elements filter="$hws_kind=2 and $hws_official=1"> 893 -->
1028 <hws> 894 </dc:elements>
1029 <dc:attribute name="factory" value="hwsfactory"/> 895 </dc:context>
1030 <dc:attribute name="name" value="${hws_name}"/> 896 </discharge_table_gauge>
1031 </hws> 897
1032 </dc:elements> 898 </discharge_table_nn>
1033 </Damm> 899
1034 <Graben> 900 <dc:call-macro name="basedata_2_fixations_wst"/>
1035 <dc:elements filter="$hws_kind=3 and $hws_official=1"> 901
902 <dc:call-macro name="basedata_5_flood-protections"/>
903
904 <!-- former waterlevels -->
905 <dc:call-macro name="basedata_0"/>
906
907 <dc:call-macro name="basedata_1_additionals"/>
908
909 <!-- former flood-water-marks -->
910 <dc:call-macro name="basedata_4_heightmarks-points"/>
911 <computed_discharge_curve>
912 <dc:call-macro name="mainvalues"/>
913 </computed_discharge_curve>
914 </dc:if>
915
916 <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve') and not (dc:contains($parameters, 'recommended'))">
917 <discharge_table_nn>
918 <discharge_table_gauge>
919 <dc:context>
920 <dc:statement>
921 SELECT id AS gauge_id,
922 name AS gauge_name
923 FROM gauges WHERE river_id = ${river_id}
924 </dc:statement>
925 <dc:elements>
926 <gauge>
927 <dc:attribute name="name" value="${gauge_name}"/>
928 <dc:attribute name="db-id" value="${gauge_id}"/>
929 <dc:attribute name="factory" value="gaugedischarge"/>
930 <dc:attribute name="from" value="${g_start}"/>
931 <dc:attribute name="to" value="${g_stop}"/>
932 <dc:attribute name="ids" value="${gauge_name}"/>
933 </gauge>
934 </dc:elements>
935 </dc:context>
936 </discharge_table_gauge>
937 </discharge_table_nn>
938 </dc:if>
939
940 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'floodmap-hws')">
941 <floodmap>
942 <dc:choose>
943 <dc:when test="dc:contains($parameters, 'recommended')">
944 <dc:call-macro name="flood-map-recommended"/>
945 </dc:when>
946 <dc:when test="dc:contains($parameters, 'dem')">
947 <dc:call-macro name="flood-map-dem"/>
948 </dc:when>
949 <dc:otherwise>
950 <dc:call-macro name="flood-map-complete"/>
951 </dc:otherwise>
952 </dc:choose>
953 </floodmap>
954 <dc:if test="dc:contains($parameters, 'hws')">
955 <hws>
956 <dc:call-macro name="flood-map-hws-lines" />
957 <dc:call-macro name="flood-map-hws-points" />
958 </hws>
959 </dc:if>
960
961 <dc:macro name="flood-map-recommended">
962 <dc:comment>
963 FIXME: Following two macros look identical to me.
964 </dc:comment>
965 <kilometrage>
966 <riveraxis>
967 <dc:attribute name="factory" value="riveraxis"/>
968 <dc:attribute name="ids" value="${river_id}"/>
969 </riveraxis>
970 </kilometrage>
971 <rastermap>
972 <background>
973 <dc:attribute name="factory" value="wmsbackground"/>
974 <dc:attribute name="ids" value="${river_id}"/>
975 </background>
976 </rastermap>
977 </dc:macro>
978 <dc:macro name="flood-map-dem">
979 <dems>
980 <dc:context>
981 <dc:statement>
982 SELECT d.id AS dem_id,
983 r.a AS dem_lower,
984 r.b AS dem_upper,
985 d.name AS name,
986 d.projection || ' | ' || t.start_time || ' - ' || t.stop_time AS info
987 FROM dem d
988 JOIN ranges r ON d.range_id = r.id
989 JOIN time_intervals t ON d.time_interval_id = t.id
990 WHERE d.river_id = ${river_id}
991 </dc:statement>
992 <dc:elements>
993 <dem>
994 <dc:attribute name="factory" value="demfactory"/>
995 <dc:attribute name="ids" value="${dem_id}"/>
996 <dc:attribute name="name" value="${name}"/>
997 <dc:attribute name="info" value="${info}"/>
998 </dem>
999 </dc:elements>
1000 </dc:context>
1001 </dems>
1002 </dc:macro>
1003 <dc:macro name="flood-map-hws-lines">
1004 <dc:context>
1005 <dc:statement>
1006 SELECT DISTINCT
1007 name AS hws_name,
1008 official AS hws_official,
1009 kind_id AS hws_kind
1010 FROM hws_lines
1011 WHERE river_id = ${river_id}
1012 </dc:statement>
1013 <lines>
1014 <official>
1015 <Durchlass>
1016 <dc:elements filter="$hws_kind=1 and $hws_official=1">
1036 <hws> 1017 <hws>
1037 <dc:attribute name="factory" value="hwsfactory"/> 1018 <dc:attribute name="factory" value="hwsfactory"/>
1038 <dc:attribute name="name" value="${hws_name}"/> 1019 <dc:attribute name="name" value="${hws_name}"/>
1039 </hws> 1020 </hws>
1040 </dc:elements> 1021 </dc:elements>
1041 </Graben> 1022 </Durchlass>
1042 </official> 1023 <Damm>
1043 <inofficial> 1024 <dc:elements filter="$hws_kind=2 and $hws_official=1">
1044 <Durchlass>
1045 <dc:elements filter="$hws_kind=1 and $hws_official=0">
1046 <hws> 1025 <hws>
1047 <dc:attribute name="factory" value="hwsfactory"/> 1026 <dc:attribute name="factory" value="hwsfactory"/>
1048 <dc:attribute name="name" value="${hws_name}"/> 1027 <dc:attribute name="name" value="${hws_name}"/>
1049 </hws> 1028 </hws>
1050 </dc:elements> 1029 </dc:elements>
1051 </Durchlass> 1030 </Damm>
1052 <Damm> 1031 <Graben>
1053 <dc:elements filter="$hws_kind=2 and $hws_official=0"> 1032 <dc:elements filter="$hws_kind=3 and $hws_official=1">
1054 <hws> 1033 <hws>
1055 <dc:attribute name="factory" value="hwsfactory"/> 1034 <dc:attribute name="factory" value="hwsfactory"/>
1056 <dc:attribute name="name" value="${hws_name}"/> 1035 <dc:attribute name="name" value="${hws_name}"/>
1057 </hws> 1036 </hws>
1058 </dc:elements> 1037 </dc:elements>
1059 </Damm> 1038 </Graben>
1060 <Graben> 1039 </official>
1061 <dc:elements filter="$hws_kind=3 and $hws_official=0"> 1040 <inofficial>
1062 <hws> 1041 <Durchlass>
1063 <dc:attribute name="factory" value="hwsfactory"/> 1042 <dc:elements filter="$hws_kind=1 and $hws_official=0">
1064 <dc:attribute name="name" value="${hws_name}"/> 1043 <hws>
1065 </hws> 1044 <dc:attribute name="factory" value="hwsfactory"/>
1066 </dc:elements> 1045 <dc:attribute name="name" value="${hws_name}"/>
1067 </Graben> 1046 </hws>
1068 </inofficial> 1047 </dc:elements>
1069 </lines> 1048 </Durchlass>
1070 </dc:context> 1049 <Damm>
1071 </dc:macro> 1050 <dc:elements filter="$hws_kind=2 and $hws_official=0">
1072 <dc:macro name="flood-map-hws-points"> 1051 <hws>
1052 <dc:attribute name="factory" value="hwsfactory"/>
1053 <dc:attribute name="name" value="${hws_name}"/>
1054 </hws>
1055 </dc:elements>
1056 </Damm>
1057 <Graben>
1058 <dc:elements filter="$hws_kind=3 and $hws_official=0">
1059 <hws>
1060 <dc:attribute name="factory" value="hwsfactory"/>
1061 <dc:attribute name="name" value="${hws_name}"/>
1062 </hws>
1063 </dc:elements>
1064 </Graben>
1065 </inofficial>
1066 </lines>
1067 </dc:context>
1068 </dc:macro>
1069 <dc:macro name="flood-map-hws-points">
1070 <dc:context>
1071 <dc:statement>
1072 SELECT DISTINCT
1073 name AS hws_points_name,
1074 official AS hws_points_official,
1075 kind_id AS hws_points_kind
1076 FROM hws_points
1077 WHERE river_id = ${river_id}
1078 </dc:statement>
1079 <points>
1080 <official>
1081 <Durchlass>
1082 <dc:elements filter="$hws_points_kind=1 and $hws_points_official=1">
1083 <hws>
1084 <dc:attribute name="factory" value="hwsfactory"/>
1085 <dc:attribute name="name" value="${hws_points_name}"/>
1086 </hws>
1087 </dc:elements>
1088 </Durchlass>
1089 <Damm>
1090 <dc:elements filter="$hws_points_kind=2 and $hws_points_official=1">
1091 <hws>
1092 <dc:attribute name="factory" value="hwsfactory"/>
1093 <dc:attribute name="name" value="${hws_points_name}"/>
1094 </hws>
1095 </dc:elements>
1096 </Damm>
1097 <Graben>
1098 <dc:elements filter="$hws_kind=3 and $hws_official=1">
1099 <hws>
1100 <dc:attribute name="factory" value="hwsfactory"/>
1101 <dc:attribute name="name" value="${hws_points_name}"/>
1102 </hws>
1103 </dc:elements>
1104 </Graben>
1105 </official>
1106 <inofficial>
1107 <Durchlass>
1108 <dc:elements filter="$hws_points_kind=1 and $hws_points_official=0">
1109 <hws>
1110 <dc:attribute name="factory" value="hwsfactory"/>
1111 <dc:attribute name="name" value="${hws_points_name}"/>
1112 </hws>
1113 </dc:elements>
1114 </Durchlass>
1115 <Damm>
1116 <dc:elements filter="$hws_points_kind=2 and $hws_points_official=0">
1117 <hws>
1118 <dc:attribute name="factory" value="hwsfactory"/>
1119 <dc:attribute name="name" value="${hws_points_name}"/>
1120 </hws>
1121 </dc:elements>
1122 </Damm>
1123 <Graben>
1124 <dc:elements filter="$hws_points_kind=3 and $hws_points_official=0">
1125 <hws>
1126 <dc:attribute name="factory" value="hwsfactory"/>
1127 <dc:attribute name="name" value="${hws_points_name}"/>
1128 </hws>
1129 </dc:elements>
1130 </Graben>
1131 </inofficial>
1132 </points>
1133 </dc:context>
1134 </dc:macro>
1135 <dc:macro name="flood-map-km">
1136 <dc:context>
1137 <dc:statement>
1138 SELECT count(*) as km_exists
1139 FROM river_axes_km WHERE river_id = ${river_id}
1140 </dc:statement>
1141 <dc:elements>
1142 <dc:if test="$km_exists>0">
1143 <km>
1144 <dc:attribute name="factory" value="wmskmfactory"/>
1145 <dc:attribute name="ids" value="${river_id}"/>
1146 </km>
1147 </dc:if>
1148 </dc:elements>
1149 </dc:context>
1150 </dc:macro>
1151 <dc:macro name="flood-map-qps">
1152 <dc:context>
1153 <dc:statement>
1154 SELECT count(*) as km_exists
1155 FROM cross_section_tracks WHERE river_id = ${river_id}
1156 </dc:statement>
1157 <dc:elements>
1158 <dc:if test="$km_exists>0">
1159 <qps>
1160 <dc:attribute name="factory" value="wmsqpsfactory"/>
1161 <dc:attribute name="ids" value="${river_id}"/>
1162 </qps>
1163 </dc:if>
1164 </dc:elements>
1165 </dc:context>
1166 </dc:macro>
1167 <dc:macro name="flood-map-hydr-boundaries">
1168 <hydr_boundaries_lines>
1169 <dc:call-macro name="flood-map-hydr-boundaries-lines"/>
1170 </hydr_boundaries_lines>
1171 <hydr_boundaries_polygons>
1172 <dc:call-macro name="flood-map-hydr-boundaries-poly"/>
1173 </hydr_boundaries_polygons>
1174 </dc:macro>
1175 <dc:macro name="flood-map-hydr-boundaries-lines">
1176 <bfg>
1073 <dc:context> 1177 <dc:context>
1074 <dc:statement> 1178 <dc:statement>
1075 SELECT DISTINCT 1179 SELECT count(*) as km_exists, name as name
1076 name AS hws_points_name, 1180 FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 1 GROUP BY name
1077 official AS hws_points_official,
1078 kind_id AS hws_points_kind
1079 FROM hws_points
1080 WHERE river_id = ${river_id}
1081 </dc:statement>
1082 <points>
1083 <official>
1084 <Durchlass>
1085 <dc:elements filter="$hws_points_kind=1 and $hws_points_official=1">
1086 <hws>
1087 <dc:attribute name="factory" value="hwsfactory"/>
1088 <dc:attribute name="name" value="${hws_points_name}"/>
1089 </hws>
1090 </dc:elements>
1091 </Durchlass>
1092 <Damm>
1093 <dc:elements filter="$hws_points_kind=2 and $hws_points_official=1">
1094 <hws>
1095 <dc:attribute name="factory" value="hwsfactory"/>
1096 <dc:attribute name="name" value="${hws_points_name}"/>
1097 </hws>
1098 </dc:elements>
1099 </Damm>
1100 <Graben>
1101 <dc:elements filter="$hws_kind=3 and $hws_official=1">
1102 <hws>
1103 <dc:attribute name="factory" value="hwsfactory"/>
1104 <dc:attribute name="name" value="${hws_points_name}"/>
1105 </hws>
1106 </dc:elements>
1107 </Graben>
1108 </official>
1109 <inofficial>
1110 <Durchlass>
1111 <dc:elements filter="$hws_points_kind=1 and $hws_points_official=0">
1112 <hws>
1113 <dc:attribute name="factory" value="hwsfactory"/>
1114 <dc:attribute name="name" value="${hws_points_name}"/>
1115 </hws>
1116 </dc:elements>
1117 </Durchlass>
1118 <Damm>
1119 <dc:elements filter="$hws_points_kind=2 and $hws_points_official=0">
1120 <hws>
1121 <dc:attribute name="factory" value="hwsfactory"/>
1122 <dc:attribute name="name" value="${hws_points_name}"/>
1123 </hws>
1124 </dc:elements>
1125 </Damm>
1126 <Graben>
1127 <dc:elements filter="$hws_points_kind=3 and $hws_points_official=0">
1128 <hws>
1129 <dc:attribute name="factory" value="hwsfactory"/>
1130 <dc:attribute name="name" value="${hws_points_name}"/>
1131 </hws>
1132 </dc:elements>
1133 </Graben>
1134 </inofficial>
1135 </points>
1136 </dc:context>
1137 </dc:macro>
1138 <dc:macro name="flood-map-km">
1139 <dc:context>
1140 <dc:statement>
1141 SELECT count(*) as km_exists
1142 FROM river_axes_km WHERE river_id = ${river_id}
1143 </dc:statement> 1181 </dc:statement>
1144 <dc:elements> 1182 <dc:elements>
1145 <dc:if test="$km_exists>0"> 1183 <dc:if test="$km_exists>0">
1146 <km> 1184 <hydrboundary>
1147 <dc:attribute name="factory" value="wmskmfactory"/> 1185 <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
1148 <dc:attribute name="ids" value="${river_id}"/> 1186 <dc:attribute name="ids" value="${river_id};${name}"/>
1149 </km> 1187 <dc:attribute name="name" value="${name}"/>
1188 </hydrboundary>
1150 </dc:if> 1189 </dc:if>
1151 </dc:elements> 1190 </dc:elements>
1152 </dc:context> 1191 </dc:context>
1153 </dc:macro> 1192 </bfg>
1154 <dc:macro name="flood-map-qps"> 1193 <land>
1155 <dc:context> 1194 <dc:context>
1156 <dc:statement> 1195 <dc:statement>
1157 SELECT count(*) as km_exists 1196 SELECT count(*) as km_exists, name as name
1158 FROM cross_section_tracks WHERE river_id = ${river_id} 1197 FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 2 GROUP BY name
1159 </dc:statement> 1198 </dc:statement>
1160 <dc:elements> 1199 <dc:elements>
1161 <dc:if test="$km_exists>0"> 1200 <dc:if test="$km_exists>0">
1162 <qps> 1201 <hydrboundary>
1163 <dc:attribute name="factory" value="wmsqpsfactory"/> 1202 <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
1164 <dc:attribute name="ids" value="${river_id}"/> 1203 <dc:attribute name="ids" value="${river_id};${name}"/>
1165 </qps> 1204 <dc:attribute name="name" value="${name}"/>
1205 </hydrboundary>
1166 </dc:if> 1206 </dc:if>
1167 </dc:elements> 1207 </dc:elements>
1168 </dc:context> 1208 </dc:context>
1169 </dc:macro> 1209 </land>
1170 <dc:macro name="flood-map-hydr-boundaries"> 1210 </dc:macro>
1171 <hydr_boundaries_lines> 1211 <dc:macro name="flood-map-hydr-boundaries-poly">
1172 <dc:call-macro name="flood-map-hydr-boundaries-lines"/> 1212 <bfg>
1173 </hydr_boundaries_lines>
1174 <hydr_boundaries_polygons>
1175 <dc:call-macro name="flood-map-hydr-boundaries-poly"/>
1176 </hydr_boundaries_polygons>
1177 </dc:macro>
1178 <dc:macro name="flood-map-hydr-boundaries-lines">
1179 <bfg>
1180 <dc:context>
1181 <dc:statement>
1182 SELECT count(*) as km_exists, name as name
1183 FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 1 GROUP BY name
1184 </dc:statement>
1185 <dc:elements>
1186 <dc:if test="$km_exists>0">
1187 <hydrboundary>
1188 <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
1189 <dc:attribute name="ids" value="${river_id};${name}"/>
1190 <dc:attribute name="name" value="${name}"/>
1191 </hydrboundary>
1192 </dc:if>
1193 </dc:elements>
1194 </dc:context>
1195 </bfg>
1196 <land>
1197 <dc:context>
1198 <dc:statement>
1199 SELECT count(*) as km_exists, name as name
1200 FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 2 GROUP BY name
1201 </dc:statement>
1202 <dc:elements>
1203 <dc:if test="$km_exists>0">
1204 <hydrboundary>
1205 <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
1206 <dc:attribute name="ids" value="${river_id};${name}"/>
1207 <dc:attribute name="name" value="${name}"/>
1208 </hydrboundary>
1209 </dc:if>
1210 </dc:elements>
1211 </dc:context>
1212 </land>
1213 </dc:macro>
1214 <dc:macro name="flood-map-hydr-boundaries-poly">
1215 <bfg>
1216 <dc:context>
1217 <dc:statement>
1218 SELECT count(*) as km_exists, name as name
1219 FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 1 GROUP BY name
1220 </dc:statement>
1221 <dc:elements>
1222 <dc:if test="$km_exists>0">
1223 <hws>
1224 <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
1225 <dc:attribute name="ids" value="${river_id};${name}"/>
1226 <dc:attribute name="name" value="${name}"/>
1227 </hws>
1228 </dc:if>
1229 </dc:elements>
1230 </dc:context>
1231 </bfg>
1232 <land>
1233 <dc:context>
1234 <dc:statement>
1235 SELECT count(*) as km_exists, name as name
1236 FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 2 GROUP BY name
1237 </dc:statement>
1238 <dc:elements>
1239 <dc:if test="$km_exists>0">
1240 <hws>
1241 <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
1242 <dc:attribute name="ids" value="${river_id};${name}"/>
1243 <dc:attribute name="name" value="${name}"/>
1244 </hws>
1245 </dc:if>
1246 </dc:elements>
1247 </dc:context>
1248 </land>
1249 </dc:macro>
1250 <dc:macro name="flood-map-floodplain">
1251 <dc:context> 1213 <dc:context>
1252 <dc:statement> 1214 <dc:statement>
1253 SELECT count(*) as km_exists 1215 SELECT count(*) as km_exists, name as name
1254 FROM floodplain WHERE river_id = ${river_id} 1216 FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 1 GROUP BY name
1255 </dc:statement> 1217 </dc:statement>
1256 <dc:elements> 1218 <dc:elements>
1257 <dc:if test="$km_exists>0"> 1219 <dc:if test="$km_exists>0">
1258 <floodplain> 1220 <hws>
1259 <dc:attribute name="factory" value="wmsfloodplainfactory"/> 1221 <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
1260 <dc:attribute name="ids" value="${river_id}"/> 1222 <dc:attribute name="ids" value="${river_id};${name}"/>
1261 </floodplain> 1223 <dc:attribute name="name" value="${name}"/>
1224 </hws>
1262 </dc:if> 1225 </dc:if>
1263 </dc:elements> 1226 </dc:elements>
1264 </dc:context> 1227 </dc:context>
1265 </dc:macro> 1228 </bfg>
1266 1229 <land>
1267 <dc:macro name="hwslines_by_kind">
1268 <dc:comment>
1269 Call from a context where fed_name hws_kind hws_name and river_id is
1270 availble
1271 </dc:comment>
1272 <Durchlass>
1273 <dc:elements filter="$hws_kind=1">
1274 <hws>
1275 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1276 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1277 <dc:attribute name="name" value="${hws_name}"/>
1278 </hws>
1279 </dc:elements>
1280 </Durchlass>
1281 <Damm>
1282 <dc:elements filter="$hws_kind=2">
1283 <hws>
1284 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1285 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1286 <dc:attribute name="name" value="${hws_name}"/>
1287 </hws>
1288 </dc:elements>
1289 </Damm>
1290 <Graben>
1291 <dc:elements filter="$hws_kind=3">
1292 <hws>
1293 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1294 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1295 <dc:attribute name="name" value="${hws_name}"/>
1296 </hws>
1297 </dc:elements>
1298 </Graben>
1299 </dc:macro>
1300
1301 <dc:macro name="hwslines">
1302 <hws_lines>
1303 <official>
1304 <dc:context>
1305 <dc:statement>
1306 SELECT DISTINCT
1307 fs.name AS fed_name,
1308 fs.id AS fed_id
1309 FROM hws_lines hws
1310 JOIN fed_states fs ON hws.fed_state_id = fs.id
1311 WHERE river_id = ${river_id}
1312 AND hws.official=1
1313 </dc:statement>
1314 <dc:elements>
1315 <dc:context>
1316 <dc:statement>
1317 SELECT DISTINCT
1318 name AS hws_name,
1319 kind_id AS hws_kind
1320 FROM hws_lines
1321 WHERE river_id = ${river_id}
1322 AND official=1
1323 AND fed_state_id = ${fed_id} ORDER BY name
1324 </dc:statement>
1325 <fedstate>
1326 <dc:attribute name="description" value="${fed_name}"/>
1327 <dc:call-macro name="hwslines_by_kind"/>
1328 </fedstate>
1329 </dc:context>
1330 </dc:elements>
1331 </dc:context>
1332 <dc:context>
1333 <dc:statement>
1334 SELECT distinct
1335 name AS hws_name,
1336 kind_id AS hws_kind
1337 FROM hws_lines
1338 WHERE river_id = ${river_id}
1339 AND official=1
1340 AND fed_state_id IS NULL
1341 ORDER BY name
1342 </dc:statement>
1343 <hws_fed_unknown>
1344 <dc:call-macro name="hwslines_by_kind"/>
1345 </hws_fed_unknown>
1346 </dc:context>
1347 </official>
1348 <inofficial>
1349 <dc:context>
1350 <dc:statement>
1351 SELECT DISTINCT
1352 fs.name AS fed_name,
1353 fs.id AS fed_id
1354 FROM hws_lines hws
1355 JOIN fed_states fs ON hws.fed_state_id = fs.id
1356 WHERE river_id = ${river_id}
1357 AND hws.official=0
1358 </dc:statement>
1359 <dc:elements>
1360 <dc:context>
1361 <dc:statement>
1362 SELECT DISTINCT
1363 name AS hws_name,
1364 kind_id AS hws_kind
1365 FROM hws_lines
1366 WHERE river_id = ${river_id}
1367 AND official=0
1368 AND fed_state_id = ${fed_id} ORDER BY name
1369 </dc:statement>
1370 <fedstate>
1371 <dc:attribute name="description" value="${fed_name}"/>
1372 <dc:call-macro name="hwslines_by_kind"/>
1373 </fedstate>
1374 </dc:context>
1375 </dc:elements>
1376 </dc:context>
1377 <dc:context>
1378 <dc:statement>
1379 SELECT distinct
1380 name AS hws_name,
1381 kind_id AS hws_kind
1382 FROM hws_lines
1383 WHERE river_id = ${river_id}
1384 AND official=0
1385 AND fed_state_id IS NULL ORDER BY name
1386 </dc:statement>
1387 <hws_fed_unknown>
1388 <dc:call-macro name="hwslines_by_kind"/>
1389 </hws_fed_unknown>
1390 </dc:context>
1391 </inofficial>
1392 </hws_lines>
1393 </dc:macro>
1394
1395 <dc:macro name="hwspoints_by_kind">
1396 <dc:comment>
1397 Call from a context where fed_name hws_kind hws_name and river_id is
1398 availble
1399 </dc:comment>
1400 <Durchlass>
1401 <dc:elements filter="$hws_kind=1">
1402 <hws>
1403 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1404 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1405 <dc:attribute name="name" value="${hws_name}"/>
1406 </hws>
1407 </dc:elements>
1408 </Durchlass>
1409 <Damm>
1410 <dc:elements filter="$hws_kind=2">
1411 <hws>
1412 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1413 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1414 <dc:attribute name="name" value="${hws_name}"/>
1415 </hws>
1416 </dc:elements>
1417 </Damm>
1418 <Graben>
1419 <dc:elements filter="$hws_kind=3">
1420 <hws>
1421 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1422 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1423 <dc:attribute name="name" value="${hws_name}"/>
1424 </hws>
1425 </dc:elements>
1426 </Graben>
1427 </dc:macro>
1428
1429 <dc:macro name="hwspoints">
1430 <hws_points>
1431 <official>
1432 <dc:context>
1433 <dc:statement>
1434 SELECT DISTINCT
1435 fs.name AS fed_name,
1436 fs.id AS fed_id
1437 FROM hws_points hws
1438 JOIN fed_states fs ON hws.fed_state_id = fs.id
1439 WHERE river_id = ${river_id}
1440 AND hws.official=1
1441 </dc:statement>
1442 <dc:elements>
1443 <dc:context>
1444 <dc:statement>
1445 SELECT DISTINCT
1446 name AS hws_name,
1447 kind_id AS hws_kind
1448 FROM hws_points
1449 WHERE river_id = ${river_id}
1450 AND official=1
1451 AND fed_state_id = ${fed_id} ORDER BY name
1452 </dc:statement>
1453 <fedstate>
1454 <dc:attribute name="description" value="${fed_name}"/>
1455 <dc:call-macro name="hwspoints_by_kind"/>
1456 </fedstate>
1457 </dc:context>
1458 </dc:elements>
1459 </dc:context>
1460 <dc:context>
1461 <dc:statement>
1462 SELECT distinct
1463 name AS hws_name,
1464 kind_id AS hws_kind
1465 FROM hws_points
1466 WHERE river_id = ${river_id}
1467 AND official=1
1468 AND fed_state_id IS NULL
1469 ORDER BY name
1470 </dc:statement>
1471 <hws_fed_unknown>
1472 <dc:call-macro name="hwspoints_by_kind"/>
1473 </hws_fed_unknown>
1474 </dc:context>
1475 </official>
1476 <inofficial>
1477 <dc:context>
1478 <dc:statement>
1479 SELECT DISTINCT
1480 fs.name AS fed_name,
1481 fs.id AS fed_id
1482 FROM hws_points hws
1483 JOIN fed_states fs ON hws.fed_state_id = fs.id
1484 WHERE river_id = ${river_id}
1485 AND hws.official=0
1486 </dc:statement>
1487 <dc:elements>
1488 <dc:context>
1489 <dc:statement>
1490 SELECT DISTINCT
1491 name AS hws_name,
1492 kind_id AS hws_kind
1493 FROM hws_points
1494 WHERE river_id = ${river_id}
1495 AND official=0
1496 AND fed_state_id = ${fed_id} ORDER BY name
1497 </dc:statement>
1498 <fedstate>
1499 <dc:attribute name="description" value="${fed_name}"/>
1500 <dc:call-macro name="hwspoints_by_kind"/>
1501 </fedstate>
1502 </dc:context>
1503 </dc:elements>
1504 </dc:context>
1505 <dc:context>
1506 <dc:statement>
1507 SELECT distinct
1508 name AS hws_name,
1509 kind_id AS hws_kind
1510 FROM hws_points
1511 WHERE river_id = ${river_id}
1512 AND official=0
1513 AND fed_state_id IS NULL ORDER BY name
1514 </dc:statement>
1515 <hws_fed_unknown>
1516 <dc:call-macro name="hwspoints_by_kind"/>
1517 </hws_fed_unknown>
1518 </dc:context>
1519 </inofficial>
1520 </hws_points>
1521 </dc:macro>
1522
1523
1524 <dc:macro name="flood-map-buildings">
1525 <dc:context>
1526 <dc:statement>
1527 SELECT DISTINCT
1528 b.kind_id AS building_kind_id,
1529 bk.name AS building_kind
1530 FROM buildings b
1531 JOIN building_kinds bk ON b.kind_id = bk.id
1532 WHERE river_id = ${river_id}
1533 </dc:statement>
1534 <dc:elements>
1535 <buildings>
1536 <dc:attribute name="description" value="${building_kind}"/>
1537 <dc:attribute name="factory" value="wmsbuildingsfactory"/>
1538 <dc:attribute name="ids" value="${river_id};${building_kind};${building_kind_id}"/>
1539 </buildings>
1540 </dc:elements>
1541 </dc:context>
1542 </dc:macro>
1543 <dc:macro name="flood-map-fixpoints">
1544 <dc:context> 1230 <dc:context>
1545 <dc:statement> 1231 <dc:statement>
1546 SELECT count(*) as km_exists, name as name 1232 SELECT count(*) as km_exists, name as name
1547 FROM fixpoints WHERE river_id = ${river_id} GROUP BY name 1233 FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 2 GROUP BY name
1548 </dc:statement> 1234 </dc:statement>
1549 <dc:elements> 1235 <dc:elements>
1550 <dc:if test="$km_exists>0"> 1236 <dc:if test="$km_exists>0">
1551 <fixpoint> 1237 <hws>
1552 <dc:attribute name="factory" value="wmsfixpointsfactory"/> 1238 <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
1553 <dc:attribute name="ids" value="${river_id};${name}"/> 1239 <dc:attribute name="ids" value="${river_id};${name}"/>
1554 <dc:attribute name="name" value="${name}"/> 1240 <dc:attribute name="name" value="${name}"/>
1555 </fixpoint> 1241 </hws>
1556 </dc:if> 1242 </dc:if>
1557 </dc:elements> 1243 </dc:elements>
1558 </dc:context> 1244 </dc:context>
1245 </land>
1246 </dc:macro>
1247 <dc:macro name="flood-map-floodplain">
1248 <dc:context>
1249 <dc:statement>
1250 SELECT count(*) as km_exists
1251 FROM floodplain WHERE river_id = ${river_id}
1252 </dc:statement>
1253 <dc:elements>
1254 <dc:if test="$km_exists>0">
1255 <floodplain>
1256 <dc:attribute name="factory" value="wmsfloodplainfactory"/>
1257 <dc:attribute name="ids" value="${river_id}"/>
1258 </floodplain>
1259 </dc:if>
1260 </dc:elements>
1261 </dc:context>
1262 </dc:macro>
1263
1264 <dc:macro name="hwslines_by_kind">
1265 <dc:comment>
1266 Call from a context where fed_name hws_kind hws_name and river_id is
1267 availble
1268 </dc:comment>
1269 <Durchlass>
1270 <dc:elements filter="$hws_kind=1">
1271 <hws>
1272 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1273 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1274 <dc:attribute name="name" value="${hws_name}"/>
1275 </hws>
1276 </dc:elements>
1277 </Durchlass>
1278 <Damm>
1279 <dc:elements filter="$hws_kind=2">
1280 <hws>
1281 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1282 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1283 <dc:attribute name="name" value="${hws_name}"/>
1284 </hws>
1285 </dc:elements>
1286 </Damm>
1287 <Graben>
1288 <dc:elements filter="$hws_kind=3">
1289 <hws>
1290 <dc:attribute name="factory" value="wmshwslinesfactory"/>
1291 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1292 <dc:attribute name="name" value="${hws_name}"/>
1293 </hws>
1294 </dc:elements>
1295 </Graben>
1296 </dc:macro>
1297
1298 <dc:macro name="hwslines">
1299 <hws_lines>
1300 <official>
1301 <dc:context>
1302 <dc:statement>
1303 SELECT DISTINCT
1304 fs.name AS fed_name,
1305 fs.id AS fed_id
1306 FROM hws_lines hws
1307 JOIN fed_states fs ON hws.fed_state_id = fs.id
1308 WHERE river_id = ${river_id}
1309 AND hws.official=1
1310 </dc:statement>
1311 <dc:elements>
1312 <dc:context>
1313 <dc:statement>
1314 SELECT DISTINCT
1315 name AS hws_name,
1316 kind_id AS hws_kind
1317 FROM hws_lines
1318 WHERE river_id = ${river_id}
1319 AND official=1
1320 AND fed_state_id = ${fed_id} ORDER BY name
1321 </dc:statement>
1322 <fedstate>
1323 <dc:attribute name="description" value="${fed_name}"/>
1324 <dc:call-macro name="hwslines_by_kind"/>
1325 </fedstate>
1326 </dc:context>
1327 </dc:elements>
1328 </dc:context>
1329 <dc:context>
1330 <dc:statement>
1331 SELECT distinct
1332 name AS hws_name,
1333 kind_id AS hws_kind
1334 FROM hws_lines
1335 WHERE river_id = ${river_id}
1336 AND official=1
1337 AND fed_state_id IS NULL
1338 ORDER BY name
1339 </dc:statement>
1340 <hws_fed_unknown>
1341 <dc:call-macro name="hwslines_by_kind"/>
1342 </hws_fed_unknown>
1343 </dc:context>
1344 </official>
1345 <inofficial>
1346 <dc:context>
1347 <dc:statement>
1348 SELECT DISTINCT
1349 fs.name AS fed_name,
1350 fs.id AS fed_id
1351 FROM hws_lines hws
1352 JOIN fed_states fs ON hws.fed_state_id = fs.id
1353 WHERE river_id = ${river_id}
1354 AND hws.official=0
1355 </dc:statement>
1356 <dc:elements>
1357 <dc:context>
1358 <dc:statement>
1359 SELECT DISTINCT
1360 name AS hws_name,
1361 kind_id AS hws_kind
1362 FROM hws_lines
1363 WHERE river_id = ${river_id}
1364 AND official=0
1365 AND fed_state_id = ${fed_id} ORDER BY name
1366 </dc:statement>
1367 <fedstate>
1368 <dc:attribute name="description" value="${fed_name}"/>
1369 <dc:call-macro name="hwslines_by_kind"/>
1370 </fedstate>
1371 </dc:context>
1372 </dc:elements>
1373 </dc:context>
1374 <dc:context>
1375 <dc:statement>
1376 SELECT distinct
1377 name AS hws_name,
1378 kind_id AS hws_kind
1379 FROM hws_lines
1380 WHERE river_id = ${river_id}
1381 AND official=0
1382 AND fed_state_id IS NULL ORDER BY name
1383 </dc:statement>
1384 <hws_fed_unknown>
1385 <dc:call-macro name="hwslines_by_kind"/>
1386 </hws_fed_unknown>
1387 </dc:context>
1388 </inofficial>
1389 </hws_lines>
1390 </dc:macro>
1391
1392 <dc:macro name="hwspoints_by_kind">
1393 <dc:comment>
1394 Call from a context where fed_name hws_kind hws_name and river_id is
1395 availble
1396 </dc:comment>
1397 <Durchlass>
1398 <dc:elements filter="$hws_kind=1">
1399 <hws>
1400 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1401 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1402 <dc:attribute name="name" value="${hws_name}"/>
1403 </hws>
1404 </dc:elements>
1405 </Durchlass>
1406 <Damm>
1407 <dc:elements filter="$hws_kind=2">
1408 <hws>
1409 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1410 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1411 <dc:attribute name="name" value="${hws_name}"/>
1412 </hws>
1413 </dc:elements>
1414 </Damm>
1415 <Graben>
1416 <dc:elements filter="$hws_kind=3">
1417 <hws>
1418 <dc:attribute name="factory" value="wmshwspointsfactory"/>
1419 <dc:attribute name="ids" value="${river_id};${hws_name}"/>
1420 <dc:attribute name="name" value="${hws_name}"/>
1421 </hws>
1422 </dc:elements>
1423 </Graben>
1424 </dc:macro>
1425
1426 <dc:macro name="hwspoints">
1427 <hws_points>
1428 <official>
1429 <dc:context>
1430 <dc:statement>
1431 SELECT DISTINCT
1432 fs.name AS fed_name,
1433 fs.id AS fed_id
1434 FROM hws_points hws
1435 JOIN fed_states fs ON hws.fed_state_id = fs.id
1436 WHERE river_id = ${river_id}
1437 AND hws.official=1
1438 </dc:statement>
1439 <dc:elements>
1440 <dc:context>
1441 <dc:statement>
1442 SELECT DISTINCT
1443 name AS hws_name,
1444 kind_id AS hws_kind
1445 FROM hws_points
1446 WHERE river_id = ${river_id}
1447 AND official=1
1448 AND fed_state_id = ${fed_id} ORDER BY name
1449 </dc:statement>
1450 <fedstate>
1451 <dc:attribute name="description" value="${fed_name}"/>
1452 <dc:call-macro name="hwspoints_by_kind"/>
1453 </fedstate>
1454 </dc:context>
1455 </dc:elements>
1456 </dc:context>
1457 <dc:context>
1458 <dc:statement>
1459 SELECT distinct
1460 name AS hws_name,
1461 kind_id AS hws_kind
1462 FROM hws_points
1463 WHERE river_id = ${river_id}
1464 AND official=1
1465 AND fed_state_id IS NULL
1466 ORDER BY name
1467 </dc:statement>
1468 <hws_fed_unknown>
1469 <dc:call-macro name="hwspoints_by_kind"/>
1470 </hws_fed_unknown>
1471 </dc:context>
1472 </official>
1473 <inofficial>
1474 <dc:context>
1475 <dc:statement>
1476 SELECT DISTINCT
1477 fs.name AS fed_name,
1478 fs.id AS fed_id
1479 FROM hws_points hws
1480 JOIN fed_states fs ON hws.fed_state_id = fs.id
1481 WHERE river_id = ${river_id}
1482 AND hws.official=0
1483 </dc:statement>
1484 <dc:elements>
1485 <dc:context>
1486 <dc:statement>
1487 SELECT DISTINCT
1488 name AS hws_name,
1489 kind_id AS hws_kind
1490 FROM hws_points
1491 WHERE river_id = ${river_id}
1492 AND official=0
1493 AND fed_state_id = ${fed_id} ORDER BY name
1494 </dc:statement>
1495 <fedstate>
1496 <dc:attribute name="description" value="${fed_name}"/>
1497 <dc:call-macro name="hwspoints_by_kind"/>
1498 </fedstate>
1499 </dc:context>
1500 </dc:elements>
1501 </dc:context>
1502 <dc:context>
1503 <dc:statement>
1504 SELECT distinct
1505 name AS hws_name,
1506 kind_id AS hws_kind
1507 FROM hws_points
1508 WHERE river_id = ${river_id}
1509 AND official=0
1510 AND fed_state_id IS NULL ORDER BY name
1511 </dc:statement>
1512 <hws_fed_unknown>
1513 <dc:call-macro name="hwspoints_by_kind"/>
1514 </hws_fed_unknown>
1515 </dc:context>
1516 </inofficial>
1517 </hws_points>
1518 </dc:macro>
1519
1520
1521 <dc:macro name="flood-map-buildings">
1522 <dc:context>
1523 <dc:statement>
1524 SELECT DISTINCT
1525 b.kind_id AS building_kind_id,
1526 bk.name AS building_kind
1527 FROM buildings b
1528 JOIN building_kinds bk ON b.kind_id = bk.id
1529 WHERE river_id = ${river_id}
1530 </dc:statement>
1531 <dc:elements>
1532 <buildings>
1533 <dc:attribute name="description" value="${building_kind}"/>
1534 <dc:attribute name="factory" value="wmsbuildingsfactory"/>
1535 <dc:attribute name="ids" value="${river_id};${building_kind};${building_kind_id}"/>
1536 </buildings>
1537 </dc:elements>
1538 </dc:context>
1539 </dc:macro>
1540 <dc:macro name="flood-map-fixpoints">
1541 <dc:context>
1542 <dc:statement>
1543 SELECT count(*) as km_exists, name as name
1544 FROM fixpoints WHERE river_id = ${river_id} GROUP BY name
1545 </dc:statement>
1546 <dc:elements>
1547 <dc:if test="$km_exists>0">
1548 <fixpoint>
1549 <dc:attribute name="factory" value="wmsfixpointsfactory"/>
1550 <dc:attribute name="ids" value="${river_id};${name}"/>
1551 <dc:attribute name="name" value="${name}"/>
1552 </fixpoint>
1553 </dc:if>
1554 </dc:elements>
1555 </dc:context>
1556 </dc:macro>
1557 <dc:macro name="flood-map-gaugelocations">
1558 <dc:context>
1559 <dc:statement>
1560 SELECT count(*) as km_exists, name as name
1561 FROM gauge_location WHERE river_id = ${river_id} GROUP BY name
1562 </dc:statement>
1563 <dc:elements>
1564 <dc:if test="$km_exists>0">
1565 <gaugelocation>
1566 <dc:attribute name="factory" value="wmsgaugelocationfactory"/>
1567 <dc:attribute name="ids" value="${river_id};${name}"/>
1568 <dc:attribute name="name" value="${name}"/>
1569 </gaugelocation>
1570 </dc:if>
1571 </dc:elements>
1572 </dc:context>
1573 </dc:macro>
1574 <dc:macro name="flood-map-uesk">
1575 <uesk>
1576 <calculations>
1577 <current>
1578 <bfg>
1579 <dc:context>
1580 <dc:statement>
1581 SELECT count(*) as uesg_exist, name as name
1582 FROM floodmaps
1583 WHERE river_id = ${river_id} AND kind = 111
1584 GROUP BY name, kind
1585 </dc:statement>
1586 <dc:elements>
1587 <dc:if test="$uesg_exist>0">
1588 <floodmaps>
1589 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1590 <dc:attribute name="ids" value="${river_id};${name}"/>
1591 <dc:attribute name="name" value="${name}"/>
1592 </floodmaps>
1593 </dc:if>
1594 </dc:elements>
1595 </dc:context>
1596 </bfg>
1597 <land>
1598 <dc:context>
1599 <dc:statement>
1600 SELECT count(*) as uesg_exist, name as name
1601 FROM floodmaps
1602 WHERE river_id = ${river_id} AND kind = 112
1603 GROUP BY name, kind
1604 </dc:statement>
1605 <dc:elements>
1606 <dc:if test="$uesg_exist>0">
1607 <floodmaps>
1608 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1609 <dc:attribute name="ids" value="${river_id};${name}"/>
1610 <dc:attribute name="name" value="${name}"/>
1611 </floodmaps>
1612 </dc:if>
1613 </dc:elements>
1614 </dc:context>
1615 </land>
1616 </current>
1617 <potentiel>
1618 <bfg>
1619 <dc:context>
1620 <dc:statement>
1621 SELECT count(*) as uesg_exist, name as name
1622 FROM floodmaps
1623 WHERE river_id = ${river_id} AND kind = 121
1624 GROUP BY name, kind
1625 </dc:statement>
1626 <dc:elements>
1627 <dc:if test="$uesg_exist>0">
1628 <floodmaps>
1629 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1630 <dc:attribute name="ids" value="${river_id};${name}"/>
1631 <dc:attribute name="name" value="${name}"/>
1632 </floodmaps>
1633 </dc:if>
1634 </dc:elements>
1635 </dc:context>
1636 </bfg>
1637 <land>
1638 <dc:context>
1639 <dc:statement>
1640 SELECT count(*) as uesg_exist, name as name
1641 FROM floodmaps
1642 WHERE river_id = ${river_id} AND kind = 122
1643 GROUP BY name, kind
1644 </dc:statement>
1645 <dc:elements>
1646 <dc:if test="$uesg_exist>0">
1647 <floodmaps>
1648 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1649 <dc:attribute name="ids" value="${river_id};${name}"/>
1650 <dc:attribute name="name" value="${name}"/>
1651 </floodmaps>
1652 </dc:if>
1653 </dc:elements>
1654 </dc:context>
1655 </land>
1656 </potentiel>
1657 </calculations>
1658 </uesk>
1659 </dc:macro>
1660 <dc:macro name="flood-map-complete">
1661 <buildings>
1662 <dc:call-macro name="flood-map-buildings"/>
1663 </buildings>
1664 <catchments>
1665 <dc:call-macro name="flood-map-catchments"/>
1666 </catchments>
1667 <fixpoints>
1668 <dc:call-macro name="flood-map-fixpoints"/>
1669 </fixpoints>
1670 <hydrboundaries>
1671 <dc:call-macro name="flood-map-hydr-boundaries"/>
1672 <dc:call-macro name="flood-map-floodplain"/>
1673 </hydrboundaries>
1674 <kilometrage>
1675 <riveraxis>
1676 <dc:attribute name="factory" value="riveraxis"/>
1677 <dc:attribute name="ids" value="${river_id}"/>
1678 </riveraxis>
1679 <dc:call-macro name="flood-map-km"/>
1680 <dc:call-macro name="flood-map-qps"/>
1681 </kilometrage>
1682 <hws>
1683 <dc:call-macro name="hwslines"/>
1684 <dc:call-macro name="hwspoints"/>
1685 </hws>
1686 <dc:call-macro name="flood-map-uesk"/>
1687 <gaugelocations>
1688 <dc:call-macro name="flood-map-gaugelocations"/>
1689 </gaugelocations>
1690 <rastermap>
1691 <background>
1692 <dc:attribute name="factory" value="wmsbackground"/>
1693 <dc:attribute name="ids" value="${river_id}"/>
1694 </background>
1695 </rastermap>
1559 </dc:macro> 1696 </dc:macro>
1560 <dc:macro name="flood-map-gaugelocations"> 1697 </dc:if>
1561 <dc:context> 1698 <dc:if test="dc:contains($artifact-outs, 'minfo-heights')">
1562 <dc:statement> 1699 <dc:call-macro name="minfo-heights"/>
1563 SELECT count(*) as km_exists, name as name 1700 <dc:macro name="minfo-heights">
1564 FROM gauge_location WHERE river_id = ${river_id} GROUP BY name
1565 </dc:statement>
1566 <dc:elements>
1567 <dc:if test="$km_exists>0">
1568 <gaugelocation>
1569 <dc:attribute name="factory" value="wmsgaugelocationfactory"/>
1570 <dc:attribute name="ids" value="${river_id};${name}"/>
1571 <dc:attribute name="name" value="${name}"/>
1572 </gaugelocation>
1573 </dc:if>
1574 </dc:elements>
1575 </dc:context>
1576 </dc:macro>
1577 <dc:macro name="flood-map-uesk">
1578 <uesk>
1579 <calculations>
1580 <current>
1581 <bfg>
1582 <dc:context>
1583 <dc:statement>
1584 SELECT count(*) as uesg_exist, name as name
1585 FROM floodmaps
1586 WHERE river_id = ${river_id} AND kind = 111
1587 GROUP BY name, kind
1588 </dc:statement>
1589 <dc:elements>
1590 <dc:if test="$uesg_exist>0">
1591 <floodmaps>
1592 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1593 <dc:attribute name="ids" value="${river_id};${name}"/>
1594 <dc:attribute name="name" value="${name}"/>
1595 </floodmaps>
1596 </dc:if>
1597 </dc:elements>
1598 </dc:context>
1599 </bfg>
1600 <land>
1601 <dc:context>
1602 <dc:statement>
1603 SELECT count(*) as uesg_exist, name as name
1604 FROM floodmaps
1605 WHERE river_id = ${river_id} AND kind = 112
1606 GROUP BY name, kind
1607 </dc:statement>
1608 <dc:elements>
1609 <dc:if test="$uesg_exist>0">
1610 <floodmaps>
1611 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1612 <dc:attribute name="ids" value="${river_id};${name}"/>
1613 <dc:attribute name="name" value="${name}"/>
1614 </floodmaps>
1615 </dc:if>
1616 </dc:elements>
1617 </dc:context>
1618 </land>
1619 </current>
1620 <potentiel>
1621 <bfg>
1622 <dc:context>
1623 <dc:statement>
1624 SELECT count(*) as uesg_exist, name as name
1625 FROM floodmaps
1626 WHERE river_id = ${river_id} AND kind = 121
1627 GROUP BY name, kind
1628 </dc:statement>
1629 <dc:elements>
1630 <dc:if test="$uesg_exist>0">
1631 <floodmaps>
1632 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1633 <dc:attribute name="ids" value="${river_id};${name}"/>
1634 <dc:attribute name="name" value="${name}"/>
1635 </floodmaps>
1636 </dc:if>
1637 </dc:elements>
1638 </dc:context>
1639 </bfg>
1640 <land>
1641 <dc:context>
1642 <dc:statement>
1643 SELECT count(*) as uesg_exist, name as name
1644 FROM floodmaps
1645 WHERE river_id = ${river_id} AND kind = 122
1646 GROUP BY name, kind
1647 </dc:statement>
1648 <dc:elements>
1649 <dc:if test="$uesg_exist>0">
1650 <floodmaps>
1651 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
1652 <dc:attribute name="ids" value="${river_id};${name}"/>
1653 <dc:attribute name="name" value="${name}"/>
1654 </floodmaps>
1655 </dc:if>
1656 </dc:elements>
1657 </dc:context>
1658 </land>
1659 </potentiel>
1660 </calculations>
1661 </uesk>
1662 </dc:macro>
1663 <dc:macro name="flood-map-complete">
1664 <buildings>
1665 <dc:call-macro name="flood-map-buildings"/>
1666 </buildings>
1667 <catchments>
1668 <dc:call-macro name="flood-map-catchments"/>
1669 </catchments>
1670 <fixpoints>
1671 <dc:call-macro name="flood-map-fixpoints"/>
1672 </fixpoints>
1673 <hydrboundaries>
1674 <dc:call-macro name="flood-map-hydr-boundaries"/>
1675 <dc:call-macro name="flood-map-floodplain"/>
1676 </hydrboundaries>
1677 <kilometrage>
1678 <riveraxis>
1679 <dc:attribute name="factory" value="riveraxis"/>
1680 <dc:attribute name="ids" value="${river_id}"/>
1681 </riveraxis>
1682 <dc:call-macro name="flood-map-km"/>
1683 <dc:call-macro name="flood-map-qps"/>
1684 </kilometrage>
1685 <hws>
1686 <dc:call-macro name="hwslines"/>
1687 <dc:call-macro name="hwspoints"/>
1688 </hws>
1689 <dc:call-macro name="flood-map-uesk"/>
1690 <gaugelocations>
1691 <dc:call-macro name="flood-map-gaugelocations"/>
1692 </gaugelocations>
1693 <rastermap>
1694 <background>
1695 <dc:attribute name="factory" value="wmsbackground"/>
1696 <dc:attribute name="ids" value="${river_id}"/>
1697 </background>
1698 </rastermap>
1699 </dc:macro>
1700 </dc:if>
1701 <dc:if test="dc:contains($artifact-outs, 'minfo-heights')">
1702 <dc:call-macro name="minfo-heights"/>
1703 <dc:macro name="minfo-heights">
1704 <bedheights>
1705 <dc:call-macro name="bed-heights-single"/>
1706 <dc:call-macro name="bed-heights-epoch"/>
1707 </bedheights>
1708 </dc:macro>
1709 </dc:if>
1710 <dc:if test="dc:contains($artifact-outs, 'minfo-heights-epoch')">
1711 <bedheights> 1701 <bedheights>
1702 <dc:call-macro name="bed-heights-single"/>
1712 <dc:call-macro name="bed-heights-epoch"/> 1703 <dc:call-macro name="bed-heights-epoch"/>
1713 </bedheights> 1704 </bedheights>
1714 </dc:if>
1715 <dc:macro name="bed-heights-single">
1716 <single>
1717 <dc:context>
1718 <dc:statement>
1719 SELECT id AS bedh_id,
1720 year AS bedh_year,
1721 description AS bedh_descr
1722 FROM bed_height_single WHERE river_id = ${river_id}
1723 </dc:statement>
1724 <dc:elements>
1725 <height>
1726 <dc:attribute name="factory" value="bedheight"/>
1727 <dc:attribute name="ids" value="bedheight-single-${bedh_id}-${bedh_year}"/>
1728 <dc:attribute name="description" value="${bedh_descr}"/>
1729 </height>
1730 </dc:elements>
1731 </dc:context>
1732 </single>
1733 </dc:macro> 1705 </dc:macro>
1734 <dc:macro name="bed-heights-epoch"> 1706 </dc:if>
1735 <epoch> 1707 <dc:if test="dc:contains($artifact-outs, 'minfo-heights-epoch')">
1736 <dc:context> 1708 <bedheights>
1737 <dc:statement> 1709 <dc:call-macro name="bed-heights-epoch"/>
1738 SELECT id AS bedh_id, 1710 </bedheights>
1739 time_interval_id AS bedh_interval_id, 1711 </dc:if>
1740 description AS bedh_descr 1712 <dc:macro name="bed-heights-single">
1741 FROM bed_height_epoch WHERE river_id = ${river_id} 1713 <single>
1742 </dc:statement> 1714 <dc:context>
1743 <dc:elements> 1715 <dc:statement>
1744 <height> 1716 SELECT id AS bedh_id,
1745 <dc:attribute name="factory" value="bedheight"/> 1717 year AS bedh_year,
1746 <dc:attribute name="ids" value="bedheight-epoch-${bedh_id}-${bedh_interval_id}"/> 1718 description AS bedh_descr
1747 <dc:attribute name="description" value="${bedh_descr}"/> 1719 FROM bed_height_single WHERE river_id = ${river_id}
1748 </height> 1720 </dc:statement>
1749 </dc:elements> 1721 <dc:elements>
1750 </dc:context> 1722 <height>
1751 </epoch> 1723 <dc:attribute name="factory" value="bedheight"/>
1752 </dc:macro> 1724 <dc:attribute name="ids" value="bedheight-single-${bedh_id}-${bedh_year}"/>
1753 </river> 1725 <dc:attribute name="description" value="${bedh_descr}"/>
1726 </height>
1727 </dc:elements>
1728 </dc:context>
1729 </single>
1730 </dc:macro>
1731 <dc:macro name="bed-heights-epoch">
1732 <epoch>
1733 <dc:context>
1734 <dc:statement>
1735 SELECT id AS bedh_id,
1736 time_interval_id AS bedh_interval_id,
1737 description AS bedh_descr
1738 FROM bed_height_epoch WHERE river_id = ${river_id}
1739 </dc:statement>
1740 <dc:elements>
1741 <height>
1742 <dc:attribute name="factory" value="bedheight"/>
1743 <dc:attribute name="ids" value="bedheight-epoch-${bedh_id}-${bedh_interval_id}"/>
1744 <dc:attribute name="description" value="${bedh_descr}"/>
1745 </height>
1746 </dc:elements>
1747 </dc:context>
1748 </epoch>
1749 </dc:macro>
1754 </dc:elements> 1750 </dc:elements>
1755 </dc:context> 1751 </dc:context>
1756 </dc:macro> 1752 </dc:macro>
1757 1753
1758 <dc:choose> 1754 <dc:choose>

http://dive4elements.wald.intevation.org