View source: R/atlas_polygon_converters.R
| as_sf_atlas | R Documentation |
Inverse of as_polygon_atlas(). Sets the single geom slot to an sf-class
geometry table, converting from polygons via sfheaders::sf_multipolygon()
if needed — sfheaders is pure Rcpp with no GDAL/GEOS/PROJ dependencies, so
the conversion itself does not require a full sf installation. Use this when
you want to run sf operations (buffers, intersections, CRS transforms) on
atlas geometry; those sf operations themselves still require sf.
as_sf_atlas(atlas)
atlas |
A |
Conversion is lossless, so a single representation is kept (no redundant polygons alongside sf).
A ggseg_atlas whose $data$geom is an sf object.
## Not run:
library(sf)
atlas <- as_sf_atlas(as_polygon_atlas(dk()))
st_buffer(atlas_geom(atlas)$geometry[[1]], dist = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.