comparison schema/isrs_functions.sql @ 1983:f9f1babe52ae

Fix area generation from multipolygon input In case the waterway axis representing a stretch intersects distinct parts of the input area, a multipolygon has to be returned. Before, an arbitrary polygon was selected due to the used function not being set-returning. In passing, consistently name respective columns in schema.
author Tom Gottfried <tom@intevation.de>
date Wed, 23 Jan 2019 16:25:43 +0100
parents c21f72775f6b
children 7936b46a88d4
comparison
equal deleted inserted replaced
1982:a7e47a9d890b 1983:f9f1babe52ae
92 axis_substring.line, 92 axis_substring.line,
93 ST_Transform(area, z)), 93 ST_Transform(area, z)),
94 'endcap=flat'), 94 'endcap=flat'),
95 ST_Transform(area, z)))).geom 95 ST_Transform(area, z)))).geom
96 FROM axis_substring, utm_zone) 96 FROM axis_substring, utm_zone)
97 -- From the polygons returned by the last CTE, select only the one 97 -- From the polygons returned by the last CTE, select only those
98 -- around the clipped axis 98 -- around the clipped axis
99 SELECT ST_Transform(range_area.geom, ST_SRID(area)) 99 SELECT ST_Collect(ST_Transform(range_area.geom, ST_SRID(area)))
100 FROM axis_substring, range_area 100 FROM axis_substring, range_area
101 WHERE ST_Intersects(range_area.geom, axis_substring.line) 101 WHERE ST_Intersects(range_area.geom, axis_substring.line)
102 $$ 102 $$
103 LANGUAGE sql; 103 LANGUAGE sql;