subset.osmar: Subset an osmar object

Description Usage Arguments Value Examples

View source: R/osmar-subsetting.R

Description

Subset an osmar object

Usage

1
2
3
4
5
  ## 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)))

Example output

Loading required package: XML
Loading required package: RCurl
Loading required package: bitops
Loading required package: geosphere

Attaching package: 'osmar'

The following object is masked from 'package:utils':

    find

osmar object
19 nodes, 0 ways, 0 relations 
osmar object
19 nodes, 10 ways, 20 relations 

osmar documentation built on May 1, 2019, 7:33 p.m.

Related to subset.osmar in osmar...