Package 'pgfeatureserv'

Title: Client for pg_featureserv RESTful web service
Description: Client for pg_featureserv, a RESTful geospatial feature server for PostGIS.
Authors: Seb Dalgarno [aut, cre]
Maintainer: Seb Dalgarno <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9005
Built: 2024-09-26 05:14:54 UTC
Source: https://github.com/poissonconsulting/pgfeatureserv

Help Index


Get collection bbox

Description

Get bounding box of a collection.

Usage

pgf_collection_bbox(
  collection_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A list.

See Also

Other collections: pgf_collection_crs(), pgf_collection_description(), pgf_collection_feature(), pgf_collection_features(), pgf_collection_geometry_type(), pgf_collection_properties(), pgf_collections()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
collection_id <- "whse_basemapping.fwa_named_streams"
pgf_collection_bbox(,
  collection_id = collection_id, base_url = base_url, path = path
)

## End(Not run)

Get collection crs

Description

Get crs of a collection.

Usage

pgf_collection_crs(
  collection_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A string.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_description(), pgf_collection_feature(), pgf_collection_features(), pgf_collection_geometry_type(), pgf_collection_properties(), pgf_collections()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
collection_id <- "whse_basemapping.fwa_named_streams"
pgf_collection_crs(,
  collection_id = collection_id, base_url = base_url, path = path
)

## End(Not run)

Get collection description

Description

Get description of a collection.

Usage

pgf_collection_description(
  collection_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A string.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_crs(), pgf_collection_feature(), pgf_collection_features(), pgf_collection_geometry_type(), pgf_collection_properties(), pgf_collections()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
collection_id <- "whse_basemapping.fwa_named_streams"
pgf_collection_description(,
  collection_id = collection_id, base_url = base_url, path = path
)

## End(Not run)

Get collection feature

Description

Get collection feature given collection_id, feature_id and optional query parameters (see API specs here).

Usage

pgf_collection_feature(
  collection_id,
  feature_id,
  base_url,
  path,
  properties = NULL,
  transform = NULL,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

feature_id

A positive whole number of the feature id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

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

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A sf object.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_crs(), pgf_collection_description(), pgf_collection_features(), pgf_collection_geometry_type(), pgf_collection_properties(), pgf_collections()

Examples

## Not run: 
pgf_collection_feature("whse_basemapping.fwa_wetlands_poly", limit = 1)

## End(Not run)

Get collection features

Description

Get collection features given collection_id and optional query parameters (see API specs here).

Usage

pgf_collection_features(
  collection_id,
  base_url,
  path,
  filter = NULL,
  limit = 10000,
  offset = 0,
  sortby = NULL,
  bbox = NULL,
  properties = NULL,
  precision = NULL,
  transform = NULL,
  groupby = NULL,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

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.

sortby

A string that sorts the response items by a property. Default is ascending but property name can be prepended with '-' to indicate descending.

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.

precision

A positive whole number indicating precision (i.e., number of decimal places) of GeoJSON coordinates.

transform

A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)).

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.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A sf object.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_crs(), pgf_collection_description(), pgf_collection_feature(), pgf_collection_geometry_type(), pgf_collection_properties(), pgf_collections()

Examples

## Not run: 
pgf_collection_features("whse_basemapping.fwa_wetlands_poly", limit = 1)

## End(Not run)

Get collection geometry type

Description

Get geometry type of a collection.

Usage

pgf_collection_geometry_type(
  collection_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A string.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_crs(), pgf_collection_description(), pgf_collection_feature(), pgf_collection_features(), pgf_collection_properties(), pgf_collections()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
collection_id <- "whse_basemapping.fwa_named_streams"
pgf_collection_geometry_type(,
  collection_id = collection_id, base_url = base_url, path = path
)

## End(Not run)

Get collection properties

Description

Get information about a collection's column names.

Usage

pgf_collection_properties(
  collection_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

collection_id

A character string of the collection id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A tibble.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_crs(), pgf_collection_description(), pgf_collection_feature(), pgf_collection_features(), pgf_collection_geometry_type(), pgf_collections()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
collection_id <- "whse_basemapping.fwa_named_streams"
pgf_collection_properties(,
  collection_id = collection_id, base_url = base_url, path = path
)

## End(Not run)

Get collections

Description

Get information about the collections.

Usage

pgf_collections(
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A tibble.

See Also

Other collections: pgf_collection_bbox(), pgf_collection_crs(), pgf_collection_description(), pgf_collection_feature(), pgf_collection_features(), pgf_collection_geometry_type(), pgf_collection_properties()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
pgf_collections(base_url = base_url, path = path)

## End(Not run)

Get function description

Description

Get information on function description.

Usage

pgf_function_description(
  function_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

function_id

A character string of the function id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A string.

See Also

Other functions: pgf_function_parameters(), pgf_function_properties(), pgf_function_result(), pgf_functions()

Examples

## Not run: 
function_id <- "fwa_locatealong"
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
pgf_function_description(
  function_id = function_id, base_url = base_url, path = path
)

## End(Not run)

Get function parameters

Description

Get information on function parameters.

Usage

pgf_function_parameters(
  function_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

function_id

A character string of the function id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A tibble.

See Also

Other functions: pgf_function_description(), pgf_function_properties(), pgf_function_result(), pgf_functions()

Examples

## Not run: 
function_id <- "fwa_locatealong"
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
pgf_function_parameters(
  function_id = function_id, base_url = base_url, path = path
)

## End(Not run)

Get function properties

Description

Get information on function properties.

Usage

pgf_function_properties(
  function_id,
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

function_id

A character string of the function id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A tibble.

See Also

Other functions: pgf_function_description(), pgf_function_parameters(), pgf_function_result(), pgf_functions()

Examples

## Not run: 
function_id <- "fwa_locatealong"
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
pgf_function_properties(
  function_id = function_id, base_url = base_url, path = path
)

## End(Not run)

Get function result

Description

Call a spatial function and get results.

Usage

pgf_function_result(
  function_id,
  base_url,
  path,
  parameters,
  limit = 10000,
  offset = 0,
  sortby = NULL,
  bbox = NULL,
  properties = NULL,
  precision = NULL,
  transform = NULL,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

function_id

A character string of the function id.

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

parameters

A named list of the parameters and values for a specific function.

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.

sortby

A string that sorts the response items by a property. Default is ascending but property name can be prepended with '-' to indicate descending.

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.

precision

A positive whole number indicating precision (i.e., number of decimal places) of GeoJSON coordinates.

transform

A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100)).

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A sf object.

See Also

Other functions: pgf_function_description(), pgf_function_parameters(), pgf_function_properties(), pgf_functions()

Examples

## Not run: 
function_id <- "fwa_locatealong"
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"

parameters <- list(
  blue_line_key = 356308001,
  downstream_route_measure = 0
)
pgf_function_result(function_id,
  base_url = base_url,
  path = path,
  parameters = parameters
)

## End(Not run)

Get functions

Description

Get information on available functions.

Usage

pgf_functions(
  base_url,
  path,
  nocache = NULL,
  user = gh_user(),
  verbose = FALSE,
  response = FALSE
)

Arguments

base_url

A character string of the base URL.

path

A character string of the path or endpoint.

nocache

A character string indicating whether to cache results or not. Possible values include 'true' or 'false' or NULL.

user

A character string of the user. This allows whoever is running the server your are querying to contact you in case of misuse.

verbose

A flag indicating whether to provide verbose GET response.

response

A flag indicating whether to return the raw response object.

Value

A tibble.

See Also

Other functions: pgf_function_description(), pgf_function_parameters(), pgf_function_properties(), pgf_function_result()

Examples

## Not run: 
base_url <- "https://features.hillcrestgeo.ca/"
path <- "fwa"
pgf_functions(
  base_url = base_url, path = path
)

## End(Not run)