[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-44-gd138985

git at osgeo.org git at osgeo.org
Tue Jan 12 09:10:19 PST 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  d138985015bd56a21bc6d9f5b5c301528e7155a6 (commit)
      from  ebe9ec54cfb2a5f3345a6a861961de63bb1ddf52 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d138985015bd56a21bc6d9f5b5c301528e7155a6
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Jan 12 15:19:08 2021 +0100

    Check isolated edges are covered by their left-right faces
    
    Updates existing tests accordingly.
    Includes NEWS item.
    
    Closes #4830

diff --git a/NEWS b/NEWS
index 318c8ad..6b80230 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ PostGIS 3.2.0
 
  * Enhancements *
   - #3233, ValidateTopology check for node's containing_face (Sandro Santilli)
+  - #4830, ValidateTopology check for edges side face containment
+           (Sandro Santilli)
 
 PostGIS 3.1.0
 2020/12/18
diff --git a/topology/test/regress/legacy_invalid_expected b/topology/test/regress/legacy_invalid_expected
index e47d167..a01114e 100644
--- a/topology/test/regress/legacy_invalid_expected
+++ b/topology/test/regress/legacy_invalid_expected
@@ -19,4 +19,6 @@ face has no rings|10|
 face within face|11|2
 face overlaps face|2|12
 not-isolated node has not-null containing_face|4|
+edge not covered by both its side faces|28|
+edge not covered by both its side faces|30|
 Topology 'invalid_topology' dropped
diff --git a/topology/topology.sql.in b/topology/topology.sql.in
index 2943854..d6710f8 100644
--- a/topology/topology.sql.in
+++ b/topology/topology.sql.in
@@ -1709,6 +1709,41 @@ BEGIN
     RETURN NEXT retrec;
   END LOOP;
 
+  -- Check edges are covered by their left-right faces (#4831)
+  FOR rec IN EXECUTE format(
+    $SQL$
+      WITH edge_coverage AS (
+        SELECT
+          e.edge_id,
+          e.left_face,
+          ST_Covers(fl.geom, e.geom) covered_left,
+          e.right_face,
+          ST_Covers(fr.geom, e.geom) covered_right
+        FROM
+          %1$I.edge_data e
+          LEFT JOIN face_check fl ON ( fl.face_id = e.left_face )
+          LEFT JOIN face_check fr ON ( fr.face_id = e.right_face )
+        WHERE
+          -- isolated only
+          e.next_left_edge = e.edge_id
+          AND
+          e.next_right_edge = e.edge_id
+          -- skip invalid edges (will be already reported previously)
+          AND NOT e.edge_id = ANY(%2$L)
+      )
+      SELECT * from edge_coverage
+      WHERE
+        NOT covered_left
+        OR NOT covered_right
+      ORDER BY edge_id
+    $SQL$, toponame, invalid_edges)
+  LOOP
+      retrec.error := 'edge not covered by both its side faces';
+      retrec.id1 := rec.edge_id;
+      retrec.id2 := NULL; -- TODO: write expected containing_face here ?
+      RETURN NEXT retrec;
+  END LOOP;
+
   DROP TABLE face_check;
 
   RETURN;

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                          |  2 ++
 topology/test/regress/legacy_invalid_expected |  2 ++
 topology/topology.sql.in                      | 35 +++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list