[PATCH] Metadata in datacage tooltips for sediment densities, bed heights, flow velocities and sounding widhts

Wald Commits scm-commit at wald.intevation.org
Tue Aug 26 12:09:23 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1409047758 -7200
# Node ID 37cdfad302cbb56b370cc0b7c7d1b0aeb696c93c
# Parent  369fbb28f5d0e33fab55f2a7b00886b7c418ce99
Metadata in datacage tooltips for sediment densities, bed heights, flow velocities and sounding widhts.

diff -r 369fbb28f5d0 -r 37cdfad302cb artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Tue Aug 26 11:35:47 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Aug 26 12:09:18 2014 +0200
@@ -1385,10 +1385,10 @@
         <dc:statement>
             SELECT DISTINCT
                 sd.id          AS sdid,
-                sd.description AS description,
                 d.lower        AS depth_lower,
                 d.upper        AS depth_upper,
-                min(sdv.year)  AS year
+                min(sdv.year)  AS year,
+                sd.description || '<BR>Jahr: ' || min(sdv.year) AS info
             FROM     sediment_density sd
                 JOIN depths d ON sd.depth_id = d.id
                 JOIN sediment_density_values sdv on sdv.sediment_density_id = sd.id
@@ -1401,7 +1401,7 @@
                   <density description="{$depth_lower}-{$depth_upper} cm"
                    factory="sedimentdensity"
                    target_out="{$out}"
-                   info="{$description}"
+                   info="{$info}"
                    ids="{$sdid}" />
           </dc:for-each>
         </dc:if>
@@ -1897,33 +1897,52 @@
       <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>
+
+    <dc:macro name="bed-heights-factory">
+      <dc:for-each>
+        <height factory="bedheight"
+                target_out="{$out}"
+                ids="bedheight-single-{$bedh_id}-{$bedh_year}"
+                info="{$info}"
+                description="{$bedh_descr}"/>
+      </dc:for-each>
+    </dc:macro>
+
     <dc:macro name="bed-heights-single">
       <single>
         <dc:context>
-          <dc:statement>
-            SELECT bhs.id          AS bedh_id,
-                   bhs.year        AS bedh_year,
-                   bhs.description AS bedh_descr,
-                   bht.name        AS type_name
-            FROM bed_height_single bhs
-               JOIN bed_height_type bht ON bht.id = bhs.type_id
-            WHERE bhs.river_id = ${river_id}
-            AND lower(bhs.description) NOT LIKE '%epoch%'
-            AND bhs.year BETWEEN ${year_from} AND ${year_to}
-          </dc:statement>
-          <dc:if test="dc:has-result()">
-            <dc:group expr="$bedh_year">
-              <cross-sections name="{dc:group-key()}">
-                <dc:for-each>
-                  <height factory="bedheight"
-                          target_out="{$out}"
-                          ids="bedheight-single-{$bedh_id}-{$bedh_year}"
-                          info="{$type_name}"
-                          description="{$bedh_descr}"/>
-                </dc:for-each>
-              </cross-sections>
-            </dc:group>
-          </dc:if>
+          <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:call-macro name="bed-heights-factory"/>
+                </cross-sections>
+              </dc:group>
+            </dc:if>
+          </dc:filter>
         </dc:context>
       </single>
     </dc:macro>
@@ -1931,20 +1950,10 @@
     <dc:macro name="bed-heights-epoch">
       <epoch>
         <dc:context>
-          <dc:statement>
-            SELECT id          AS bedh_id,
-                   year        AS bedh_year,
-                   description AS bedh_descr
-            FROM bed_height_single
-            WHERE river_id = ${river_id}
-              AND lower(description) LIKE '%epoch%'
-              AND year BETWEEN ${year_from} AND ${year_to}
-          </dc:statement>
-          <dc:for-each>
-            <height factory="bedheight" target_out="{$out}"
-                    ids="bedheight-single-{$bedh_id}-{$bedh_year}"
-                    description="{$bedh_descr}"/>
-          </dc:for-each>
+          <dc:call-macro name="bed-heights-statement"/>
+          <dc:filter expr="contains($bedh_descr, 'Epoche')">
+            <dc:call-macro name="bed-heights-factory"/>
+          </dc:filter>
         </dc:context>
       </epoch>
     </dc:macro>
@@ -1954,6 +1963,8 @@
         <dc:statement>
           SELECT fvm.id             AS fvmid,
                  fvm.description    AS fvmd,
+                 dz.gauge_name      AS gauge,
+                 dz.value           AS q,
                  dz.upper_discharge AS upperQ,
                  dz.lower_discharge AS lowerQ
           FROM flow_velocity_model fvm
@@ -1967,7 +1978,9 @@
               <measurement_value name="{$fvmd}"
                                  ids="{$fvmid}"
                                  factory="flowvelocitymodel"
-                                 info="{$lowerQ} - {$upperQ}"
+                                 info="{$lowerQ} - {$upperQ}<BR>
+                                       Pegel {$gauge}<BR>
+                                       Q = {$q} m3/s"
                                  target_out="{$out}" />
             </dc:for-each>
           </flowvelocitymodel>
@@ -2038,18 +2051,14 @@
 
     <dc:macro name="sounding-width">
       <dc:context>
-        <dc:statement>
-            SELECT id          AS bedh_id,
-                   year        AS bedh_year,
-                   description AS bedh_descr
-            FROM bed_height_single WHERE river_id = ${river_id}
-        </dc:statement>
+        <dc:call-macro name="bed-heights-statement"/>
         <dc:if test="dc:has-result()">
           <soundings_width>
             <dc:for-each>
                     <height factory="bedheight"
                       target_out="{$out}"
                       ids="bedheight-soundings-{$bedh_id}-{$bedh_year}"
+                      info="{$info}"
                       description="{$bedh_descr}"/>
             </dc:for-each>
           </soundings_width>


More information about the Dive4Elements-commits mailing list