changeset 5032:afc242588642

Avoid needless geometry processing Mangling every geometry in the intersection machinery when importing as waterway admin leads to slightly different geometries compared to the same geometries imported by a sys_admin. This would create artificial history of entries when importing alternately as waterway admin and sys admin, once history of fairway dimensions is preserved.
author Tom Gottfried <tom@intevation.de>
date Thu, 19 Mar 2020 17:36:20 +0100
parents 8c590ef35280
children 13d9820c1ea4
files pkg/imports/fd.go
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/fd.go	Wed Mar 18 19:19:09 2020 +0100
+++ b/pkg/imports/fd.go	Thu Mar 19 17:36:20 2020 +0100
@@ -161,6 +161,8 @@
 SELECT
     ST_Multi(ST_CollectionExtract(ST_MakeValid(ST_Transform(
       CASE WHEN pg_has_role('sys_admin', 'MEMBER')
+          OR ST_Covers((SELECT a FROM resp),
+            ST_Transform(new_fd, (SELECT ST_SRID(a) FROM resp)))
         THEN new_fd
         ELSE ST_Intersection(
             (SELECT ST_Buffer(a, -0.0001) FROM resp),