Title: | Client for BC Freshwater Atlas fwapg API |
---|---|
Description: | Client for fwapg, a PostgreSQL database and web API for BC Freshwater Atlas data. |
Authors: | Sebastian Dalgarno [aut, cre] , Joe Thorley [aut] , Poisson Consulting [cph, fnd], Nadine Hussein [ctb] |
Maintainer: | Sebastian Dalgarno <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0.9015 |
Built: | 2024-11-01 16:20:12 UTC |
Source: | https://github.com/poissonconsulting/fwapgr |
Query a collection from the freshwater atlas.
fwa_collection( collection_id, filter = NULL, limit = 10000, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) ) fwa_query_collection( collection_id, filter = NULL, limit = 10000, offset = 0, bbox = NULL, properties = NULL, transform = NULL, sortby = NULL, groupby = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_collection( collection_id, filter = NULL, limit = 10000, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) ) fwa_query_collection( collection_id, filter = NULL, limit = 10000, offset = 0, bbox = NULL, properties = NULL, transform = NULL, sortby = NULL, groupby = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
collection_id |
A character string of the collection id. |
filter |
A named vector or list of the filter(s) to apply, where the list
names correspond to column names and the list values correspond to the desired
value, e.g. |
limit |
A positive whole number indicating the maximum number of features to return. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
offset |
A positive whole number indicating the offset of start of returned results. |
sortby |
A string that sorts the response items by a property. Default is ascending but property name can be prepended with '-' to indicate descending. |
groupby |
A string of the property name (i.e., column name) to group response features by. This would typically be used with an aggregate transform function. |
An sf object.
Other collections:
fwa_collection_properties()
,
fwa_collections()
collection_id <- "whse_basemapping.fwa_approx_borders" filter <- list(border = "USA_49") fwa_query_collection(collection_id, filter = filter) collection_id <- "whse_basemapping.fwa_stream_networks_sp" filter <- list(gnis_name = "Sangan River") fwa_query_collection(collection_id, filter = filter)
collection_id <- "whse_basemapping.fwa_approx_borders" filter <- list(border = "USA_49") fwa_query_collection(collection_id, filter = filter) collection_id <- "whse_basemapping.fwa_stream_networks_sp" filter <- list(gnis_name = "Sangan River") fwa_query_collection(collection_id, filter = filter)
Get information about a collection's column names.
fwa_collection_properties( collection_id, nocache = getOption("fwa.nocache", FALSE) ) fwa_meta_properties(collection_id, nocache = getOption("fwa.nocache", FALSE))
fwa_collection_properties( collection_id, nocache = getOption("fwa.nocache", FALSE) ) fwa_meta_properties(collection_id, nocache = getOption("fwa.nocache", FALSE))
collection_id |
A character string of the collection id. |
nocache |
A flag specifying whether or not to cache results. |
A tibble.
Other collections:
fwa_collection()
,
fwa_collections()
fwa_collection_properties("whse_basemapping.fwa_stream_networks_sp")
fwa_collection_properties("whse_basemapping.fwa_stream_networks_sp")
Get information about the collections.
fwa_collections(nocache = getOption("fwa.nocache", FALSE)) fwa_meta_collections(nocache = getOption("fwa.nocache", FALSE))
fwa_collections(nocache = getOption("fwa.nocache", FALSE)) fwa_meta_collections(nocache = getOption("fwa.nocache", FALSE))
nocache |
A flag specifying whether or not to cache results. |
A tibble.
Other collections:
fwa_collection()
,
fwa_collection_properties()
fwa_collections()
fwa_collections()
Gets the nearest point on a stream as the crow flies to the coordinates (within the tolerance).
fwa_index_point( x, y, srid = 4326, tolerance = 5000, limit = 1, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_index_point( x, y, srid = 4326, tolerance = 5000, limit = 1, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
x |
A number of the x coordinate. |
y |
A number of the y coordinate. |
srid |
A positive whole number of the epsg of the coordinates. |
tolerance |
A number of the tolerance in m. |
limit |
A positive whole number indicating the maximum number of features to return. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
To also return the second nearest point on a stream as the crow flies (within the tolerance)
set limit = 2
.
An sf object.
Other functions:
fwa_locate_along()
,
fwa_locate_along_interval()
,
fwa_watershed_at_measure()
,
fwa_watershed_hex()
,
fwa_watershed_stream()
,
hydroshed()
fwa_index_point(x = -132.26, y = 53.36)
fwa_index_point(x = -132.26, y = 53.36)
Gets the point on a stream corresponding to the river metre (downstream route measure).
fwa_locate_along( blue_line_key, downstream_route_measure = 0, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_locate_along( blue_line_key, downstream_route_measure = 0, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
blue_line_key |
A positive whole number of the stream blue line key. |
downstream_route_measure |
A positive number of the river metre. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
An sf object.
Other functions:
fwa_index_point()
,
fwa_locate_along_interval()
,
fwa_watershed_at_measure()
,
fwa_watershed_hex()
,
fwa_watershed_stream()
,
hydroshed()
fwa_locate_along(356308001, downstream_route_measure = 10000)
fwa_locate_along(356308001, downstream_route_measure = 10000)
Gets a regularly spaced set of points between two river metres.
fwa_locate_along_interval( blue_line_key, interval_length = 100, start_measure = 0, end_measure = NULL, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_locate_along_interval( blue_line_key, interval_length = 100, start_measure = 0, end_measure = NULL, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
blue_line_key |
A positive whole number of the stream blue line key. |
interval_length |
An integer of the interval distance in meters. |
start_measure |
An integer of the distance in meters upstream from the river mouth to start from. |
end_measure |
An integer of the distance in meters upstream from the river mouth to end at. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
An sf object.
Other functions:
fwa_index_point()
,
fwa_locate_along()
,
fwa_watershed_at_measure()
,
fwa_watershed_hex()
,
fwa_watershed_stream()
,
hydroshed()
fwa_locate_along_interval(356308001, interval_length = 10, start_measure = 0)
fwa_locate_along_interval(356308001, interval_length = 10, start_measure = 0)
Gets a polygon of the watershed at a specified river metre.
fwa_watershed_at_measure( blue_line_key, downstream_route_measure = 0, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_watershed_at_measure( blue_line_key, downstream_route_measure = 0, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
blue_line_key |
A positive whole number of the stream blue line key. |
downstream_route_measure |
A positive number of the river metre. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
The function selects and aggregate all the fundamental watershed polygons upstream of the fundamental watershed in which the point lies.
Depending on where the point is in the fundamental watershed one of four things can happen to the fundamental watershed.
If the point is < 50 m upstream from the bottom of the fundamental watershed then the fundamental watershed is included in the aggregation (recorded as KEEP in the refine_method property).
Else if the point is < 100m downstream from the top of the fundamental watershed then the fundamental watershed is not included in the aggregation (recorded as DROP in the refine_method property).
Else if the point is on a polygonal river/canal the fundamental watershed is cut across the banks of the river before being included in the aggregation (recorded as CUT in the refine_method property).
Otherwise something else happens (recorded as DEM in the refine_method property).
An sf object.
Other functions:
fwa_index_point()
,
fwa_locate_along()
,
fwa_locate_along_interval()
,
fwa_watershed_hex()
,
fwa_watershed_stream()
,
hydroshed()
fwa_watershed_at_measure(356308001, downstream_route_measure = 10000)
fwa_watershed_at_measure(356308001, downstream_route_measure = 10000)
Gets a 25m hexagon grid covering the fundamental watershed in which the river metre lies.
fwa_watershed_hex( blue_line_key, downstream_route_measure = 0, limit = 10000, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_watershed_hex( blue_line_key, downstream_route_measure = 0, limit = 10000, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
blue_line_key |
A positive whole number of the stream blue line key. |
downstream_route_measure |
A positive number of the river metre. |
limit |
A positive whole number indicating the maximum number of features to return. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
An sf object.
Other functions:
fwa_index_point()
,
fwa_locate_along()
,
fwa_locate_along_interval()
,
fwa_watershed_at_measure()
,
fwa_watershed_stream()
,
hydroshed()
## Not run: fwa_watershed_hex(356308001, downstream_route_measure = 10000) ## End(Not run)
## Not run: fwa_watershed_hex(356308001, downstream_route_measure = 10000) ## End(Not run)
Gets the upstream stream segment within the fundamental watershed.
fwa_watershed_stream( blue_line_key, downstream_route_measure = 0, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
fwa_watershed_stream( blue_line_key, downstream_route_measure = 0, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
blue_line_key |
A positive whole number of the stream blue line key. |
downstream_route_measure |
A positive number of the river metre. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
This is useful for adding stream network that was not included in the watershed at measure.
An sf object.
Other functions:
fwa_index_point()
,
fwa_locate_along()
,
fwa_locate_along_interval()
,
fwa_watershed_at_measure()
,
fwa_watershed_hex()
,
hydroshed()
fwa_watershed_stream(356308001, downstream_route_measure = 10000)
fwa_watershed_stream(356308001, downstream_route_measure = 10000)
Gets aggregated boundary of all hydroshed polygons upstream of the provided location.
hydroshed( x, y, srid = 4326, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
hydroshed( x, y, srid = 4326, bbox = NULL, properties = NULL, transform = NULL, epsg = 4326, nocache = getOption("fwa.nocache", FALSE) )
x |
A number of the x coordinate. |
y |
A number of the y coordinate. |
srid |
A positive whole number of the epsg of the coordinates. |
bbox |
A vector of four numbers indicating bounding box to limit output
features to, e.g. |
properties |
A vector of strings of the column names to include. If NULL (default), all columns are retained. |
transform |
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)) |
epsg |
A positive whole number of the epsg to transform features to. |
nocache |
A flag specifying whether or not to cache results. |
An sf object.
Other functions:
fwa_index_point()
,
fwa_locate_along()
,
fwa_locate_along_interval()
,
fwa_watershed_at_measure()
,
fwa_watershed_hex()
,
fwa_watershed_stream()
hydroshed(x = -132.26, y = 53.36)
hydroshed(x = -132.26, y = 53.36)