Learn R Programming

stplanr (version 0.1.0)

nearest2spdf: Return SpatialPointsDataFrame with nearest street from OSRM nearest service

Description

Return SpatialPointsDataFrame with nearest street from OSRM nearest service

Usage

nearest2spdf(lat, lng = NA, osrmurl = "http://router.project-osrm.org")

Arguments

lat
Numeric vector containing latitude coordinate for each coordinate to map. Also accepts dataframe with latitude in the first column and longitude in the second column.
lng
Numeric vector containing longitude coordinate for each coordinate to map.
osrmurl
Base URL of the OSRM service

Details

Retrieve coordinates and name of the node(s) on the network mapped from coordinates passed to functions.

Examples

Run this code
nearest2spdf(
   lat = c(50.3, 50.2),
   lng = c(13.2, 13.1)
 )

Run the code above in your browser using DataLab