[PATCH] Do not filter bed heights by year in datacage for optional data (plus some cleanup)

Wald Commits scm-commit at wald.intevation.org
Fri Oct 17 11:44:07 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1413539041 -7200
# Node ID d7d74392cc46076d279840c0e6bf2a895e5c3d27
# Parent  536a1c0c8a81192ddbf180e406c5a8ed364a62ae
Do not filter bed heights by year in datacage for optional data (plus some cleanup).

diff -r 536a1c0c8a81 -r d7d74392cc46 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Thu Oct 16 16:45:53 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Oct 17 11:44:01 2014 +0200
@@ -1796,6 +1796,7 @@
       </rastermap>
     </dc:macro>
 
+    <!-- bed heights -->
     <dc:macro name="minfo-heights-diff">
       <dc:call-macro name="minfo-heights-years">
         <dc:context>
@@ -1881,15 +1882,6 @@
       </dc:group>
     </dc:macro>
 
-    <dc:macro name="minfo-heights">
-      <dc:call-macro name="minfo-heights-years">
-        <bedheights>
-          <dc:call-macro name="bed-heights-single"/>
-          <dc:call-macro name="bed-heights-epoch"/>
-        </bedheights>
-      </dc:call-macro>
-    </dc:macro>
-
     <dc:macro name="minfo-heights-years">
         <dc:comment>
         The input here is a list differenc ids noted in the
@@ -1940,27 +1932,11 @@
       <dc:macro-body/>
     </dc:macro>
 
-    <dc:macro name="bed-heights-statement">
-      <dc:statement>
-        SELECT bhs.id          AS bedh_id,
-            bhs.year        AS bedh_year,
-            bhs.description AS bedh_descr,
-            bhs.description || '<BR>Jahr: ' || bhs.year ||
-            '<BR>Aufnahmeart: ' || bht.name ||
-            '<BR>Lagesystem: ' || ls.name ||
-            '<BR>Höhensystem: ' || cur_em.name ||
-            '<BR>ursprüngliches Höhensystem: ' || old_em.name ||
-            '<BR>Strecke: ' || round(r.a, 1) || '-' || round(r.b, 1) ||
-            '<BR>Auswerter: ' || bhs.evaluation_by AS info
-        FROM bed_height_single bhs
-        JOIN bed_height_type bht ON bht.id = bhs.type_id
-        JOIN location_system ls ON ls.id = location_system_id
-        JOIN elevation_model cur_em ON cur_em.id = cur_elevation_model_id
-        JOIN elevation_model old_em ON old_em.id = old_elevation_model_id
-        JOIN ranges r ON r.id = range_id
-        WHERE bhs.river_id = ${river_id}
-            AND bhs.year BETWEEN ${year_from} AND ${year_to}
-      </dc:statement>
+    <dc:macro name="minfo-heights">
+      <bedheights>
+        <dc:call-macro name="bed-heights-single"/>
+        <dc:call-macro name="bed-heights-epoch"/>
+      </bedheights>
     </dc:macro>
 
     <dc:macro name="bed-heights-factory">
@@ -1979,10 +1955,10 @@
           <dc:call-macro name="bed-heights-statement"/>
           <dc:filter expr="not(contains($bedh_descr, 'Epoche'))">
             <dc:if test="dc:has-result()">
-              <dc:group expr="$bedh_year">
-                <cross-sections name="{dc:group-key()}">
+              <dc:group expr="dc:coalesce($bedh_year, 'sonstige')">
+                <heights name="{dc:group-key()}">
                   <dc:call-macro name="bed-heights-factory"/>
-                </cross-sections>
+                </heights>
               </dc:group>
             </dc:if>
           </dc:filter>
@@ -2001,6 +1977,29 @@
       </epoch>
     </dc:macro>
 
+    <dc:macro name="bed-heights-statement">
+      <dc:statement>
+        SELECT bhs.id       AS bedh_id,
+            bhs.year        AS bedh_year,
+            bhs.description AS bedh_descr,
+            bhs.description || '<BR>Jahr: ' || bhs.year ||
+            '<BR>Aufnahmeart: ' || bht.name ||
+            '<BR>Lagesystem: ' || ls.name ||
+            '<BR>Höhensystem: ' || cur_em.name ||
+            '<BR>ursprüngliches Höhensystem: ' || old_em.name ||
+            '<BR>Strecke: ' || round(r.a, 1) || '-' || round(r.b, 1) ||
+            '<BR>Auswerter: ' || bhs.evaluation_by AS info
+        FROM bed_height_single bhs
+        JOIN bed_height_type bht ON bht.id = bhs.type_id
+        JOIN location_system ls ON ls.id = location_system_id
+        JOIN elevation_model cur_em ON cur_em.id = cur_elevation_model_id
+        JOIN elevation_model old_em ON old_em.id = old_elevation_model_id
+        JOIN ranges r ON r.id = range_id
+        WHERE bhs.river_id = ${river_id}
+      </dc:statement>
+    </dc:macro>
+
+    <!-- flow velocity -->
     <dc:macro name="flow_velocity_models">
       <dc:context>
         <dc:statement>


More information about the Dive4Elements-commits mailing list