Returns all (not deleted) relations in which the given object is used.
Arguments
- osm_type
Object type (
"node","way"or"relation").- osm_id
Object id represented by a numeric or a character value.
- format
Format of the output. Can be
"R"(default),"xml", or"json".If
FALSE(default), the tags of the objects are saved in a single list columntagscontaining adata.framefor each OSM object 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 object per row. If format = "xml", returns a
xml2::xml_document following the
OSM_XML format. If format = "json",
returns a list with a json structure following the OSM_JSON format.
See also
Other get OSM objects' functions:
osm_bbox_objects(),
osm_get_objects(),
osm_history_object(),
osm_ways_node(),
osmapi_objects()
Examples
node <- osm_relations_object(osm_type = "node", osm_id = 152364165)
node
#> type id visible version changeset timestamp
#> 1 relation 347950 TRUE 126 190307629 2026-10-10 15:04:50
#> 2 relation 349035 TRUE 179 189747305 2026-09-29 20:50:29
#> 3 relation 349053 TRUE 830 190490111 2026-10-14 07:31:42
#> 4 relation 2417889 TRUE 67 189441518 2026-09-23 10:28:54
#> 5 relation 2807397 TRUE 120 189747305 2026-09-29 20:50:29
#> 6 relation 11746917 TRUE 251 190490111 2026-10-14 07:31:42
#> 7 relation 11747082 TRUE 477 190490111 2026-10-14 07:31:42
#> 8 relation 21290432 TRUE 13 190490111 2026-10-14 07:31:42
#> user uid lat lon
#> 1 Xavier Grand-Louis 24087234 <NA> <NA>
#> 2 AmyCupcake 406589 <NA> <NA>
#> 3 EliziR 605366 <NA> <NA>
#> 4 Ra_colate 15204658 <NA> <NA>
#> 5 AmyCupcake 406589 <NA> <NA>
#> 6 EliziR 605366 <NA> <NA>
#> 7 EliziR 605366 <NA> <NA>
#> 8 EliziR 605366 <NA> <NA>
#> members
#> 1 152 members: node/152364165/admin_centre, relation/3765380/s...
#> 2 531 members: node/152364165/admin_centre, way/45319680/outer...
#> 3 2264 members: way/1415938360/outer, way/83094965/outer, way/...
#> 4 116 members: node/152364165/admin_centre, way/185724656/oute...
#> 5 465 members: node/152364165/admin_centre, way/45327666/outer...
#> 6 2237 members: node/152364165/admin_centre, way/585618147/out...
#> 7 3758 members: node/8000963558/label, node/152364165/admin_ce...
#> 8 3621 members: node/8000963558/label, node/152364165/admin_ce...
#> tags
#> 1 40 tags: admin_level=8 | alt_name:gl=Barna | alt_name:hi=बार्सेलोना | border_typ...
#> 2 36 tags: admin_level=6 | alt_name:br=Barselona | boundary=administrative | ine:p...
#> 3 71 tags: admin_level=4 | alt_name:el=Καταλονία | alt_name:eo=Katalunujo | alt_na...
#> 4 26 tags: admin_level=7 | border_type=comarca | boundary=administrative | name=Ba...
#> 5 8 tags: boundary=political | idescat:àmbit=01 | name=Àmbit metropolità de Barcel...
#> 6 11 tags: boundary=political | default_language=ca | name=Català com a llengua pr...
#> 7 49 tags: boundary=political | name=Països Catalans | name:an=Países Catalans | n...
#> 8 8 tags: boundary=civil | name=Domini lingüístic català | name:be=Каталанска-моўн...
way <- osm_relations_object(osm_type = "way", osm_id = 372011578)
way
#> type id visible version changeset timestamp user
#> 1 relation 5524720 TRUE 69 186886687 2026-08-03 18:58:17 MacLondon
#> uid lat lon
#> 1 322039 <NA> <NA>
#> members
#> 1 206 members: relation/6959819/alternative, way/372006138/, w...
#> tags
#> 1 9 tags: distance=62.65 | name=Sender dels Maquis | network=nwn | operator=GR | o...
rel <- osm_relations_object(osm_type = "relation", osm_id = 342792)
rel
#> type id visible version changeset timestamp user
#> 1 relation 349012 TRUE 138 188186993 2026-08-29 09:32:21 Gorjablanc
#> 2 relation 11739086 TRUE 120 187294867 2026-08-11 16:05:26 flierfy
#> uid lat lon
#> 1 21189916 <NA> <NA>
#> 2 445671 <NA> <NA>
#> members
#> 1 497 members: node/21323935/admin_centre, way/1153082462/oute...
#> 2 1068 members: node/34105607/admin_centre, node/8000963555/la...
#> tags
#> 1 35 tags: admin_level=6 | alt_name:gl=Alacante | border_type=province | boundary=...
#> 2 53 tags: boundary=political | default_language=ca | name=Municipis de Predomini ...