[SCM] PostGIS branch master updated. 3.4.0rc1-951-gea78085af

git at osgeo.org git at osgeo.org
Wed Feb 28 07:30:09 PST 2024


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  ea78085af40612926663e0a149bf1a776fa8412b (commit)
      from  5d7f02582a78549a0ca32f03190a7cd019411689 (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 ea78085af40612926663e0a149bf1a776fa8412b
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Feb 28 16:30:48 2024 +0100

    Have TopologySummary signal pending computation of faces
    
    Based on presence of pivot faces (where face_id < 0)

diff --git a/topology/sql/manage/TopologySummary.sql.in b/topology/sql/manage/TopologySummary.sql.in
index ebca1f33e..cce626716 100644
--- a/topology/sql/manage/TopologySummary.sql.in
+++ b/topology/sql/manage/TopologySummary.sql.in
@@ -74,11 +74,22 @@ BEGIN
   END;
 
   BEGIN
-    EXECUTE 'SELECT count(*) FROM ' || quote_ident(atopology)
-      || '.face' INTO STRICT n;
-    ret = ret || greatest(n-1,0) || ' faces, '; -- -1 is face=0
+    EXECUTE format(
+      $$
+    SELECT
+      count(*) FILTER (WHERE face_id > 0) p,
+      count(*) FILTER (WHERE face_id < 0) n
+    FROM %I.face
+      $$,
+      atopology)
+    INTO STRICT rec;
+    IF rec.n > 0 THEN
+      ret = ret || rec.p || '? faces (pending detection), ';
+    ELSE
+      ret = ret || rec.p || ' faces, ';
+    END IF;
   EXCEPTION
-    WHEN UNDEFINED_TABLE OR INVALID_SCHEMA_NAME THEN
+    WHEN UNDEFINED_TABLE OR UNDEFINED_COLUMN OR INVALID_SCHEMA_NAME THEN
       ret = ret || 'missing faces, ';
   END;
 
diff --git a/topology/test/regress/topologysummary.sql b/topology/test/regress/topologysummary.sql
index 0f57ff7c0..6454dff92 100644
--- a/topology/test/regress/topologysummary.sql
+++ b/topology/test/regress/topologysummary.sql
@@ -1,11 +1,12 @@
+SET client_min_messages TO WARNING;
 SELECT E'--missing--\n' || TopologySummary('test');
 CREATE SCHEMA test;
 SELECT E'--empty--\n' || TopologySummary('test');
-CREATE TABLE test.node(id int);
+CREATE TABLE test.node(node_id int);
 SELECT E'--node--\n' || TopologySummary('test');
-CREATE TABLE test.edge(id int);
+CREATE TABLE test.edge(edge_id int);
 SELECT E'--node+edge--\n' || TopologySummary('test');
-CREATE TABLE test.face(id int);
+CREATE TABLE test.face(face_id int);
 SELECT E'--node+edge+face--\n' || TopologySummary('test');
 CREATE TABLE test.relation(id int);
 SELECT E'--node+edge+face+corrupted_relation--\n' || TopologySummary('test');
@@ -29,13 +30,11 @@ UPDATE test.t SET c.layer_id = 1, c.topology_id = topology_id(c)+1 WHERE layer_i
 SELECT E'--registered_layer_missing_topogeom_in_proper_topo--\n' || TopologySummary('test');
 UPDATE test.t SET c.topology_id = topology_id(c)-1 WHERE layer_id(c) = 1;
 SELECT E'--registered_layer--\n' || TopologySummary('test');
--- TODO: test hierarchical
-DROP TABLE test.t;
-DROP TABLE test.node;
-DROP TABLE test.edge;
-DROP TABLE test.face;
-DROP TABLE test.relation;
-DROP SCHEMA test;
+INSERT INTO test.face(face_id) VALUES (-1);
+SELECT E'--pivot face--\n' || TopologySummary('test');
+DROP SCHEMA test CASCADE;
 SELECT E'--registered+missing--\n' || TopologySummary('test');
 DELETE FROM topology.layer WHERE topology_id = 1;
 DELETE FROM topology.topology WHERE id = 1;
+
+-- TODO: test hierarchical
diff --git a/topology/test/regress/topologysummary_expected b/topology/test/regress/topologysummary_expected
index 4cd90d36e..dba0f8e92 100644
--- a/topology/test/regress/topologysummary_expected
+++ b/topology/test/regress/topologysummary_expected
@@ -55,6 +55,11 @@ Layer 1, type Puntal (1), 1 topogeoms
 --registered_layer--
 Topology test (id 1, SRID 10, precision 20)
 0 nodes, 0 edges, 0 faces, 1 topogeoms in 1 layers
+Layer 1, type Puntal (1), 1 topogeoms
+ Deploy: test.t.c
+--pivot face--
+Topology test (id 1, SRID 10, precision 20)
+0 nodes, 0 edges, 0? faces (pending detection), 1 topogeoms in 1 layers
 Layer 1, type Puntal (1), 1 topogeoms
  Deploy: test.t.c
 --registered+missing--

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

Summary of changes:
 topology/sql/manage/TopologySummary.sql.in     | 19 +++++++++++++++----
 topology/test/regress/topologysummary.sql      | 19 +++++++++----------
 topology/test/regress/topologysummary_expected |  5 +++++
 3 files changed, 29 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list