Mercurial > gemma
diff 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 |
line wrap: on
line diff
--- a/schema/isrs_functions.sql Wed Jan 23 16:18:36 2019 +0100 +++ b/schema/isrs_functions.sql Wed Jan 23 16:25:43 2019 +0100 @@ -94,9 +94,9 @@ 'endcap=flat'), ST_Transform(area, z)))).geom FROM axis_substring, utm_zone) - -- From the polygons returned by the last CTE, select only the one + -- From the polygons returned by the last CTE, select only those -- around the clipped axis - SELECT ST_Transform(range_area.geom, ST_SRID(area)) + SELECT ST_Collect(ST_Transform(range_area.geom, ST_SRID(area))) FROM axis_substring, range_area WHERE ST_Intersects(range_area.geom, axis_substring.line) $$