Call the TSC API serializer's list view with given GET parameters, parse the response's features into a nested list. This function requires the TSC API to return the results in a key features (if GeoJSON) or data (if JSON).

tsc_GET(
  serializer,
  query = list(),
  format = "json",
  max_records = NULL,
  chunk_size = 1000,
  api_url = get_tsc_api_url(),
  api_token = get_tsc_api_token(),
  verbose = get_tsc_verbose()
)

Arguments

serializer

(character) TSC API serializer name (required) Possible values see https://tsc.dbca.wa.gov.au/api/1/

query

(list) A list of GET parameters, default: list(). The format is specified in a separate top-level param.

format

(chr) The desired API output format, default: "json".

max_records

(int) The maximum number of records retrieved. If left at default (NULL), all records are returned. Default: NULL.

chunk_size

(int) The number of records to retrieve in each paginated response. A specified but smaller limit will override chunk_size. Adjust chunk_size down if getting timeouts from the API. Default: 1000.

api_url

(character) The TSC API URL, default get_tsc_api_url, see tsc_setup

api_token

(character) The TSC API token, default get_tsc_api_token, see tsc_setup

verbose

Whether to show verbose messages. Default: get_tsc_verbose.

Value

An S3 object of class 'tsc_api_response' containing: features: The sent GeoJSON features serializer: The called serializer, e.g. 'area' response: The API HTTP response with all metadata

Details

[Stable]

Examples

if (FALSE) {
area_records <- tsc_GET("area")
}