Learn R Programming

osmapiR (version 0.2.3)

osm_create_object: Create an OSM object

Description

Creates a new element in an open changeset as specified.

Usage

osm_create_object(x, changeset_id)

Value

The ID of the newly created OSM object.

Arguments

x

The new object data. Can be the path to an xml file, a xml2::xml_document or a data.frame inheriting or following the structure of an osmapi_objects object.

changeset_id

The ID of an open changeset where to create the object. If missing, x should define the changeset ID, otherwise it will be overwritten with changeset_id. Ignored if x is a path.

Details

If x is a data.frame, the columns type, changeset, tags must be present + column members for ways and relations + lat and lon for nodes. For the xml format, see the OSM wiki.

If multiple elements are provided only the first is created. The rest is discarded.

See Also

Other edit OSM objects' functions: osm_delete_object(), osm_update_object()

Examples

Run this code
vignette("how_to_edit_osm", package = "osmapiR")

Run the code above in your browser using DataLab