osmapi_objects constructor
Arguments
- x
data.framerepresenting OSM objects as rows. At least it has atypecolumn withnode,wayorrelation.- tag_columns
A vector indicating the name or position of the columns representing tags. If missing, it's assumed that
tagscolumn contain the tags (see details).If
TRUE, don't drop the empty tags specified intag_columnsand addNAas a value. Useful to remove specific tags withosmchange_modify()and specifictag_keys.
See also
Other get OSM objects' functions:
osm_bbox_objects(),
osm_get_objects(),
osm_history_object(),
osm_relations_object(),
osm_ways_node()
Examples
x <- data.frame(
type = c("node", "node", "way"), id = 1:3, name = c(NA, NA, "My way")
)
x$members <- list(NULL, NULL, 1:2)
obj <- osmapi_objects(x, tag_columns = "name")
obj
#> type id members tags
#> 1 node 1 NULL No tags
#> 2 node 2 NULL No tags
#> 3 way 3 2 nodes: 1, 2 1 tag: name=My way