Skip to contents

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.

Usage

as_sf_atlas(atlas)

Arguments

atlas

A ggseg_atlas (or legacy brain_atlas) object.

Value

A ggseg_atlas whose $data$geom is an sf object.

Details

Conversion is lossless, so a single representation is kept (no redundant polygons alongside sf).

Examples

if (FALSE) { # \dontrun{
library(sf)
atlas <- as_sf_atlas(as_polygon_atlas(dk()))
st_buffer(atlas_geom(atlas)$geometry[[1]], dist = 2)
} # }