osm_get_changesets {osmapiR}R Documentation

Get changesets

Description

Returns the changesets with the given changeset_id.

Usage

osm_get_changesets(
  changeset_id,
  include_discussion = FALSE,
  format = c("R", "xml", "json"),
  tags_in_columns = FALSE
)

Arguments

changeset_id

A vector with ids of changesets to retrieve represented by a numeric or a character values.

include_discussion

Indicates whether the result should contain the changeset discussion or not.

format

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

tags_in_columns

If FALSE (default), the tags of the changesets are saved in a single list column tags containing a data.frame for each changeset with the keys and values. If TRUE, add a column for each key. Ignored if format != "R".

Details

Value

If format = "R", returns a data frame with one OSM changeset per row.

format = "xml"

Returns a xml2::xml_document with the following format:

<osm>
	<changeset id="10" created_at="2008-11-08T19:07:39+01:00" open="true" user="fred" uid="123" min_lon="7.0191821" min_lat="49.2785426" max_lon="7.0197485" max_lat="49.2793101" comments_count="3" changes_count="10">
		<tag k="created_by" v="JOSM 1.61"/>
		<tag k="comment" v="Just adding some streetnames"/>
		...
		<discussion>
			<comment date="2015-01-01T18:56:48Z" uid="1841" user="metaodi">
				<text>Did you verify those street names?</text>
			</comment>
			<comment date="2015-01-01T18:58:03Z" uid="123" user="fred">
				<text>sure!</text>
			</comment>
			...
		</discussion>
	</changeset>
	<changeset>
	  ...
	</changeset>
</osm>

format = "json"

Returns a list with the following json structure:

{
 "version": "0.6",
 "elements": [
  {"type": "changeset",
   "id": 10,
   "created_at": "2005-05-01T16:09:37Z",
   "closed_at": "2005-05-01T17:16:44Z",
   "open": False,
   "user": "Petter Reinholdtsen",
   "uid": 24,
   "minlat": 59.9513092,
   "minlon": 10.7719727,
   "maxlat": 59.9561501,
   "maxlon": 10.7994537,
   "comments_count": 1,
   "changes_count": 10,
   "discussion": [{"date": "2022-03-22T20:58:30Z", "uid": 15079200, "user": "Ethan White of Cheriton", "text": "wow no one have said anything here 3/22/2022\n"}]
  }, ...]
}

See Also

Other get changesets' functions: osm_download_changeset(), osm_query_changesets()

Examples

## Not run: 
chaset <- osm_get_changesets(changeset_id = 137595351, include_discussion = TRUE)
chaset
chaset$discussion

## End(Not run)

[Package osmapiR version 0.1.0 Index]