[Dive4elements-commits] [PATCH] datacage: simplified range filtering for wsts

Wald Commits scm-commit at wald.intevation.org
Tue Apr 30 17:46:39 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1367336789 -7200
# Node ID 11e74ca3229a60511a46a66a2c6d108048c2508f
# Parent  4f35b34f4efafb7defa8c32258c9cf7b1e34bed4
datacage: simplified range filtering for wsts.

diff -r 4f35b34f4efa -r 11e74ca3229a artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Tue Apr 30 12:53:10 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Apr 30 17:46:29 2013 +0200
@@ -12,13 +12,10 @@
                wst_columns.description AS info,
                wst_ranges.a            AS deffrom,
                wst_ranges.b            AS defto
-        FROM wst_columns, wst_ranges
+        FROM wst_columns JOIN wst_ranges
+            ON wst_columns.id = wst_ranges.wst_column_id
         WHERE wst_columns.wst_id = ${prot_id}
-           AND wst_ranges.wst_column_id = wst_columns.id
-           AND (${fromkm} BETWEEN wst_ranges.a AND wst_ranges.b
-           OR ${tokm} BETWEEN wst_ranges.a AND wst_ranges.b
-           OR wst_ranges.a BETWEEN ${fromkm} AND ${tokm}
-           OR wst_ranges.b BETWEEN ${fromkm} AND ${tokm})
+            AND NOT((${tokm} < wst_ranges.a) OR (${fromkm} > wst_ranges.b))
         ORDER by wst_columns.position
     </dc:statement>
   </dc:macro>


More information about the Dive4elements-commits mailing list