cartagen.quadtree_selection#
- quadtree_selection(points, depth, column, quadtree=False)#
Reduce a set of points by selection using a quadtree.
For each quadtree cell, the point with the largest value is selected.
This algorithm was proposed by Bereuter & Weibel. [1] The quadtree algorithm iteratively divide the point set into four chunks, creating clusters, until the depth parameter is reach or only one point remain per cluster.
- Parameters:
points (
GeoDataFrameofPoint) – The points to reduce.depth (
int) – The maximum depth of the quadtree. This acts as a selector for the wanted degree of generalisation. The lower the value, the more generalised the point set will be.column (
str) – Name of the column to use.quadtree (
bool, optional) – If set to True, returns a tuple with the reduced points and the quadtree.
- Returns:
points (
GeoDataFrameofPoint) – The provided set of points with two new attributes:’selected_quadtree’: Set to True if the point has been selected.
’cell_count’: The number of points in the quadtree cell represented by this point.
quadtree (
QuadTree, optional)
See also
quadtree_simplificationReduce a set of points by simplification using a quadtree.
quadtree_aggregationReduce a set of points by aggregation using a quadtree.
References