query_layer_attachments {arcgislayers} | R Documentation |
Query and download attachments
Description
Get metadata about attachments associated with features in a layer.
Query attachment information using query_layer_attachments()
and
download attachments using download_attachments()
.
Usage
query_layer_attachments(
x,
definition_expression = "1=1",
attachments_definition_expression = NULL,
object_ids = NULL,
global_ids = NULL,
attachment_types = NULL,
keywords = NULL,
...,
token = arc_token()
)
download_attachments(
attachments,
out_dir,
...,
overwrite = FALSE,
.progress = TRUE,
token = arc_token()
)
Arguments
x |
an object of class |
definition_expression |
default |
attachments_definition_expression |
default |
object_ids |
mutually exclusive with |
global_ids |
mutally exclusive with |
attachment_types |
default |
keywords |
default |
... |
unused |
token |
your authorization token. |
attachments |
a |
out_dir |
the path to the folder to download the file |
overwrite |
default |
.progress |
default |
Value
query_layer_attachments()
returns a data.frame.
download_attachments()
returns a list. If an error occurs, the condition is captured and returned in the list.
Otherwise the path to the file that was downloaded is returned.
References
Examples
## Not run:
# create a url path that isn't too wide for CRAN
furl <- paste(
c(
"https://services1.arcgis.com/hLJbHVT9ZrDIzK0I",
"arcgis/rest/services/v8_Wide_Area_Search_Form_Feature_Layer___a2fe9c",
"FeatureServer/0"
),
collapse = "/"
)
# connect to the layer
layer <- arc_open(furl)
# get the attachment info
att <- query_layer_attachments(layer)
# download them to a path
download_attachments(att, "layer_attachments")
## End(Not run)