[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.2-39-g9fabbeaee
git at osgeo.org
git at osgeo.org
Fri Mar 31 13:02:55 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.3 has been updated
via 9fabbeaeed3308f08bb200b7e1bd330cec14e817 (commit)
via 1f354de62877551621d3f7e0db73108f260052f5 (commit)
from 887efa9ed30f9d2350b58e3a6c9e0e9464df6498 (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 9fabbeaeed3308f08bb200b7e1bd330cec14e817
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Fri Mar 31 13:02:48 2023 -0700
Add news entry for #5363
diff --git a/NEWS b/NEWS
index edc1543d3..3841fe3c4 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ YYYY/MM/DD
- #5347, _ST_BestSRID crashes on ARM with infinite geometries (Regina Obe)
- #5331, [postgis_tiger_geocoder] reverse_geocode, prefer addressable ranges
(Regina Obe, Locance)
+ - #5363, Make ST_ClusterDBScan interruptable (Paul Ramsey)
PostGIS 3.3.2
commit 1f354de62877551621d3f7e0db73108f260052f5
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 | 1 +
liblwgeom/lwgeom_geos_cluster.c | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list