find: Find element for a given condition

Description Usage Arguments Details Value See Also Examples

View source: R/osmar-finding.R

Description

Find element for a given condition

Usage

1
find(object, condition)

Arguments

object

An osmar object

condition

A condition for the element to find; see details section.

Details

The basis of an osmar object are data.frames; therefore the condition principally follows the rules for subset: logical expression indicating elements or rows to keep.

Furthermore, one has to define on which element and which data of the osmar object the condition applies: element(data(condition)), see osm_descriptors.

Value

The ID of the the element

See Also

binary_grep

Other finding: find_down, find_up; find_nearest_node

Examples

1
2
3
4
5
data("muc", package = "osmar")
  find(muc, node(tags(v == "Marienplatz")))
  find(muc, node(tags(v %agrep% "marienplatz")))
  find(muc, node(attrs(id == 19475890)))
  find(muc, way(tags(k == "highway" & v == "pedestrian")))

osmar documentation built on May 31, 2017, 3:49 p.m.

Search within the osmar package
Search all R packages, documentation and source code