Learn R Programming

osmar (version 1.1-7)

find_down: Find all elements related to an ID

Description

For a given ID these functions return all IDs of related elements.

Usage

find_down(object, ids)
find_up(object, ids)

Arguments

object
An osmar object
ids
A vector of IDs tagged whether they are node, way, or relation

Value

A list with the three elements node_ids, way_ids, relation_ids

Details

find_down finds all elements downwards the hierarchy:

node -> node

way -> way + node

relation -> relation + way + node

node

find_up finds all elements upwards the hierarchy:

node -> node + way + relation

way -> way + relation

relation -> relation

node

See Also

Other finding: find, find_nearest_node

Examples

Run this code
data("muc", package = "osmar")
  o1 <- find(muc, way(tags(k == "highway" & v == "pedestrian")))

  find_down(muc, way(o1))
  find_up(muc, way(o1))

Run the code above in your browser using DataLab