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

Daniel Baston dbaston at gmail.com
Mon Dec 28 14:23:25 PST 2015


Author: dbaston
Date: 2015-12-28 14:23:25 -0800 (Mon, 28 Dec 2015)
New Revision: 14530

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

Modified: trunk/liblwgeom/lwgeom_geos_cluster.c
===================================================================
--- trunk/liblwgeom/lwgeom_geos_cluster.c	2015-12-28 17:18:42 UTC (rev 14529)
+++ trunk/liblwgeom/lwgeom_geos_cluster.c	2015-12-28 22:23:25 UTC (rev 14530)
@@ -22,7 +22,6 @@
  *
  **********************************************************************/
 
-
 #include <string.h>
 #include "liblwgeom.h"
 #include "liblwgeom_internal.h"
@@ -30,6 +29,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
 {
@@ -71,7 +72,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