| thin | R Documentation |
thin return a subset of geometries such that all remaining geometries are at least d apart from each other. This uses greedy spatial thinning: the first geometry is always kept, and subsequent geometries are only kept if they are at least d away from all previously kept geometries.
thinNodes reduces the number of nodes to represent line or polygon geometries
## S4 method for signature 'SpatVector'
thin(x, d, unit="m")
## S4 method for signature 'SpatVector'
thinNodes(x, d, unit="m", makeValid=TRUE)
x |
SpatVector |
d |
positive numeric. The minimum distance between geometries or nodes |
unit |
character. |
makeValid |
logical. If |
SpatVector
densify, distance, nearby, nearest
p <- vect( matrix(c(0, .5, .6, 5, 5.5, 50), ncol=2, nrow=6), crs="lonlat")
values(p) <- data.frame(id=1:6)
nrow(p)
# points that are at least 200 km apart
p2 <- thin(p, 200000)
nrow(p2)
# same, using km
p3 <- thin(p, 200, unit="km")
nrow(p3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.