comparison 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
comparison
equal deleted inserted replaced
5512:6738655809eb 5513:68358e4603c8
63 CREATE TEMP TABLE axis AS 63 CREATE TEMP TABLE axis AS
64 SELECT row_number() OVER () AS id, 64 SELECT row_number() OVER () AS id,
65 geom AS wtwaxs, 65 geom AS wtwaxs,
66 ST_Boundary(geom) AS bdr 66 ST_Boundary(geom) AS bdr
67 FROM waterway.waterway_axis, 67 FROM waterway.waterway_axis,
68 ST_Dump(ST_Transform(wtwaxs::geometry, z)); 68 ST_Dump(ST_Transform(wtwaxs::geometry, z))
69 WHERE validity @> current_timestamp;
69 CREATE INDEX axs_bdr ON axis USING GiST (bdr); 70 CREATE INDEX axs_bdr ON axis USING GiST (bdr);
70 ANALYZE axis; 71 ANALYZE axis;
71 72
72 WITH RECURSIVE 73 WITH RECURSIVE
73 -- In order to guarantee the following ST_Covers to work, 74 -- In order to guarantee the following ST_Covers to work,