diff artifacts/doc/conf/meta-data.xml @ 9111:ee77e544e890

Where clause in bed-heights-statement extended by km range condition
author mschaefer
date Mon, 04 Jun 2018 08:32:25 +0200
parents e68d4a10c308
children 189cc8ededbd
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Fri Jun 01 17:42:20 2018 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon Jun 04 08:32:25 2018 +0200
@@ -2114,9 +2114,9 @@
         '<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,
-        bhv.height_count AS bedh_height_count,
-        bhv.min_count AS bedh_min_count,
-        bhv.max_count AS bedh_max_count
+        COALESCE(bhv.height_count,0) AS bedh_height_count,
+        COALESCE(bhv.min_count,0) AS bedh_min_count,
+        COALESCE(bhv.max_count,0) AS bedh_max_count
         FROM bed_height bhs
         JOIN bed_height_type bht ON bht.id = bhs.type_id
         JOIN location_system ls ON ls.id = location_system_id
@@ -2125,8 +2125,9 @@
         ON old_em.id = old_elevation_model_id
         LEFT JOIN ranges r ON r.id = range_id
         LEFT JOIN (SELECT bed_height_id, COUNT(height) AS height_count, COUNT(min_height) AS min_count, COUNT(max_height) AS max_count
-        FROM bed_height_values GROUP
-        BY bed_height_id
+        FROM bed_height_values
+        WHERE (station BETWEEN (${fromkm}-0.0001) AND (${tokm}+0.0001))
+        GROUP BY bed_height_id
         ) bhv ON bhs.id = bhv.bed_height_id
         WHERE bhs.river_id = ${river_id}
       </dc:statement>

http://dive4elements.wald.intevation.org