Learn R Programming

stplanr (version 0.1.4)

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
## Not run: 
# library(RCurl)
#  viaroute2sldf(
#    RCurl::getURL(paste0(
#    "http://router.project-osrm.org/viaroute?loc=52.503033,13.420526&",
#    "loc=52.516582,13.429290&instructions=true"))
#  )
# ## End(Not run)

Run the code above in your browser using DataLab