Skip to contents

Returns the column that identifies each feature of layer. When the layer carries retrieval provenance, the answer comes from the source registry's declared key fields, so it matches the from_id_col / to_id_col values recorded in build_crosswalk() and build_intersection() output. Layers without provenance fall back to a name-pattern guess.

Usage

layer_id_col(layer)

Arguments

layer

An sf object or data.frame.

Value

Character scalar: the id column name.

Details

This is the supported way for a downstream caller to join a crosswalk or linked table back onto the layer geometry it came from.

Examples

layer_id_col(data.frame(PHU_ID = 2253, PHU_NAME_ENG = "Example"))
#> [1] "PHU_ID"