]> granicus.if.org Git - postgis/commitdiff
#3411, Clustering functions not using spatial index
authorDaniel Baston <dbaston@gmail.com>
Mon, 28 Dec 2015 22:23:25 +0000 (22:23 +0000)
committerDaniel Baston <dbaston@gmail.com>
Mon, 28 Dec 2015 22:23:25 +0000 (22:23 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14530 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_geos_cluster.c

index 38e145fc48d0094db4c952a49690d21e8b2e2752..97a6fdb8542b9bcd0f637bbd56ab6c7588b44cea 100644 (file)
@@ -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 @@ static struct STRTree
 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;