Check if a collection exists in an OGC API Features service
Source:R/get_feature_ogc.R
check_ogc_collection.RdA lightweight helper function that queries the /collections endpoint of an
OGC API using JSON. It verifies if a specified collection exists and provides
a helpful error message with valid names if it does not.
See also
Other topics on using web services:
add_wms_be_cartoweb(),
add_wmts_nl_brt(),
get_coverage_wcs(),
get_feature_ogc(),
get_feature_wfs(),
get_wcs_layers()
Examples
if (FALSE) { # \dontrun{
api_url <- "https://geo.api.vlaanderen.be/Wegenregister/ogc/features/v1"
check <- check_ogc_collection(api_url, "Wegsegment")
check
# An informative error is thrown when collection does not exist
check <- try(check_ogc_collection(api_url, "foutieve_laag"))
} # }