Learn R Programming

stplanr (version 0.1.0)

table2matrix: Return SpatialPointsDataFrame with nearest street from OSRM nearest service

Description

Return SpatialPointsDataFrame with nearest street from OSRM nearest service

Usage

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

Arguments

lat
Numeric vector containing latitude coordinate for each coordinate to calculate travel times. 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 calculate travel times.
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
table2matrix(seq(from=50,to=52,by=0.1),seq(from=12,to=14,by=0.1))

Run the code above in your browser using DataLab