% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/funs_pmtiles2.R
\name{tmap_src_accessors}
\alias{tmap_src_accessors}
\alias{tmap_src_layers}
\alias{tmap_src_vars}
\alias{tmap_src_cats}
\title{Derived accessors for tmap source metadata}
\usage{
tmap_src_layers(meta)

tmap_src_vars(meta, layer = NULL)

tmap_src_cats(meta, layer = NULL, var)
}
\arguments{
\item{meta}{List. Output of \code{\link{tmap_src_meta}}.}

\item{layer}{Character. Layer name. May be omitted when the source has
exactly one layer; required otherwise.}

\item{var}{Character. Variable name within the layer.}
}
\value{
\describe{
\item{\code{tmap_src_layers}}{Character vector of layer names.}
\item{\code{tmap_src_vars}}{Data frame with columns \code{variable},
\code{class}, \code{categories} (list-column), and \code{palette}
(list-column) for all variables in the layer.}
\item{\code{tmap_src_cats}}{A list with elements \code{categories}
(character vector of known category values) and \code{palette}
(named character vector of hex colours), both \code{NULL} when no
catalogue entry exists for \code{layer.var}.}
}
}
\description{
Convenience functions to extract specific parts of the metadata object
returned by \code{\link{tmap_src_meta}}.
}
\examples{
urls <- tmap_src_overture()
meta <- tmap_src_meta(urls$buildings)

tmap_src_layers(meta)

tmap_src_vars(meta, layer = "building")

tmap_src_cats(meta, layer = "building", var = "subtype")
}
