Subset an osmar object

Share:

Description

Subset an osmar object

Usage

1
2
3
4
## S3 method for class 'osmar'
subset(x, node_ids = NULL, way_ids = NULL,
  relation_ids = NULL, ids = list(node_ids = node_ids, way_ids = way_ids,
  relation_ids = relation_ids), ...)

Arguments

x

An osmar object

node_ids

Node ID vector

way_ids

Way ID vector

relation_ids

Relation ID vector

ids

A list composed of node_ids, way_ids, relation_ids; for easier usage with results from find_up and find_down

...

Ignored

Value

An osmar object containing the specified elements

Examples

1
2
3
4
5
6
data("muc", package = "osmar")
  id <- find(muc, node(tags(v == "Marienplatz")))

  subset(muc, node_ids = id)

  subset(muc, ids = find_up(muc, node(id)))