knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(ggplot2) library(sf) library(fwapgr)
fwapgr
is an R package that uses the fwapg API to query the Freshwater Atlas (FWA) of British Columbia (BC).
The functions and arguments in fwapgr
match those available in the API.
If you are looking for a higher-level R package to query the FWA of BC see fwatlasbc
which wraps fwapgr
.
To install the lastest version from GitHub
# install.packages("devtools") devtools::install_github("poissonconsulting/pgfeatureserv") devtools::install_github("poissonconsulting/fwapgr")
fwapgr
allows you to perform three types of operation.
Get information about the collections or a collection's properties:
Query features from a collection:
Execute spatial functions:
fwa_index_point()
fwa_locate_along()
fwa_locate_along_interval()
fwa_watershed_at_measure()
fwa_watershed_hex()
fwa_watershed_stream()
hydroshed()
Get Sangan River from whse_basemapping.fwa_stream_networks_sp
collection:
coll <- "whse_basemapping.fwa_stream_networks_sp" river <- fwapgr::fwa_query_collection(coll, filter = list(gnis_name = "Sangan River")) river
Get simplified Yakoun River watershed starting 10km upstream:
blk <- river$blue_line_key[1] wshed <- fwapgr::fwa_watershed_at_measure( blk, downstream_route_measure = 10000, transform = c("ST_Simplify", 2000) )
ggplot2::ggplot() + ggplot2::geom_sf(data = wshed, lwd = 0.15, fill = "steelblue", alpha = 0.5) + ggplot2::geom_sf(data = river, lwd = 0.15)
fwapgr
relies on fwapg API which is created, maintained and hosted by Simon Norris at Hillcrest Geographics.
Please report any issues.
Pull requests are always welcome.
Please note that fwapgr
is released with a Contributor Code of Conduct.
By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.