Walks root, parses every dataset readme it finds, and returns
one row per documented layer. Folders holding spatial data with
no readme are recorded separately in the undocumented
attribute and reported by check_metadata().
Usage
build_catalogue(
root = spatial_root(),
files = TRUE,
refresh = FALSE,
quiet = FALSE
)Arguments
- root
Character; directory to scan. Defaults to
spatial_root().- files
Logical; if
TRUE(default), inventory each layer's files to populaten_files,size_mb, anddata_type. SetFALSEfor a faster, metadata-only scan.- refresh
Logical; if
TRUE, rescan even when a cached manifest exists. DefaultFALSE.- quiet
Logical; if
TRUE, suppress progress messages. DefaultFALSE.
Value
A data.frame with one row per layer — one per variant
where a product has them, otherwise one per product. Columns
are id (path relative to root), name (the product folder),
theme, product_id, variant (NA when the product has no
variant folders), the template metadata fields (see
as_metadata_row()), n_files, size_mb, data_type, path
(the folder holding the data), readme (the record defining
the row), and product_readme (equal to readme unless the
record is split). Carries the scan root and the
undocumented folders as attributes.
Details
The top-level _temp and _deprecated folders are skipped:
one is the share's scratch area, the other holds superseded
products, so the contents of neither are catalogued as layers or
reported as missing readmes.
The result is cached per root for the session, so list_layers()
and friends only pay for the scan once.
See also
list_layers() to query the manifest, check_metadata()
to audit it.
Examples
if (FALSE) { # \dontrun{
cat_df <- build_catalogue()
nrow(cat_df)
build_catalogue(refresh = TRUE, files = FALSE)
} # }