R: Find all elements related to an ID

find_down {osmar} | R Documentation

## 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`

### Details

`find_down` finds all elements downwards the hierarchy:

node | -> | node
way | -> | way + node
relation | -> | relation + way + node

`find_up` finds all elements upwards the hierarchy:

node | -> | node + way + relation
way | -> | way + relation
relation | -> | relation

### Value

A list with the three elements `node_ids`, `way_ids`, `relation_ids`

### See Also

Other finding: `find`, `find_nearest_node`

### Examples

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

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

[Package osmar version 1.1-7 Index]