[PATCH 4 of 4] Configured 'year' attributes on bed heights,certain waterlevels and fixation results; this is used in the intelligent datacage selection for waterlevels-soundings

Wald Commits scm-commit at wald.intevation.org
Fri Jul 6 13:10:40 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1530875431 -7200
# Node ID 03427b89ba62a812af8867410674c17b454f3755
# Parent  5030c46d8cb4d9efac16388df7bbc55944263d81
Configured 'year' attributes on bed heights,certain waterlevels and fixation results; this is used in the intelligent datacage selection for waterlevels-soundings

diff -r 5030c46d8cb4 -r 03427b89ba62 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Fri Jul 06 13:09:54 2018 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Jul 06 13:10:31 2018 +0200
@@ -646,6 +646,9 @@
                   <dc:attribute name="target_out" value="${out}" />
                   <dc:attribute name="artifact-id" value="${a_gid}" />
                   <dc:attribute name="out" value="longitudinal_section" />
+
+                  <dc:variable name="fixAnalysisYear" expr="dc:fix_analysis_year($a_gid)" />
+                  <dc:attribute name="year" value="${fixAnalysisYear}" />
                 </dc:element>
               </dc:for-each>
             </waterlevels>
@@ -1308,7 +1311,7 @@
         <dc:if test="dc:has-result()">
           <additionals>
             <dc:group expr="dc:replace($wst_description, 'Zus.Längsschnitte/', '')">
-              <additional name="{dc:group-key()}">
+              <additional name="{dc:group-key()}" description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:macro-body />
                 </dc:for-each>
@@ -1330,7 +1333,7 @@
         <dc:if test="dc:has-result()">
           <sinfo_additional_ls_withQ>
             <dc:group expr="dc:replace($wst_description, 'Zus.Längsschnitte/', '')">
-              <additional name="{dc:group-key()}">
+              <additional name="{dc:group-key()}" description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:macro-body />
                 </dc:for-each>
@@ -1343,7 +1346,7 @@
 
     <dc:macro name="basedata_1_additionals-sinfo-with-q">
       <dc:call-macro name="basedata_1_additionals-sinfo-with-q_macro">
-        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
+        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" year="{dc:date-format('yyyy', $start_time)}" />
       </dc:call-macro>
     </dc:macro>
 
@@ -1352,7 +1355,7 @@
         <dc:if test="dc:has-result()">
           <sinfo_additional_ls_withoutQ>
             <dc:group expr="dc:replace($wst_description, 'Zus.Längsschnitte/', '')">
-              <additional name="{dc:group-key()}">
+              <additional name="{dc:group-key()}" description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:macro-body />
                 </dc:for-each>
@@ -1365,7 +1368,8 @@
 
     <dc:macro name="basedata_1_additionals-sinfo-without-q">
       <dc:call-macro name="basedata_1_additionals-sinfo-without-q_macro">
-        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
+        <dc:variable name="start_year" expr="dc:date-format('yyyy', $start_time)" />
+        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" year="{dc:date-format('yyyy', $start_time)}" />
       </dc:call-macro>
     </dc:macro>
 
@@ -1400,7 +1404,8 @@
 
     <dc:macro name="basedata_2_fixations">
       <dc:call-macro name="fixings-macro">
-        <column name="{$wst_column_name}" ids="fixations-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
+        <dc:variable name="start_year" expr="dc:date-format('yyyy', $start_time)" />
+        <column name="{$wst_column_name}" ids="fixations-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" year="{dc:date-format('yyyy', $start_time)}" />
       </dc:call-macro>
     </dc:macro>
 
@@ -1435,7 +1440,8 @@
 
     <dc:macro name="basedata_3_officials">
       <dc:call-macro name="basedata_3_macro">
-        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
+        <dc:variable name="start_year" expr="dc:date-format('yyyy', $start_time)" />      
+        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" year="{dc:date-format('yyyy', $start_time)}" />
       </dc:call-macro>
     </dc:macro>
 
@@ -1523,7 +1529,7 @@
             <delta_w_cm>
               <dc:filter expr="contains($wst_description, 'cm.csv')">
                 <dc:group expr="dc:replace($wst_description, 'CSV/', '')">
-                  <relativepoint name="{dc:group-key()}">
+                  <relativepoint name="{dc:group-key()}" description="{dc:group-key()}">
                     <dc:for-each>
                       <column name="{$wst_column_name}" ids="delta_w-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
                     </dc:for-each>
@@ -1534,7 +1540,7 @@
             <delta_w_cma>
               <dc:filter expr="contains($wst_description, 'cm-a.csv')">
                 <dc:group expr="dc:replace($wst_description, 'CSV/', '')">
-                  <relativepoint name="{dc:group-key()}">
+                  <relativepoint name="{dc:group-key()}" description="{dc:group-key()}">
                     <dc:for-each>
                       <column name="{$wst_column_name}" ids="delta_w_cma-wstv-{$wst_column_position}-{$wst_id}" factory="staticwkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
                     </dc:for-each>
@@ -1553,7 +1559,7 @@
         <dc:if test="dc:has-result()">
           <wlevel>
             <dc:group expr="dc:replace($wst_description, 'CSV/', '')">
-              <relativepoint name="{dc:group-key()}">
+              <relativepoint name="{dc:group-key()}" description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:macro-body />
                 </dc:for-each>
@@ -1566,7 +1572,8 @@
 
     <dc:macro name="basedata_7_waterlevels">
       <dc:call-macro name="basedata_7_macro">
-        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" />
+        <dc:variable name="start_year" expr="dc:date-format('yyyy', $start_time)" />      
+        <column name="{$wst_column_name}" ids="additionals-wstv-{$wst_column_position}-{$wst_id}" factory="staticwqkms" target_out="{$out}" info="{$info} [km {$deffrom} - {$defto}]" year="{dc:date-format('yyyy', $start_time)}" />
       </dc:call-macro>
     </dc:macro>
 
@@ -2054,7 +2061,8 @@
     <dc:macro name="bed-heights-factory_MW">
       <dc:for-each>
         <dc:if test="$bedh_height_count > 0">
-          <height factory="bedheight" target_out="{$out}" ids="bedheight-single-{$bedh_id}-{$bedh_year}-{$bedh_descr}" info="{$info}" description="{$bedh_descr}" />
+          <!-- REMARK: addition 'yaer' attribute is used by intelligent datacage filter of SINFO -->
+          <height factory="bedheight" target_out="{$out}" ids="bedheight-single-{$bedh_id}-{$bedh_year}-{$bedh_descr}" info="{$info}" description="{$bedh_descr}" year="{$bedh_year}" />
         </dc:if>
       </dc:for-each>
     </dc:macro>
@@ -2062,10 +2070,10 @@
     <dc:macro name="bed-heights-single">
       <single>
         <dc:context>
-          <dc:call-macro name="bed-heights-statement" />
+          <dc:call-macro name="bed-heights-statement" />  
           <dc:if test="dc:has-result()">
             <dc:group expr="dc:coalesce($bedh_year, 'sonstige')">
-              <heights name="{dc:group-key()}">
+              <heights name="{dc:group-key()}" description="{dc:group-key()}">
                 <dc:call-macro name="bed-heights-factory_MW_TW_KL" />
               </heights>
             </dc:group>
@@ -2082,7 +2090,7 @@
           <dc:filter expr="$bedh_height_count">
             <dc:if test="dc:has-result()">
               <dc:group expr="dc:coalesce($bedh_year, 'sonstige')">
-                <heights name="{dc:group-key()}">
+                <heights name="{dc:group-key()}" description="{dc:group-key()}">
                   <dc:call-macro name="bed-heights-factory_MW" />
                 </heights>
               </dc:group>
@@ -2100,7 +2108,7 @@
           <dc:filter expr="$bedh_max_count > 0 and $bedh_min_count > 0">
             <dc:if test="dc:has-result()">
               <dc:group expr="dc:coalesce($bedh_year, 'sonstige')">
-                <heights name="{dc:group-key()}">
+                <heights name="{dc:group-key()}" description="{dc:group-key()}">
                   <dc:call-macro name="bed-heights-factory_MW" />
                 </heights>
               </dc:group>
@@ -3194,7 +3202,6 @@
 
 
     <!-- Common stuff -->
-
     <dc:macro name="km-filtered-wsts">
       <dc:context connection="system">
         <dc:statement>
@@ -3204,6 +3211,8 @@
           wc.position AS wst_column_position,
           wc.description AS info,
           w.description AS wst_description,
+          ti.start_time AS start_time,
+          ti.stop_time AS stop_time,
           COALESCE(wc.name, '') AS wst_column_name,
           wr.a AS deffrom,
           wr.b AS defto,
@@ -3211,6 +3220,7 @@
           FROM wst_columns wc
           JOIN wsts w ON wc.wst_id = w.id
           JOIN wst_ranges wr ON wc.id = wr.wst_column_id
+          LEFT JOIN time_intervals ti ON wc.time_interval_id = ti.id          
           WHERE w.river_id = ${river_id} AND
           NOT((${tokm} < wr.a) or (${fromkm} > wr.b))
           ORDER BY wst_column_position


More information about the Dive4Elements-commits mailing list