changeset 8141:37cdfad302cb

Metadata in datacage tooltips for sediment densities, bed heights, flow velocities and sounding widhts.
author Tom Gottfried <tom@intevation.de>
date Tue, 26 Aug 2014 12:09:18 +0200
parents 369fbb28f5d0
children d4e4dde1d5cb 7021753b3797
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 57 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- 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 || '&lt;BR&gt;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 || '&lt;BR&gt;Jahr: ' || bhs.year ||
+            '&lt;BR&gt;Aufnahmeart: ' || bht.name ||
+            '&lt;BR&gt;Lagesystem: ' || ls.name ||
+            '&lt;BR&gt;Höhensystem: ' || cur_em.name ||
+            '&lt;BR&gt;ursprüngliches Höhensystem: ' || old_em.name ||
+            '&lt;BR&gt;Strecke: ' || round(r.a, 1) || '-' || round(r.b, 1) ||
+            '&lt;BR&gt;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}&lt;BR&gt;
+                                       Pegel {$gauge}&lt;BR&gt;
+                                       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>

http://dive4elements.wald.intevation.org