comparison artifacts/doc/conf/meta-data.xml @ 7961:598e4bec920b

New macros for bed height differneces.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 20 Jun 2014 16:33:09 +0200
parents a4764ab23eef
children 7f1143972f16
comparison
equal deleted inserted replaced
7959:8e320b5933de 7961:598e4bec920b
130 Non - Recommendations (offered to user to choose additional data from). 130 Non - Recommendations (offered to user to choose additional data from).
131 </dc:comment> 131 </dc:comment>
132 <dc:iterate var="out" container="artifact-outs"> 132 <dc:iterate var="out" container="artifact-outs">
133 <dc:message>Non Rec out iteration for: {$out}</dc:message> 133 <dc:message>Non Rec out iteration for: {$out}</dc:message>
134 <dc:choose> 134 <dc:choose>
135 <dc:when test="$out = 'minfo-heights-diff'">
136 <dc:call-macro name="minfo-heights-diff"/>
137 </dc:when>
135 <dc:when test="$out = 'cross_section'"> 138 <dc:when test="$out = 'cross_section'">
136 <dc:call-macro name="basedata_0"/> 139 <dc:call-macro name="basedata_0"/>
137 <dc:call-macro name="basedata_1_additionals"/> 140 <dc:call-macro name="basedata_1_additionals"/>
138 <dc:call-macro name="basedata_2_fixations"/> 141 <dc:call-macro name="basedata_2_fixations"/>
139 <dc:call-macro name="basedata_3_officials"/> 142 <dc:call-macro name="basedata_3_officials"/>
1716 <rastermap> 1719 <rastermap>
1717 <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" /> 1720 <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" />
1718 </rastermap> 1721 </rastermap>
1719 </dc:macro> 1722 </dc:macro>
1720 1723
1724 <dc:macro name="minfo-heights-diff">
1725 <dc:message>blablub</dc:message>
1726 <dc:call-macro name="minfo-heights-years">
1727 <dc:context>
1728 <dc:statement>
1729 WITH sta
1730 AS (SELECT bhs.id,
1731 bhs.description,
1732 bhsv.station,
1733 bhs.year
1734 FROM bed_height_single bhs
1735 JOIN bed_height_single_values bhsv
1736 ON bhsv.bed_height_single_id = bhs.id
1737 WHERE bhs.river_id = ${river_id}
1738 AND bhs.year BETWEEN ${year_from} AND ${year_to}),
1739 csta
1740 AS (SELECT b1.id AS id1,
1741 b1.description AS b1desc,
1742 b1.year AS b1year,
1743 b2.id AS id2,
1744 b2.description AS b2desv,
1745 b2.year AS b2year
1746 FROM sta b1
1747 JOIN sta b2
1748 ON b1.station = b2.station
1749 AND b1.id &lt; b2.id)
1750 SELECT id1, b1desc, b1year,
1751 id2, b2desc, b2year
1752 FROM csta
1753 </dc:statement>
1754 <dc:if test="dc:has-result()">
1755 <bedheights>
1756 <dc:call-macro name="bed-heights-single-diff"/>
1757 <dc:call-macro name="bed-heights-epoch-diff"/>
1758 </bedheights>
1759 </dc:if>
1760 </dc:context>
1761 </dc:call-macro>
1762 </dc:macro>
1763
1764 <dc:macro name="bed-heights-single-diff">
1765 <dc:filter expr="not(contains(lower-case($b1desc), 'epoche') or contains(lower-case($b2desc), 'epoche'))">
1766 <years>
1767 <dc:call-macro name="bed-heights-diff-tree"/>
1768 </years>
1769 </dc:filter>
1770 </dc:macro>
1771
1772 <dc:macro name="bed-heights-epoch-diff">
1773 <dc:filter expr="contains(lower-case($b1desc), 'epoche') and contains(lower-case($b2desc), 'epoche')">
1774 <epochs>
1775 <dc:call-macro name="bed-heights-diff-tree"/>
1776 </epochs>
1777 </dc:filter>
1778 </dc:macro>
1779
1780 <dc:macro name="minfo-heights-diff-tree">
1781 <dc:comment>TODO: We need to group for year1 and year2</dc:comment>
1782 <dc:group expr="$b1year">
1783 <dc:element name="${dc:group-key()}">
1784 <dc:comment>TODO: Better structure</dc:comment>
1785 <dc:for-each>
1786 <dc:comment>A - B</dc:comment>
1787 <height factory="bedheight"
1788 target_out="{$out}"
1789 ids="bedheight-single-{$b1id}-{$b2id}"
1790 description="{$b1desc} - {$b2desc}"/>
1791 </dc:for-each>
1792 <dc:for-each>
1793 <dc:comment>B - A</dc:comment>
1794 <height factory="bedheight"
1795 target_out="{$out}"
1796 ids="bedheight-single-{$b2id}-{$b1id}"
1797 description="{$b2desc} - {$b1desc}"/>
1798 </dc:for-each>
1799 </dc:element>
1800 </dc:group>
1801 <dc:group expr="$b2year">
1802 <dc:element name="${dc:group-key()}">
1803 <dc:comment>TODO: Better structure</dc:comment>
1804 <dc:for-each>
1805 <dc:comment>A - B</dc:comment>
1806 <height factory="bedheight"
1807 target_out="{$out}"
1808 ids="bedheight-single-{$b1id}-{$b2id}"
1809 description="{$b1desc} - {$b2desc}"/>
1810 </dc:for-each>
1811 <dc:for-each>
1812 <dc:comment>B - A</dc:comment>
1813 <height factory="bedheight"
1814 target_out="{$out}"
1815 ids="bedheight-single-{$b2id}-{$b1id}"
1816 description="{$b2desc} - {$b1desc}"/>
1817 </dc:for-each>
1818 </dc:element>
1819 </dc:group>
1820 </dc:macro>
1821
1721 <dc:macro name="minfo-heights"> 1822 <dc:macro name="minfo-heights">
1722 <dc:call-macro name="minfo-heights-years"> 1823 <dc:call-macro name="minfo-heights-years">
1723 <bedheights> 1824 <bedheights>
1724 <dc:call-macro name="bed-heights-single"/> 1825 <dc:call-macro name="bed-heights-single"/>
1725 <dc:call-macro name="bed-heights-epoch"/> 1826 <dc:call-macro name="bed-heights-epoch"/>

http://dive4elements.wald.intevation.org