Learn R Programming

osmar (version 1.1-7)

find_nearest_node: Find nearest node with given conditions

Description

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

Usage

find_nearest_node(object, id, condition)

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, find_down, find_up

Examples

Run this code
data("muc", package = "osmar")
  id <- find(muc, node(tags(v == "Marienplatz")))[1]

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

Run the code above in your browser using DataLab