[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-329-gb564e09
git at osgeo.org
git at osgeo.org
Tue Jul 13 14:51:21 PDT 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, main has been updated
via b564e095f367dc76d05c933da7a5d4a29f92822c (commit)
from 406ecaab3296aa7630e9a887b0d736979f077c49 (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 b564e095f367dc76d05c933da7a5d4a29f92822c
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Jul 13 23:50:48 2021 +0200
Avoid rebuilding exterior ring of faces already built
diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in
index 3b8cc6e..4c14df4 100644
--- a/topology/sql/manage/ValidateTopology.sql.in
+++ b/topology/sql/manage/ValidateTopology.sql.in
@@ -268,6 +268,7 @@ LANGUAGE 'plpgsql' VOLATILE;
-- NOTE: assumes search_path was set before calling this function
--
-- Creates a pg_temp.hole_check table
+-- Creates a pg_temp.shell_check table
--
CREATE OR REPLACE FUNCTION topology._ValidateTopologyRings(bbox geometry DEFAULT NULL)
RETURNS SETOF topology.ValidateTopology_ReturnType
@@ -486,10 +487,6 @@ BEGIN
END LOOP;
#endif /* POSTGIS_TOPOLOGY_DEBUG */
- DROP TABLE pg_temp.shell_check;
-
-
-
END;
$BODY$ --}
LANGUAGE 'plpgsql' VOLATILE;
@@ -824,17 +821,33 @@ BEGIN
CREATE TEMP TABLE face_check ON COMMIT DROP AS
SELECT
- face_id,
- ST_MakePolygon(
- ST_ExteriorRing(
- topology.ST_GetFaceGeometry(toponame, face_id)
- )
- ) AS shell,
- mbr
+ sc.face_id,
+ sc.ring_geom AS shell,
+ f.mbr
FROM
- face
+ pg_temp.shell_check sc, face f
WHERE
- face_id > 0
+ f.face_id = sc.face_id
+ ;
+
+ DROP TABLE pg_temp.shell_check;
+
+
+ IF bbox IS NOT NULL
+ THEN --{
+ INSERT INTO pg_temp.face_check
+ SELECT face_id,
+ ST_MakePolygon(
+ ST_ExteriorRing(
+ topology.ST_GetFaceGeometry(
+ toponame,
+ face_id
+ )
+ )
+ ),
+ mbr
+ FROM face
+ WHERE mbr && bbox
AND (
CASE WHEN invalid_faces IS NOT NULL THEN
NOT face_id = ANY(invalid_faces)
@@ -842,11 +855,11 @@ BEGIN
TRUE
END
)
- AND (
- bbox IS NULL
- OR mbr && bbox
+ AND face_id NOT IN (
+ SELECT face_id FROM pg_temp.face_check
)
- ;
+ ;
+ END IF; --}
-- Build a gist index on geom
CREATE INDEX ON face_check USING gist (shell);
-----------------------------------------------------------------------
Summary of changes:
topology/sql/manage/ValidateTopology.sql.in | 47 ++++++++++++++++++-----------
1 file changed, 30 insertions(+), 17 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list