Skip to contents

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 bcdata type; required to exist for fwa and aws types.

layers

Character vector. Specific layer names to download. If NULL (default), uses the default layer list from inst/lookups/. When provided, a temporary layer list file is created and passed to the shell script.

Value

Invisible character path to the GeoPackage.

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 prior bcdata run.

For downloading a single BC Data Catalogue layer in pure R (no Python CLI needed), see rfp_source_bcdata().

Examples

if (FALSE) { # \dontrun{
rfp_source("bcdata", c("ADMS"))
rfp_source("fwa", c("ADMS"))
rfp_source("aws", c("ADMS"))
} # }