powered by
Takes up to 100 independent coordinates and returns the closest road segment for each point. The points passed do not need to be part of a continuous path.
google_nearestRoads( df_points, lat = NULL, lon = NULL, simplify = TRUE, curl_proxy = NULL, key = get_api_key("roads") )
data.frame with at least two columns specifying the latitude & longitude coordinates, with a maximum of 100 pairs of coordinates.
data.frame
string specifying the column of df_path containing the 'latitude' coordinates. If left NULL, a best-guess will be made
df_path
string specifying the column of df_path containing the 'longitude' coordinates. If left NULL, a best-guess will be made
logical - TRUE indicates the returned JSON will be coerced into a list. FALSE indicates the returend JSON will be returned as a string
logical
a curl proxy object
string A valid Google Developers Places API key
string
google_snapToRoads
if (FALSE) { key <- 'your_api_key' df_points <- read.table(text = "lat lon 60.1707 24.9426 60.1708 24.9424 60.1709 24.9423", header = T) google_nearestRoads(df_points, key = key) }
Run the code above in your browser using DataLab