Skip to contents

This function downloads files from specified URLs and converts them into layers within a GeoPackage using the ogr2ogr command-line tool from GDAL. It optionally applies an SQL filter to the data during conversion if a query is specified.

Usage

rfp_source_url(path_gpkg, urls, query = NULL)

Arguments

path_gpkg

A string specifying the path to the output GeoPackage file.

urls

A character vector of URLs pointing to the files to be downloaded and converted.

query

An optional SQL query string to filter the data during the conversion process. If NULL (default), no filter is applied.

Value

Invisible NULL. This function is called for its side effects.

See also

Other source ogr2ogr gpkg: rfp_source_csv()

Examples

if (FALSE) { # \dontrun{
path_gpkg <- "background_layers.gpkg"
urls <- c(
  "https://newgraph.s3.us-west-2.amazonaws.com/bcfishpass.crossings_vw.fgb",
  "https://raw.githubusercontent.com/smnorris/bcfishpass/main/parameters/example_newgraph/parameters_habitat_thresholds.csv"
)
query <- "watershed_group_code in ('ADMS', 'KLUM')"
rfp_source_url(path_gpkg, urls, query)
} # }