Returns a tibble describing each field in the dataset, including its API name, data type, display label, and description. Results are cached for the duration of the R session.

This function is called internally by [get_cov_data()] when `cast_types = TRUE` to determine column types and identify spatial fields.

get_cov_metadata(
  dataset_id,
  apikey = getOption("VancouverOpenDataApiKey"),
  refresh = FALSE
)

Arguments

dataset_id

the CoV open data dataset id

apikey

the CoV open data API key, optional

refresh

Bypass the session cache and re-download, default `FALSE`

Value

A tibble with one row per field and columns:

name

Field name as used in `where` and `select` queries

type

API data type (e.g. `"text"`, `"int"`, `"double"`, `"date"`, `"geo_shape"`)

label

Human-readable display label

description

Field description, if provided by the portal

See also

[get_cov_data()], [list_cov_datasets()]

Examples

if (FALSE) { # \dontrun{
# View all fields in the street trees dataset
get_cov_metadata("street-trees")

# Find which fields are spatial
get_cov_metadata("property-parcel-polygons") |>
  dplyr::filter(type == "geo_shape")
} # }