powered by
makeNodes create nodes on lines
makeNodes
mergeLines connect lines to form polygons
mergeLines
removeDupNodes removes duplicate nodes in geometries and optionally rounds the coordinates
removeDupNodes
emptyGeoms returns the indices of empty (null) geometries. is.na also checks if any of the coordinates is NA.
emptyGeoms
is.na
NA
snap makes boundaries of geometries identical if they are very close to each other.
snap
# S4 method for SpatVector mergeLines(x) # S4 method for SpatVector snap(x, y=NULL, tolerance) # S4 method for SpatVector removeDupNodes(x, digits = -1) # S4 method for SpatVector makeNodes(x)
SpatVector
SpatVector of lines or polygons
SpatVector of lines or polygons to snap to. If NULL snapping is to the other geometries in x
NULL
x
numeric. Snapping tolerance (distance between geometries)
numeric. Number of digits used in rounding. Ignored if < 0
sharedPaths, gaps, simplifyGeom
sharedPaths
gaps
simplifyGeom
p1 <- as.polygons(ext(0,1,0,1)) p2 <- as.polygons(ext(1.1,2,0,1)) p <- rbind(p1, p2) y <- snap(p, tol=.15) plot(p, lwd=3, col="light gray") lines(y, col="red", lwd=2)
Run the code above in your browser using DataLab