[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-697-g130741bfe
git at osgeo.org
git at osgeo.org
Fri Mar 31 13:01:25 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, master has been updated
via 130741bfe3ac7f80744aa570796cba67b7cd0eb3 (commit)
via 9be511a0523940796d21e4a3e6e72cd4f91f8c75 (commit)
from 0dae51d2620920f2a21bcb5feaa59b020db83a38 (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 130741bfe3ac7f80744aa570796cba67b7cd0eb3
Merge: 0dae51d26 9be511a05
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Fri Mar 31 13:01:14 2023 -0700
Merge branch 'master-dbscan-interrupt'
commit 9be511a0523940796d21e4a3e6e72cd4f91f8c75
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 091de6bf1..c2378bfe4 100644
--- a/liblwgeom/lwgeom_geos_cluster.c
+++ b/liblwgeom/lwgeom_geos_cluster.c
@@ -265,6 +265,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);
@@ -346,10 +349,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]);
@@ -421,11 +430,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:
liblwgeom/lwgeom_geos_cluster.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list