find_nearest_node: Find nearest node with given conditions

Description Usage Arguments Value See Also Examples

View source: R/osmar-finding.R

Description

For a given ID, find nearest node (geographical distance) with given conditions.

Usage

1

Arguments

object

An osmar object

id

An node ID

condition

Condition for the element to find; see find

Value

A node ID or NA

See Also

Other finding: find_down, find_up; find

Examples

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

  find_nearest_node(muc, id, way(tags(k == "highway" & v == "pedestrian")))

Example output

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

Attaching package: 'osmar'

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

    find

[1] 1211172658

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