comparison pkg/controllers/search.go @ 3666:db87f34805fb

Align bottleneck validity at gauges Ensuring the validity of a bottleneck version is always contained by the validity of the referenced gauge version allows to reliably determine matching reference values of the gauge at a point in time. Since this implies that a bottleneck version might be cut into more than one time ranges, the concept of having only one non-erased version is no longer applicable and replaced by using the 'current' version of a bottleneck. Fairway availability data are always kept with the 'current' bottleneck version to have them at hand alltogether for analyses over longer time ranges.
author Tom Gottfried <tom@intevation.de>
date Sat, 15 Jun 2019 14:36:50 +0200
parents 02951a62e8c6
children 1504856c9378
comparison
equal deleted inserted replaced
3665:29ef6d41e4af 3666:db87f34805fb
40 SELECT 40 SELECT
41 objnam AS name, 41 objnam AS name,
42 ST_AsGeoJSON(ST_Centroid(area))::json AS geom, 42 ST_AsGeoJSON(ST_Centroid(area))::json AS geom,
43 'bottleneck' AS type 43 'bottleneck' AS type
44 FROM waterway.bottlenecks 44 FROM waterway.bottlenecks
45 WHERE NOT erased 45 WHERE validity @> current_timestamp
46 ORDER BY objnam) r 46 ORDER BY objnam) r
47 ` 47 `
48 ) 48 )
49 49
50 var rkmRegex = regexp.MustCompile( 50 var rkmRegex = regexp.MustCompile(