View source: R/osmapi_elements.R
osm_delete_object | R Documentation |
Expects a valid XML representation of the element to be deleted.
osm_delete_object(x, changeset_id)
x |
The object data. Can be the path of an xml file, a xml2::xml_document or a data.frame inheriting
or following the structure of an |
changeset_id |
The ID of an open changeset where to create the object. If missing, |
The version must match the version of the element you downloaded and the changeset must match the id
of an open
changeset owned by the current authenticated user. It is allowed, but not necessary, to have tags on the element
except for lat/lon which are required for nodes, without lat+lon the server gives 400 Bad request.
If x
is a data.frame, the columns type
, id
, version
and changeset
must be present + lat
and lon
for
nodes. For the xml format, see the
OSM wiki.
If multiple elements are provided only the first is deleted. The rest is discarded.
Returns the new version number of the object.
This updates the bounding box of the changeset.
To avoid performance issues when deleting multiple objects, the use of the osm_diff_upload_changeset()
is highly
recommended. This is also the only way to ensure that multiple objects are updated in a single database
transaction.
Other edit OSM objects' functions:
osm_create_object()
,
osm_update_object()
vignette("how_to_edit_osm", package = "osmapiR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.