
Last chance! 50% off unlimited learning
Sale ends in
width
returns the minimum diameter of the geometry, defined as the smallest band that contains the geometry, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the geometry can be moved through, with a single rotation.
clearance
returns the minimum clearance of a geometry. The minimum clearance is the smallest amount by which a vertex could be moved to produce an invalid polygon, a non-simple linestring, or a multipoint with repeated points. If a geometry has a minimum clearance of 'mc', it can be said that:
No two distinct vertices in the geometry are separated by less than 'mc' No vertex is closer than 'mc' to a line segment of which it is not an endpoint. If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint whose points are identical, NA is returned.
# S4 method for SpatVector
width(x, as.lines=FALSE)
# S4 method for SpatVector
clearance(x, as.lines=FALSE)
numeric or SpatVector
SpatVector of lines or polygons
logical. If TRUE
lines are returned that define the width or clearance
minRect
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
width(v)
clearance(v)
Run the code above in your browser using DataLab