st_misc | R Documentation |
Support both bbox
and sf
objects as inputs.
st_scale_rotate(x, scale = 1, rotate = 0) st_center(x, ext = TRUE, ...) st_square(x, scale = 1, rotate = 0, inscribed = FALSE) st_inscribed_square(x, scale = 1, rotate = 0) st_circle(x, scale = 1, inscribed = FALSE, dTolerance = 0) st_circumscribed_circle(x, scale = 1)
x |
A sf, sfc, or bbox object |
scale |
numeric; scale factor, Default: 1 |
rotate |
numeric; degrees to rotate (-360 to 360), Default: 0 |
ext |
If |
... |
Additional parameters passed to |
inscribed |
If |
dTolerance |
numeric; tolerance parameter, specified for all or for each
feature geometry. If you run |
Scale or rotate a simple feature or bounding box object using affine transformations
Get the center point for a sf
object
Get a circumscribed square or approximate inscribed square in a sf
object
Get a circumscribed circle or inscribed circle in a sf
object
st_inscribed_square wraps sf::st_inscribed_circle()
but limits the circle
to 1 segment per quadrant (nQuadSegs = 1
) and then rotates the resulting
geometry 45 degrees to provide a (mostly) inscribed square. A different
rotation value can be provided to change the orientation of the shape, e.g.
rotate = -45
to return a diamond shape. st_square()
wraps st_bbox_ext()
with
asp = 1
.
sf::geos_unary
nc <- read_sf_path(system.file("shape/nc.shp", package = "sf")) nc <- st_transform_ext(nc, crs = 3857) basemap <- ggplot2::ggplot() + ggplot2::geom_sf(data = nc) + ggplot2::theme_void() basemap + layer_location_data( data = st_scale_rotate(nc, scale = 0.5, rotate = 15), fill = NA, color = "red" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.