Skip to contents

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().