sf_to_polygons: Convert an sf atlas geometry to the sf-optional polygon...

View source: R/atlas_polygons.R

sf_to_polygonsR Documentation

Convert an sf atlas geometry to the sf-optional polygon format

Description

Extracts coordinates from an sf-backed atlas geometry table and returns a nested data.frame keyed by label. Each row carries a geometry list-column containing the per-view, per-ring point coordinates needed to render with graphics::polypath() (using the subgroup ring index for holes).

Usage

sf_to_polygons(sf_data)

Arguments

sf_data

An sf-class data.frame with columns label, view, geometry (sfc of MULTIPOLYGON).

Value

A data.frame with one row per label and a geometry list-column. Each nested element is a data.frame with columns view, x, y, group (disjoint polygon piece within a label/view), subgroup (ring within a piece; first = exterior, rest = holes).

Internal conversion primitive. For the atlas-level public API use as_polygon_atlas() / atlas_polygons().


ggseg.formats documentation built on July 2, 2026, 5:07 p.m.