[postgis-tickets] r14531 - #3411, Clustering functions not using spatial index

Daniel Baston dbaston at gmail.com
Mon Dec 28 14:29:59 PST 2015


Author: dbaston
Date: 2015-12-28 14:29:59 -0800 (Mon, 28 Dec 2015)
New Revision: 14531

Modified:
   branches/2.2/NEWS
   branches/2.2/liblwgeom/lwgeom_geos_cluster.c
Log:
#3411, Clustering functions not using spatial index

Modified: branches/2.2/NEWS
===================================================================
--- branches/2.2/NEWS	2015-12-28 22:23:25 UTC (rev 14530)
+++ branches/2.2/NEWS	2015-12-28 22:29:59 UTC (rev 14531)
@@ -22,6 +22,7 @@
   - #3404, ST_ClusterWithin crashes backend
   - #3407, Fix crash on splitting a face or an edge
            defining multiple TopoGeometry objects
+  - #3411, Clustering functions not using spatial index
   - Fix memory leak in lwt_ChangeEdgeGeom [liblwgeom]
 
 

Modified: branches/2.2/liblwgeom/lwgeom_geos_cluster.c
===================================================================
--- branches/2.2/liblwgeom/lwgeom_geos_cluster.c	2015-12-28 22:23:25 UTC (rev 14530)
+++ branches/2.2/liblwgeom/lwgeom_geos_cluster.c	2015-12-28 22:29:59 UTC (rev 14531)
@@ -17,6 +17,8 @@
 #include "lwgeom_geos.h"
 #include "lwunionfind.h"
 
+static const int STRTREE_NODE_CAPACITY = 10;
+
 /* Utility struct used to pass information to the GEOSSTRtree_query callback */
 struct UnionIfIntersectingContext
 {
@@ -58,7 +60,7 @@
 make_strtree(void** geoms, uint32_t num_geoms, char is_lwgeom)
 {
 	struct STRTree tree;
-	tree.tree = GEOSSTRtree_create(num_geoms);
+	tree.tree = GEOSSTRtree_create(STRTREE_NODE_CAPACITY);
 	if (tree.tree == NULL)
 	{
 		return tree;



More information about the postgis-tickets mailing list