Skip to contents

Applies each supplied filter in turn and returns the layers that satisfy all of them. Layers whose readme leaves a filtered field blank cannot be tested, so they are excluded — a filter narrows to layers known to match, and check_metadata() shows which readmes are keeping a layer out.

Usage

find_layer(
  theme = NULL,
  keyword = NULL,
  year = NULL,
  extent = NULL,
  resolution = NULL,
  crs = NULL,
  verbose = TRUE,
  ...
)

Arguments

theme

Optional character; theme folder name(s).

keyword

Optional character; matched case-insensitively against title, keywords, abstract, and layer name. Multiple keywords match layers containing any of them.

year

Optional numeric; a single year or a c(min, max) range, tested against the layer's vintage.

extent

Optional numeric c(xmin, xmax, ymin, ymax) in decimal degrees; keeps layers whose bounding box overlaps it.

resolution

Optional numeric; a single resolution in metres or a c(min, max) range.

crs

Optional character; matched case-insensitively against both the authority code and the CRS name, so "3400", "EPSG:3400", and "Alberta 10-TM" all work. Only readmes carrying a Coordinate Reference System block can be matched; check_metadata() shows which ones do not.

verbose

Logical; if TRUE (default), print the matches.

...

Passed to build_catalogue().

Value

A data.frame of matching layers, invisibly when verbose = TRUE.

Examples

if (FALSE) { # \dontrun{
find_layer(keyword = "elevation")
find_layer(year = c(2015, 2024), resolution = c(0, 100))
find_layer(extent = c(-120, -110, 49, 60))
} # }