PostGIS  2.5.7dev-r@@SVN_REVISION@@
lwgeom_geos_cluster.c File Reference
#include <string.h>
#include "liblwgeom.h"
#include "liblwgeom_internal.h"
#include "lwgeom_log.h"
#include "lwgeom_geos.h"
#include "lwunionfind.h"
Include dependency graph for lwgeom_geos_cluster.c:

Go to the source code of this file.

Data Structures

struct  QueryContext
 
struct  STRTree
 

Functions

static struct STRTree make_strtree (void **geoms, uint32_t num_geoms, char is_lwgeom)
 Make a GEOSSTRtree that stores a pointer to a variable containing the array index of the input geoms. More...
 
static void destroy_strtree (struct STRTree *tree)
 Clean up STRTree after use. More...
 
static int union_intersecting_pairs (GEOSGeometry **geoms, uint32_t num_geoms, UNIONFIND *uf)
 
static int combine_geometries (UNIONFIND *uf, void **geoms, uint32_t num_geoms, void ***clusterGeoms, uint32_t *num_clusters, char is_lwgeom)
 Uses a UNIONFIND to identify the set with which each input geometry is associated, and groups the geometries into GeometryCollections. More...
 
static GEOSGeometry * geos_envelope_surrogate (const LWGEOM *g)
 
static void query_accumulate (void *item, void *userdata)
 
int cluster_intersecting (GEOSGeometry **geoms, uint32_t num_geoms, GEOSGeometry ***clusterGeoms, uint32_t *num_clusters)
 Takes an array of GEOSGeometry* and constructs an array of GEOSGeometry*, where each element in the constructed array is a GeometryCollection representing a set of interconnected geometries. More...
 
static int dbscan_update_context (GEOSSTRtree *tree, struct QueryContext *cxt, LWGEOM **geoms, uint32_t p, double eps)
 
static void union_if_available (UNIONFIND *uf, uint32_t p, uint32_t q, char *is_in_core, char *in_a_cluster)
 
static int union_dbscan_minpoints_1 (LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double eps, char **in_a_cluster_ret)
 
static int union_dbscan_general (LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double eps, uint32_t min_points, char **in_a_cluster_ret)
 
int union_dbscan (LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double eps, uint32_t min_points, char **in_a_cluster_ret)
 
int cluster_within_distance (LWGEOM **geoms, uint32_t num_geoms, double tolerance, LWGEOM ***clusterGeoms, uint32_t *num_clusters)
 Takes an array of LWGEOM* and constructs an array of LWGEOM*, where each element in the constructed array is a GeometryCollection representing a set of geometries separated by no more than the specified tolerance. More...
 

Variables

static const int STRTREE_NODE_CAPACITY = 10