osm_diff_upload_changeset {osmapiR}R Documentation

Diff (OsmChange format) upload to a changeset

Description

With this API call files in the OsmChange format can be uploaded to the server. This is guaranteed to be running in a transaction. So either all the changes are applied or none.

Usage

osm_diff_upload_changeset(changeset_id, osmcha, format = c("R", "xml"))

Arguments

changeset_id

The ID of the changeset this diff belongs to. The user issuing this API call has to be the same that created the changeset.

osmcha

The OsmChange data. Can be the path of an OsmChange file, a xml2::xml_document or an osmapi_OsmChange object (see ⁠osmchange_*()⁠ functions).

format

Format of the output. Can be "R" (default) or "xml".

Details

To upload an OSC file it has to conform to the OsmChange specification with the following differences:

Value

If a diff is successfully applied and format = "R", it returns a data frame with one row for each edited object. For format = "xml", a xml2::xml_document is returned in the following format:

<diffResult generator="OpenStreetMap Server" version="0.6">
	<node|way|relation old_id="#" new_id="#" new_version="#"/>
	...
</diffResult>

with one element for every object in the upload.

Note that this can be counter-intuitive when the same element has appeared multiple times in the input then it will appear multiple times in the output.

Attribute create modify delete
old_id same as uploaded element same as uploaded element same as uploaded element
new_id new ID new ID ''or'' same as uploaded not present
new_version new version new version not present

Note

See Also

Other edit changeset's functions: osm_create_changeset()

Other OsmChange's functions: osm_download_changeset(), osmchange_create(), osmchange_delete(), osmchange_modify()

Examples

vignette("how_to_edit_osm", package = "osmapiR")

[Package osmapiR version 0.1.0 Index]