Select a subset of points at a minimum tolerance distance from each other.

representative_points(x, dTolerance)

Arguments

x

Object of class sf

dTolerance

Numeric. Distance tolerance in m.

Value

Object of class sf with a subset of the original locations in x.

Examples

## 50 points in the unit square require(sf) x <- st_sfc(st_multipoint(matrix(runif(100), ncol = 2)), crs = 3857) representative_points(x, .5)
#> Simple feature collection with 4 features and 0 fields #> geometry type: POINT #> dimension: XY #> bbox: xmin: 0.0132726 ymin: 0.05817565 xmax: 0.9931181 ymax: 0.9845655 #> epsg (SRID): 3857 #> proj4string: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs #> geometry #> 1 POINT (0.9931181 0.5361333) #> 2 POINT (0.3072737 0.9845655) #> 3 POINT (0.0132726 0.05817565) #> 4 POINT (0.468959 0.4530892)