Learn R Programming

osmapiR (version 0.2.3)

osmapi_objects: osmapi_objects constructor

Description

osmapi_objects constructor

Usage

osmapi_objects(x, tag_columns, keep_na_tags = FALSE)

Value

An osmapi_objects

Arguments

x

data.frame representing OSM objects as rows. At least it has a type column with node, way or relation.

tag_columns

A vector indicating the name or position of the columns representing tags. If missing, it's assumed that tags column contain the tags (see details).

keep_na_tags

If TRUE, don't drop the empty tags specified in tag_columns and add NA as a value. Useful to remove specific tags with osmchange_modify() and specific tag_keys.

See Also

Other get OSM objects' functions: osm_bbox_objects(), osm_get_objects(), osm_history_object(), osm_relations_object(), osm_ways_node()

Examples

Run this code
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

Run the code above in your browser using DataLab