cartagen.quadtree_simplification#
- quadtree_simplification(points, depth, quadtree=False)#
Reduce a set of points by simplification using a quadtree.
For each quadtree cell, the point closest to the cluster’s centroid 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.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_kmeans’: Set to True if the point has been selected.
quadtree (
QuadTree, optional)
See also
quadtree_selectionReduce a set of points by selection using a quadtree.
quadtree_aggregationReduce a set of points by aggregation using a quadtree.
References