PostGIS  2.2.8dev-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  UnionIfIntersectingContext
 
struct  UnionIfDWithinContext
 
struct  STRTree
 

Functions

static struct STRTree make_strtree (void **geoms, uint32_t num_geoms, char is_lwgeom)
 Make a GEOSSTRtree of either GEOSGeometry* or LWGEOM* pointers. More...
 
static void destroy_strtree (struct STRTree tree)
 Clean up STRTree after use. More...
 
static void union_if_intersecting (void *item, void *userdata)
 
static void union_if_dwithin (void *item, void *userdata)
 
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 int union_pairs_within_distance (LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double tolerance)
 
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...
 
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