[postgis-tickets] [SCM] PostGIS branch stable-3.2 updated. 3.2.4-16-gc6d193d73

git at osgeo.org git at osgeo.org
Fri Mar 31 13:03:57 PDT 2023


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, stable-3.2 has been updated
       via  c6d193d73e48071b388a078282e5e12a98c74572 (commit)
       via  f6db8f6b0c0b54c01992306a1400d514c346f523 (commit)
      from  a895ebc543477dbcadb91ad587436eaa3c9609d9 (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 c6d193d73e48071b388a078282e5e12a98c74572
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Mar 31 13:03:52 2023 -0700

    Add news entry for #5363

diff --git a/NEWS b/NEWS
index 1eb60bef5..a975ede7d 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Proj 6.1+, and PostgreSQL 14+.
   - #5344, Include topology id sequence state in dumps (Sandro Santilli)
   - #5288, ST_LineCrossingDirection multi-cross error (Paul Ramsey)
   - #5347, _ST_BestSRID crashes on ARM with infinite geometries (Regina Obe)
+  - #5363, Make ST_ClusterDBScan interruptable (Paul Ramsey)
+
 
 PostGIS 3.2.4
 2022/11/12

commit f6db8f6b0c0b54c01992306a1400d514c346f523
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Mar 31 08:53:52 2023 -0700

    Add an interrupt check in dbscan

diff --git a/liblwgeom/lwgeom_geos_cluster.c b/liblwgeom/lwgeom_geos_cluster.c
index 7e1b6f607..13de61625 100644
--- a/liblwgeom/lwgeom_geos_cluster.c
+++ b/liblwgeom/lwgeom_geos_cluster.c
@@ -266,6 +266,9 @@ dbscan_update_context(GEOSSTRtree* tree, struct QueryContext* cxt, LWGEOM** geom
 	cxt->num_items_found = 0;
 
 	GEOSGeometry* query_envelope;
+
+	LW_ON_INTERRUPT(return LW_FAILURE);
+
 	if (geoms[p]->type == POINTTYPE)
 	{
 		const POINT2D* pt = getPoint2d_cp(lwgeom_as_lwpoint(geoms[p])->point, 0);
@@ -347,10 +350,16 @@ union_dbscan_minpoints_1(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, doub
 
 	for (p = 0; p < num_geoms; p++)
 	{
+		int rv = LW_SUCCESS;
 		if (lwgeom_is_empty(geoms[p]))
 			continue;
 
-		dbscan_update_context(tree.tree, &cxt, geoms, p, eps);
+		rv = dbscan_update_context(tree.tree, &cxt, geoms, p, eps);
+		if (rv == LW_FAILURE)
+		{
+			destroy_strtree(&tree);
+			return LW_FAILURE;
+		}
 		for (i = 0; i < cxt.num_items_found; i++)
 		{
 			uint32_t q = *((uint32_t*) cxt.items_found[i]);
@@ -422,11 +431,17 @@ union_dbscan_general(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double e
 	for (p = 0; p < num_geoms; p++)
 	{
 		uint32_t num_neighbors = 0;
+		int rv;
 
 		if (lwgeom_is_empty(geoms[p]))
 			continue;
 
-		dbscan_update_context(tree.tree, &cxt, geoms, p, eps);
+		rv = dbscan_update_context(tree.tree, &cxt, geoms, p, eps);
+		if (rv == LW_FAILURE)
+		{
+			destroy_strtree(&tree);
+			return LW_FAILURE;
+		}
 
 		/* We didn't find enough points to do anything, even if they are all within eps. */
 		if (cxt.num_items_found < min_points)

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

Summary of changes:
 NEWS                            |  2 ++
 liblwgeom/lwgeom_geos_cluster.c | 19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list