Returns the changesets with the given changeset_id
.
Usage
osm_get_changesets(
changeset_id,
include_discussion = FALSE,
format = c("R", "sf", "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),"sf"
,"xml"
, or"json"
.If
FALSE
(default), the tags of the changesets are saved in a single list columntags
containing adata.frame
for each changeset with the keys and values. IfTRUE
, add a column for each key. Ignored ifformat != "R"
.
Value
If format = "R"
, returns a data frame with one OSM changeset per row. If format = "sf"
, returns a sf
object
from sf.
format = "xml"
Returns a xml2::xml_document with the following format:
<osm version="0.6" generator="CGImap 0.9.3 (987909 spike-08.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<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 id="1234" date="2015-01-01T18:56:48Z" uid="1841" user="metaodi">
<text>Did you verify those street names?</text>
</comment>
<comment id="5678" date="2015-01-01T18:58:03Z" uid="123" user="fred">
<text>sure!</text>
</comment>
...
</discussion>
</changeset>
<changeset>
...
</changeset>
</osm>
format = "json"
Please note that the JSON format has changed on August 25, 2024 with the release of openstreetmap-cgimap 2.0.0, to align it with the existing Rails format.
Returns a list with the following json structure:
{
"version": "0.6",
"generator": "openstreetmap-cgimap 2.0.0 (4003517 spike-08.openstreetmap.org)",
"copyright": "OpenStreetMap and contributors",
"attribution": "http://www.openstreetmap.org/copyright",
"license": "http://opendatacommons.org/licenses/odbl/1-0/",
"changeset": [
{
"id": 10,
"created_at": "2005-05-01T16:09:37Z",
"open": false,
"comments_count": 1,
"changes_count": 10,
"closed_at": "2005-05-01T17:16:44Z",
"min_lat": 59.9513092,
"min_lon": 10.7719727,
"max_lat": 59.9561501,
"max_lon": 10.7994537,
"uid": 24,
"user": "Petter Reinholdtsen",
"comments": [
{
"id": 836447,
"visible": true,
"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"
}
]
},
...
]
}
Details
The
uid
might not be available for changesets auto generated by the API v0.5 to API v0.6 transitionThe bounding box attributes will be missing for an empty changeset.
The changeset bounding box is a rectangle that contains the bounding boxes of all objects changed in this changeset. It is not necessarily the smallest possible rectangle that does so.
This API call only returns information about the changeset itself but not the actual changes made to elements in this changeset. To access this information use
osm_download_changeset()
.
See also
Other get changesets' functions:
osm_download_changeset()
,
osm_query_changesets()
Examples
chaset <- osm_get_changesets(changeset_id = 137595351, include_discussion = TRUE)
chaset
#> id created_at closed_at open user uid
#> 1 137595351 2023-06-21 09:09:18 2023-06-21 09:09:18 FALSE Quercinus 19641470
#> min_lat min_lon max_lat max_lon comments_count changes_count
#> 1 42.6799619 2.6580564 42.6936802 2.7125775 4 1
#> discussion
#> 1 4 comments from 2023-06-26 to 2023-07-03 by rainerU, Quer...
#> tags
#> 1 8 tags: changesets_count=1 | comment=Correcció d'acord amb la toponímia oficial ...
chaset$discussion
#> [[1]]
#> id date uid user
#> 1 1046854 2023-06-26 15:08:00 207249 rainerU
#> 2 1047118 2023-06-27 08:41:11 19641470 Quercinus
#> 3 1047136 2023-06-27 09:51:00 207249 rainerU
#> 4 1049151 2023-07-03 11:37:31 19641470 Quercinus
#> comment_text
#> 1 Hello,\n\nyou changed the catalan name of the river "Le Boulès" from "El Boles" to "El Bulès" because this is the official catalan toponym from your point of view. Could you please specify the source of this assertion ? The only quasi official source for north catalan toponyms I know are the publications of Joan Becat he established in collaboration with local authorities and which are generally used by the local OSM community. In https://joanbecat.cat/wp-content/uploads/2019/06/fr-Web-jbk-cadastre_Bouleterne%CC%80re.pdf, he uses "El Bolès", so I propose to use this ortography as well in OSM.\n\nrainerU\n ---\n \n Published using OSMCha: https://osmcha.org/changesets/137595351\n
#> 2 Bon dia,\n\nAn official toponym does not depend on a person's point of view, precisely that makes it official. In this case, it was well stablished in the publication 'Nomenclàtor toponímic de la Catalunya del Nord' (2007) by the Institut d'Estudis Catalans and the University of Perpinyà. You can download it from here: https://publicacions.iec.cat/repository/pdf/00000044/00000018.pdf\n\nPlus, el Bulès is also the spelling used by the Gran Enciclopèdia Catalana: https://www.enciclopedia.cat/gran-enciclopedia-catalana/el-bules\n\nI am well aware of Joan Becat's works, which are very useful and meaningful in many aspects (historic, geographic, etc.) but they lack a proper authority control in the chosen toponymia.\n\nI have a proficiency degree in Catalan (which is my mother tongue) and I would never change a toponym unless I was very sure it is not correctly written. Anyway, thanks for the controlling :)\n\nSalut!
#> 3 Thanks for your rapid answer and for the references. I would say, both spellings are usal. Even the eciclopèdia mentions "riu del Bolès". It seems that Bolès is more frequent in french context, for example: http://www.sandre.eaufrance.fr/geo/CoursEau_Carthage2017/Y0460600\nI will add loc_name="El Bolès" and add both name="El Bulès" and loc_name="El Bolès" to all parts of the waterway, not only just to one single part of it.
#> 4 Hello again,\n\nSorry for the answering delay, I was off home for several days.\n\nAs you said, "Bolès" is indeed more frequent in French context because unfortunately in France the Catalan language has very scarce official recognition and the general toponymia still lacks of authorised control. The French administration switched three centuries ago all the Catalan names to French, which is the unique official toponym for many of them, and this deturpation in the correct spelling when recovering the original Catalan names is still problematic nowadays due to sociolinguistic issues such as minorisation and diglossia.\n\nThe name Bulès comes after the village Bula, as explained by ethymologist and linguist Dr. Joan Coromines in the Onomasticon Cataloniae (free access: https://oncat.iec.cat/veuredoc.asp?id=11213). The same is stated in the Nomenclator approved by the Northern Catalonia's University in Perpinyà, which I linked in the previous message. Hence, in Catalan it should be written Bulès, no matter if the French administration is mispelling the name even when trying to write it in Catalan...\n\nAll things considered, adding a "local name" which is not the original Catalan one (el Bulès) nor the official French deturpation (le Boulès) will turn the case even more confusing as it already is!\n\nAnyway, thanks for your kind answer and your help (I'm new in OSM and did'nt know I wasn't changing the name of the whole waterway).\n\nSalut!
#>