fop_query_collection_observation: Query BC Fish Observation Collection

View source: R/collection.R

fop_query_collection_observationR Documentation

Query BC Fish Observation Collection

Description

Query a collection from the BC Fish Observation API.

Usage

fop_query_collection_observation(
  collection_id,
  filter = NULL,
  limit = 10000,
  offset = 0,
  bbox = NULL,
  properties = NULL,
  transform = NULL,
  sortby = NULL,
  groupby = NULL
)

Arguments

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. list(gnis_name = "Sangan River").

limit

A positive whole number that limits the number of features in the response.

offset

A positive whole number that starts the response at an offset.

bbox

A vector of four numbers indicating bounding box in lon/lat (e.g. c(minLon, minLat, maxLon, maxLat)) that features in response must intersect.

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)).

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.

See Also

Other collections: fop_collection_observation_properties(), fop_collection_passage_properties(), fop_collections_observation(), fop_collections_passage(), fop_query_collection_passage()

Examples

library(sf)
collection_id <- "bcfishobs.fiss_fish_obsrvtn_events_sp"
filter <- list(species_code = "CO", watershed_group_code = "CLAY")
fop_query_collection_observation(collection_id, filter = filter)

poissonconsulting/fishobspgr documentation built on Nov. 5, 2024, 4:37 a.m.