Unified entry point for downloading BC spatial data layers into a GeoPackage.
Calls shell scripts that use bcdata, ogr2ogr, fio, and rio CLI tools.
Usage
rfp_source(
type = c("bcdata", "fwa", "aws"),
watershed_groups,
path_gpkg = "background_layers.gpkg",
layers = NULL
)Arguments
- type
Character. One of
"bcdata","fwa", or"aws".- watershed_groups
Character vector of BC watershed group codes (e.g.,
c("BULK", "KLUM")).- path_gpkg
Character. Path to the output GeoPackage file. Created by the
bcdatatype; required to exist forfwaandawstypes.- layers
Character vector. Specific layer names to download. If
NULL(default), uses the default layer list frominst/lookups/. When provided, a temporary layer list file is created and passed to the shell script.
Details
Three source types are available:
- bcdata
BC Data Catalogue layers via the bcdata CLI. Layers controlled by
inst/lookups/rfp_source_bcdata.txt.- fwa
Freshwater Atlas layers from the Hillcrest Geo feature service. Layers controlled by
inst/lookups/rfp_source_fwa.txt.- aws
S3-hosted FlatGeoBuf files, model parameters, and lateral habitat raster from bcfishpass. Layers controlled by
inst/lookups/rfp_source_aws.txt. Requires an existing GeoPackage from a priorbcdatarun.
For downloading a single BC Data Catalogue layer in pure R (no Python CLI needed),
see rfp_source_bcdata().
