Package {tmap.sources}


Title: Data Sources for 'tmap'
Version: 0.1
Description: Provides support for a variety of spatial data sources in 'tmap', including remote, tiled, and streaming formats. Enables the use of external vector and raster data without requiring full data import, facilitating efficient visualization workflows.
License: GPL-3
Encoding: UTF-8
Depends: R (≥ 4.1)
Imports: tmap (≥ 4.3), sf, httr2, jsonlite, freestiler, data.table, servr, cli
Suggests: tmap.mapgl (≥ 0.2-1)
Config/Needs/website: bookdown, rmarkdown, r-tmap/tmap, walkerke/mapgl, r-tmap/tmap.mapgl
URL: https://github.com/r-tmap/tmap.sources
BugReports: https://github.com/r-tmap/tmap.sources/issues
Config/roxygen2/version: 8.0.0
NeedsCompilation: no
Packaged: 2026-05-28 08:29:14 UTC; mtes
Author: Martijn Tennekes [aut, cre]
Maintainer: Martijn Tennekes <mtennekes@gmail.com>
Repository: CRAN
Date/Publication: 2026-06-01 08:40:02 UTC

Derived accessors for tmap source metadata

Description

Convenience functions to extract specific parts of the metadata object returned by tmap_src_meta.

Usage

tmap_src_layers(meta)

tmap_src_vars(meta, layer = NULL)

tmap_src_cats(meta, layer = NULL, var)

Arguments

meta

List. Output of tmap_src_meta.

layer

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

var

Character. Variable name within the layer.

Value

tmap_src_layers

Character vector of layer names.

tmap_src_vars

Data frame with columns variable, class, categories (list-column), and palette (list-column) for all variables in the layer.

tmap_src_cats

A list with elements categories (character vector of known category values) and palette (named character vector of hex colours), both NULL when no catalogue entry exists for layer.var.

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")

Get tmap source metadata

Description

Returns all known metadata for a PMTiles source. For Overture Maps URLs, the layer_vars data frames are automatically annotated with categories and palette list-columns for variables that have a known closed value set.

Usage

tmap_src_meta(x)

Arguments

x

URL or local file path to a PMTiles source.

Value

A list with elements: input, type, tile_type, url, layers, layer_vars, bbox, zoom. Each element of layer_vars is a data frame with columns variable, class, categories (list), palette (list).


Get Overture Maps PMTiles URLs

Description

Returns a named list of PMTiles URLs for all Overture themes. When release = "latest" (default), the version is resolved via the Overture STAC catalog at runtime.

Usage

tmap_src_overture(release = "latest")

Arguments

release

Character. "latest" or an explicit release string such as "2026-03-18" or "2026-03-18.0".

Value

Named list of URLs: addresses, base, buildings, divisions, places, transportation.