get_by_fids: Get by FIDs

View source: R/get_by_fids.R

get_by_fidsR Documentation

Get by FIDs

Description

Get a layer by querying the FIDs

Usage

get_by_fids(
  endpoint,
  query,
  my_token,
  return_geometry,
  return_n,
  layer_details,
  out_fields,
  object_ids = NULL
)

Arguments

endpoint

a string defining the enpoint url. It can be generated by the feature_server_endpoint and map_server_endpoint functons. See https://developers.arcgis.com/rest/services-reference/get-started-with-the-services-directory.htm

query

the query to POST

my_token

an access token acquired via get_token

return_geometry

should the geometry be returned or just a table?

return_n

how many features (maximum) should be returned by the query?

layer_details

the layer details returned by the get_layer_details function

out_fields

the fields of the layer to return (character vector)

object_ids

a vector of object IDs to return if this argument is NULL the function will get them but passing them in aids performance if they have already been returned

Details

This function works by checking if the requested return count is less tha the max record count. If so, it doesn't bother with getting the FIDs and just requests the data and returns it. Getting FIDs is a big overhea so this should be avoided where possible.

Value

a tibble or sf object


MatthewJWhittle/getarc documentation built on April 22, 2023, 12:16 p.m.