GEOS 3.14.0dev
|
#include <AbstractClusterFinder.h>
Public Member Functions | |
Clusters | cluster (const std::vector< const geom::Geometry * > &g) |
std::vector< std::unique_ptr< geom::Geometry > > | clusterToVector (std::unique_ptr< geom::Geometry > &&g) |
std::vector< std::unique_ptr< geom::Geometry > > | clusterToVector (const geom::Geometry &g) |
std::unique_ptr< geom::Geometry > | clusterToCollection (std::unique_ptr< geom::Geometry > &&g) |
std::unique_ptr< geom::Geometry > | clusterToCollection (const geom::Geometry &g) |
Protected Member Functions | |
virtual bool | shouldJoin (const geom::Geometry *a, const geom::Geometry *b)=0 |
virtual const geom::Envelope & | queryEnvelope (const geom::Geometry *a)=0 |
virtual Clusters | process (const std::vector< const geom::Geometry * > &components, index::strtree::TemplateSTRtree< std::size_t > &index, UnionFind &uf) |
AbstractClusterFinder defines an interface for bottom-up clustering algorithms, where spatial index queries can be used to identify geometries that should be clustered together.
Clusters geos::operation::cluster::AbstractClusterFinder::cluster | ( | const std::vector< const geom::Geometry * > & | g | ) |
Cluster the provided geometries, returning an object that provides access to the components of each cluster.
g | A vector of geometries to cluster |
std::unique_ptr< geom::Geometry > geos::operation::cluster::AbstractClusterFinder::clusterToCollection | ( | const geom::Geometry & | g | ) |
Cluster the components of the provided geometry, returning a GeometryCollection. The input geometry will not be modified.
g | A geometry whose components should be clustered. |
std::unique_ptr< geom::Geometry > geos::operation::cluster::AbstractClusterFinder::clusterToCollection | ( | std::unique_ptr< geom::Geometry > && | g | ) |
Cluster the components of the provided geometry, returning a GeometryCollection. This function will take ownership of the provided geometry. Any components that are included in a cluster will be returned. Components that are not included in any cluster will be destroyed.
g | A geometry whose components should be clustered. |
std::vector< std::unique_ptr< geom::Geometry > > geos::operation::cluster::AbstractClusterFinder::clusterToVector | ( | const geom::Geometry & | g | ) |
Cluster the components of the provided geometry, returning a vector of clusters. The input geometry will not be modified.
g | A geometry whose components should be clustered. |
std::vector< std::unique_ptr< geom::Geometry > > geos::operation::cluster::AbstractClusterFinder::clusterToVector | ( | std::unique_ptr< geom::Geometry > && | g | ) |
Cluster the components of the provided geometry, returning a vector of clusters. This function will take ownership of the provided geometry. Any components that are included in a cluster will be returned. Components that are not included in any cluster will be destroyed.
g | A geometry whose components should be clustered. |
|
protectedvirtual |
Given a vector and index of components,
components | a vector of Geometry components |
index | a spatial index storing pointers to those components |
uf | a UnionFind |
Reimplemented in geos::operation::cluster::DBSCANClusterFinder.
|
protectedpure virtual |
Provide an query Envelope that can be used to find all geometries possibly in the same cluster as the input.
a | Geometry |
Implemented in geos::operation::cluster::DBSCANClusterFinder, geos::operation::cluster::EnvelopeDistanceClusterFinder, geos::operation::cluster::EnvelopeIntersectsClusterFinder, geos::operation::cluster::GeometryDistanceClusterFinder, and geos::operation::cluster::GeometryIntersectsClusterFinder.
|
protectedpure virtual |
Determine whether two geometries should be considered in the same cluster.
a | Geometry |
b | Geometry |
true
if the clusters associated with a
and b
should be merged. Implemented in geos::operation::cluster::DBSCANClusterFinder, geos::operation::cluster::EnvelopeDistanceClusterFinder, geos::operation::cluster::EnvelopeIntersectsClusterFinder, geos::operation::cluster::GeometryDistanceClusterFinder, and geos::operation::cluster::GeometryIntersectsClusterFinder.