aggregate_points | R Documentation |
Function to aggregate points within a radius.
aggregate_points(points, maxdist, weight = "weight", return_ids = FALSE)
points |
The feature collection of points to contract (must have a weight column) |
maxdist |
The distance to use |
weight |
The name of the column to use as weight (default is "weight"). The values of the aggregated points for this column will be summed. For all the other columns, only the max value is retained. |
return_ids |
A boolean (default is FALSE), if TRUE, then an index indicating for each point the group it belongs to is returned. If FALSE, then a spatial point features is returned with the points already aggregated. |
This function can be used to aggregate points within a radius. This is done by using the dbscan algorithm. This process is repeated until no more modification is applied.
A new feature collection of points
data(bike_accidents)
bike_accidents$weight <- 1
agg_points <- aggregate_points(bike_accidents, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.