Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

stplanr (version 0.1.0)

viaroute2sldf: Convert json result of OSRM routing query to SpatialLinesDataFrame

Description

Convert json result of OSRM routing query to SpatialLinesDataFrame

Usage

viaroute2sldf(osrmresult)

Arguments

osrmresult
String containing encoded json result of OSRM routing query.

Details

Converts the result of a (successful) OSRM routing query and returns a SpatialLinesDataFrame containing the route, route summary and instructions.

Examples

Run this code
library(RCurl)
 viaroute2sldf(
   RCurl::getURL(paste0(
   "http://router.project-osrm.org/viaroute?loc=52.503033,13.420526&",
   "loc=52.516582,13.429290&instructions=true"))
 )

Run the code above in your browser using DataLab