diff schema/isrs_functions.sql @ 5513:68358e4603c8

Use current axis only for calculating bottleneck areas This is a fixup of rev. cf25b23e3eec, which introduced historic data for the waterway axis but missed to take this into account in the calculation of bottleneck areas, leading to sometimes excessive runtime and bad results due to multiple (almost) equal axis geometries being considered as candidates in the bottleneck stretch. The database migration tries to recalculate all bottleneck areas, while some might fail that did not fail on import. A warning message is emitted for these and the area is left untouched.
author Tom Gottfried <tom@intevation.de>
date Tue, 19 Oct 2021 13:12:39 +0200
parents e8b2dc771f9e
children 05db984d3db1
line wrap: on
line diff
--- a/schema/isrs_functions.sql	Fri Oct 15 15:14:33 2021 +0200
+++ b/schema/isrs_functions.sql	Tue Oct 19 13:12:39 2021 +0200
@@ -65,7 +65,8 @@
                 geom AS wtwaxs,
                 ST_Boundary(geom) AS bdr
             FROM waterway.waterway_axis,
-                ST_Dump(ST_Transform(wtwaxs::geometry, z));
+                ST_Dump(ST_Transform(wtwaxs::geometry, z))
+            WHERE validity @> current_timestamp;
     CREATE INDEX axs_bdr ON axis USING GiST (bdr);
     ANALYZE axis;