Skip to contents

Returns the summary geometry type for the sfc column in the data.frame. When the column contains mixed types, st_geometry_type() with by_geometry = FALSE returns the shared type or "GEOMETRY". gg2d3 renders polygon, point, and line geom_sf() families.

Usage

detect_dominant_geom_type(df)

Arguments

df

A data.frame from ggplot_build()$data[[i]] containing an sfc column

Value

Character string such as "MULTIPOLYGON", "POLYGON", "POINT", "LINESTRING", etc.