knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
pgfeatureserv
is an R client for pg_featureserv, a RESTful web service that provides access to spatial data stored in PostGIS tables, as well as spatial processing capability based on PostGIS spatial functions.
For more information on pg_featureserv:
- User Guide
- API Summary
- Github Page
Get information about collections or a single collection:
pgf_collections()
pgf_collection_properties()
pgf_collection_description()
pgf_collection_crs()
pgf_collection_bbox()
pgf_collection_geometry_type()
Query features or a single feature from a collection:
Get information about functions or a single function:
Execute a spatial function and get result:
You can install the development version of pgfeatureserv from GitHub with:
# install.packages("devtools") devtools::install_github("poissonconsulting/pgfeatureserv")
Lookup available collections in BC Freshwater Atlas:
base_url <- "https://features.hillcrestgeo.ca/" path <- "fwa" collections <- pgfeatureserv::pgf_collections(base_url = base_url, path = path) collections$id
Get Sangan River from the stream network collection:
coll <- "whse_basemapping.fwa_stream_networks_sp" river <- pgfeatureserv::pgf_collection_features(coll, base_url = base_url, path = path, filter = list(gnis_name = "Sangan River")) class(river) river[1:5, 1:4]
Please note that the pgfeatureserv project 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.