
Generate a Baseline Layer Manifest from an Existing Project
Source:R/rfp_manifest_create.R
rfp_manifest_create.RdCreates the per-project manifest (see rfp_manifest_read()) from the
layers already present in a project's background_layers.gpkg. Layers
found in the template registry get their registry source_type;
non-registry layers land as "frozen" - a curation placeholder, not a
verdict. Curation happens by editing the CSV afterwards.
Usage
rfp_manifest_create(
path,
template = NULL,
path_out = NULL,
dir_layers = NULL,
file_gpkg = NULL,
layout = NULL
)Arguments
- path
Character. Path to the project directory containing
background_layers.gpkg.- template
Character. Template name passed to
rfp_project_layers()for registrysource_typelookup.NULL(default) uses the template recorded in the project'srfp_project.json, falling back to"bcfishpass_mobile"for a project created before that was written. An explicit value always wins.- path_out
Character. Where to write the manifest CSV. Default
NULLwritesrfp_manifest.csvat the project root (the canonical home - it syncs with the project).- dir_layers
Character. Directory holding one GeoPackage per layer.
NULL(default) resolvesgetOption("rfp.dir_layers").- file_gpkg
Character. Single-GeoPackage file name for projects that have not been split.
NULL(default) resolvesgetOption("rfp.file_gpkg").- layout
Character.
"split","monolith", orNULL(default) to detect from the project directory.
Details
The AOI layer whse_basemapping.fwa_watershed_groups_poly is
force-included as "bcdata" (every source pass rewrites it
unconditionally). The rfp whitelist tables (rfp_tracking,
parameters_*) and the legacy unprefixed AOI layer (#71) are excluded.
Refuses to overwrite an existing manifest - curated manifests are edited in place, not regenerated.
Examples
# Build a manifest for the bundled fixture project
project <- file.path(tempdir(), "manifest_example")
dir.create(project)
file.copy(
system.file("testdata", "subset_fixture", "parent",
"background_layers.gpkg", package = "rfp"),
project
)
#> [1] TRUE
manifest <- rfp_manifest_create(project)
#> ✔ Wrote /tmp/RtmpfSNDuG/manifest_example/rfp_manifest.csv
#> bcdata: 1
#> fwa: 0
#> aws: 0
#> osm: 0
#> url: 0
#> stac: 0
#> frozen: 4
#> ℹ 4 layers landed as 'frozen' (not in the bcfishpass_mobile registry) - a curation placeholder. Edit the CSV to flip any that have a live download identifier.
manifest
#> # A tibble: 5 × 2
#> source_layer source_type
#> <chr> <chr>
#> 1 whse_basemapping.fwa_watershed_groups_poly bcdata
#> 2 lakes frozen
#> 3 roads frozen
#> 4 streams frozen
#> 5 unused_sentinel frozen
unlink(project, recursive = TRUE)