[PATCH 13 of 15] New macro for porosities in datacage config

Wald Commits scm-commit at wald.intevation.org
Wed Apr 30 15:30:16 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1398864404 -7200
# Node ID b566cd0c025a7e8fb784db6abf7194340e4ddf27
# Parent  63959d4f3c036b28231e1197e93979bc3b36fa06
New macro for porosities in datacage config.

diff -r 63959d4f3c03 -r b566cd0c025a artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Wed Apr 30 15:25:50 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Apr 30 15:26:44 2014 +0200
@@ -1303,6 +1303,7 @@
           <dc:call-macro name="minfo-heights"/>
           <dc:call-macro name="sounding-width"/>
           <dc:call-macro name="morph_width"/>
+          <dc:call-macro name="porosities"/>
           <flow_velocities>
             <dc:call-macro name="flow_velocity_measurements"/>
             <dc:call-macro name="flow_velocity_models"/>
@@ -1324,6 +1325,34 @@
       <dc:call-macro name="sediment-load"/>
     </dc:macro>
 
+    <dc:macro name="porosities">
+      <porosities>
+      <dc:context>
+        <dc:statement>
+            SELECT DISTINCT
+                p.id          AS pid,
+                p.description AS description,
+                d.lower        AS depth_lower,
+                d.upper        AS depth_upper
+            FROM     porosity p
+                JOIN depths d ON p.depth_id = d.id
+                JOIN porosity_values pv on pv.porosity_id = p.id
+            WHERE   p.river_id = ${river_id}
+            GROUP BY p.id, p.description, d.upper, d.lower
+            ORDER BY depth_lower, depth_upper
+        </dc:statement>
+        <dc:if test="dc:has-result()">
+          <dc:for-each>
+                  <porosity description="{$depth_lower}-{$depth_upper} cm"
+                   factory="porosity"
+                   target_out="{$out}"
+                   info="{$description}"
+                   ids="{$pid}" />
+          </dc:for-each>
+        </dc:if>
+      </dc:context>
+      </porosities>
+    </dc:macro>
 
     <dc:macro name="densities">
       <densities>


More information about the Dive4Elements-commits mailing list