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 columntags
containing adata.frame
for 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 110 165345079 2025-04-23 17:30:29
#> 2 relation 349035 TRUE 169 165502687 2025-04-27 12:07:09
#> 3 relation 349053 TRUE 809 164867092 2025-04-12 18:02:55
#> 4 relation 2417889 TRUE 62 165229560 2025-04-21 09:46:34
#> 5 relation 2807397 TRUE 111 152390043 2024-06-07 19:08:20
#> 6 relation 11746917 TRUE 230 164867092 2025-04-12 18:02:55
#> 7 relation 11747082 TRUE 433 166797081 2025-05-26 20:26:01
#> user uid lat lon
#> 1 Hugoren Martinako 3392826 <NA> <NA>
#> 2 Hugoren Martinako 3392826 <NA> <NA>
#> 3 mauriciabad 10797491 <NA> <NA>
#> 4 Hugoren Martinako 3392826 <NA> <NA>
#> 5 EliziR 605366 <NA> <NA>
#> 6 mauriciabad 10797491 <NA> <NA>
#> 7 Jordi MF 8278438 <NA> <NA>
#> members
#> 1 97 members: node/152364165/admin_centre, way/96647329/outer,...
#> 2 515 members: node/152364165/admin_centre, way/45319680/outer...
#> 3 2242 members: node/152364165/admin_centre, node/602512999/la...
#> 4 115 members: node/152364165/admin_centre, way/185724656/oute...
#> 5 449 members: node/152364165/admin_centre, way/45327666/outer...
#> 6 2215 members: node/152364165/admin_centre, way/585618147/out...
#> 7 3564 members: node/8000963558/label, node/152364165/admin_ce...
#> tags
#> 1 35 tags: admin_level=8 | alt_name:gl=Barna | border_type=municipi | boundary=adm...
#> 2 33 tags: admin_level=6 | boundary=administrative | ine:provincia=08 | ISO3166-2=...
#> 3 69 tags: admin_level=4 | alt_name:el=Καταλονία | alt_name:eo=Katalunujo | alt_na...
#> 4 24 tags: admin_level=7 | border_type=comarca | boundary=administrative | name=Ba...
#> 5 13 tags: boundary=political | idescat:àmbit=01 | name=Àmbit metropolità | name:a...
#> 6 10 tags: boundary=political | default_language=ca | name=Català com a llengua pr...
#> 7 45 tags: boundary=political | name=Països Catalans | name:an=Países Catalans | n...
way <- osm_relations_object(osm_type = "way", osm_id = 372011578)
way
#> type id visible version changeset timestamp user uid
#> 1 relation 5524720 TRUE 55 165838704 2025-05-05 10:39:15 EliziR 605366
#> lat lon members
#> 1 <NA> <NA> 191 members: way/372006138/, way/372006137/, way/486335278/,...
#> tags
#> 1 9 tags: distance=62.65 | name=GR 179 Sender dels Maquis | network=nwn | operator...
rel <- osm_relations_object(osm_type = "relation", osm_id = 342792)
rel
#> type id visible version changeset timestamp
#> 1 relation 349012 TRUE 128 165502687 2025-04-27 12:07:09
#> 2 relation 11739086 TRUE 114 166797081 2025-05-26 20:26:01
#> user uid lat lon
#> 1 Hugoren Martinako 3392826 <NA> <NA>
#> 2 Jordi MF 8278438 <NA> <NA>
#> members
#> 1 427 members: node/21323935/admin_centre, way/1153082462/oute...
#> 2 1036 members: node/34105607/admin_centre, node/8000963555/la...
#> tags
#> 1 35 tags: admin_level=6 | alt_name:gl=Alacante | border_type=province | boundary=...
#> 2 54 tags: alt_name=País Valencià | alt_name:ca=País Valencià | boundary=political...