[PATCH 1 of 4] issue1391: Fix syntax in gauge macros and add km filtering

Wald Commits scm-commit at wald.intevation.org
Mon Jul 29 12:20:23 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1375092891 -7200
# Node ID 0b0325d1ab7f4f01bf09e70a831af948e9aaebad
# Parent  e568788f519dc28773345c96fce66182116494b1
issue1391: Fix syntax in gauge macros and add km filtering

diff -r e568788f519d -r 0b0325d1ab7f artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Mon Jul 29 11:56:03 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon Jul 29 12:14:51 2013 +0200
@@ -1284,22 +1284,21 @@
     <dc:macro name="discharge_table_gauge">
       <dc:context>
         <dc:statement>
-          SELECT id   AS gauge_id,
-                 name AS gauge_name
-          FROM gauges WHERE river_id = ${river_id}
+          SELECT g.id   AS gauge_id,
+                 g.name AS gauge_name
+          FROM gauges g
+          LEFT JOIN ranges r ON g.range_id = r.id
+          WHERE g.river_id = ${river_id}
+          AND NOT((${tokm} < r.a) or (${fromkm} > r.b))
         </dc:statement>
         <dc:if test="dc:has-result()">
-          <discharge_table_nn>
-            <discharge_table_gauge>
-              <dc:for-each>
-                <gauge name="{$gauge_name}"
-                  factory="gaugedischarge" target_out="{$out}"
-                  from="{$g_start}"
-                  to="{$g_stop}"
-                  ids="{$gauge_name}"/>
-              </dc:for-each>
-            </discharge_table_gauge>
-          </discharge_table_nn>
+          <discharge_table_gauge>
+            <dc:for-each>
+              <gauge name="{$gauge_name}"
+                factory="gaugedischarge" target_out="{$out}"
+                ids="{$gauge_name}"/>
+            </dc:for-each>
+          </discharge_table_gauge>
         </dc:if>
       </dc:context>
     </dc:macro>


More information about the Dive4elements-commits mailing list