Skip to contents

The one rule rpic_sf() names its columns by: every : and - of a GeoJSON property name becomes _, so all columns are syntactic R names in snake_case. Use it to translate the engine's vocabulary (its docs/geopic.md, the MapLibre layers' expressions) to columns.

Usage

rpic_sf_names(x)

Arguments

x

GeoJSON property names (a character vector).

Value

the column names, a character vector as long as x.

Details

GeoJSON propertyrpic_sf() column
stroke, fill, titlestroke, fill, title
stroke-width, stroke-opacity, fill-opacitystroke_width, stroke_opacity, fill_opacity
geopic:schema, geopic:id, geopic:kind, geopic:zgeopic_schema, geopic_id, geopic_kind, geopic_z
geopic:label, geopic:block, geopic:class, geopic:linkgeopic_label, geopic_block, geopic_class, geopic_link
geopic:text, geopic:rotation, geopic:anchor, geopic:font_sizegeopic_text, geopic_rotation, geopic_anchor, geopic_font_size
geopic:font_weight, geopic:font_style, geopic:font_familygeopic_font_weight, geopic_font_style, geopic_font_family
geopic:dash, geopic:hatch, geopic:placement, geopic:forgeopic_dash, geopic_hatch, geopic_placement, geopic_for
geopic:head, geopic:filled, geopic:part, geopic:role, geopic:radius_ingeopic_head, geopic_filled, geopic_part, geopic_role, geopic_radius_in

The GeoJSON text itself (rpic_geojson(), the "geojson" attribute of an rpic_sf() result) keeps the engine's names; the MapLibre layers read those.

Examples

rpic_sf_names(c("geopic:kind", "stroke-width", "fill-opacity", "title"))
#> [1] "geopic_kind"  "stroke_width" "fill_opacity" "title"