add_features | R Documentation |
Delete features from a feature layer based on object ID, a where clause, or a spatial filter.
add_features(
x,
.data,
chunk_size = 2000,
match_on = c("name", "alias"),
rollback_on_failure = TRUE,
token = arc_token()
)
update_features(
x,
.data,
match_on = c("name", "alias"),
token = arc_token(),
rollback_on_failure = TRUE,
...
)
delete_features(
x,
object_ids = NULL,
where = NULL,
filter_geom = NULL,
predicate = "intersects",
rollback_on_failure = TRUE,
token = arc_token(),
...
)
x |
an object of class |
.data |
an object of class |
chunk_size |
the maximum number of features to add at a time |
match_on |
whether to match on the alias or the field name. Default, the alias. See Details for more. |
rollback_on_failure |
default |
token |
default |
... |
additional query parameters passed to the API. |
object_ids |
a numeric vector of object IDs to be deleted. |
where |
a simple SQL where statement indicating which features should be
deleted. When the where statement evaluates to |
filter_geom |
an object of class |
predicate |
Spatial predicate to use with |
For a more detailed guide to adding, updating, and deleting features, view the tutorial on the R-ArcGIS Bridge website.
Regarding the match_on
argument:when publishing an object to an ArcGIS Portal
from R, the object's names are provided as the alias. The object's names are
subject to change according to the standards of the ArcGIS REST API. For example.
"Sepal.Length"
is changed to "Sepal_Width"
in the name
field but the alias
remains "Sepal.Length"
. For that reason, we match on the alias name by default.
Change this argument to match based on the field name.
add_features()
returns a data.frame
with columns objectId
, uniqueId
, globalId
, success
update_features()
returns a list with an element named updateResults
which is a data.frame
with columns objectId
, uniqueId
, globalId
, success
delete_features()
returns a list with an element named deleteResults
which is a data.frame
with columns objectId
, uniqueId
, globalId
, success
## Not run:
# this is pseudo-code and will not work
flayer <- arc_open(furl)
# add sf objects to existing feature service
add_features(flayer, sfobj)
# delete all features
delete_features(flayer, where = "1 = 1")
# update features
update_features(flayer, dfobj)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.