viaroute2sldf: Convert json result of OSRM routing query to...

Description Usage Arguments Details Examples

View source: R/osrmfunctions.R

Description

Convert json result of OSRM routing query to SpatialLinesDataFrame

Usage

1
viaroute2sldf(osrmresult, return_sf = FALSE)

Arguments

osrmresult

Single character string or character vector containing encoded json result(s) of OSRM routing queries.

return_sf

Boolean value if this function should return an sf object, if FALSE returns sp object (default FALSE).

Details

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
viaroute2sldf(
  viaroute(
    startlat = 52.503033,
    startlng = 13.420526,
    endlat = 52.516582,
    endlng = 13.429290
  )
)

## End(Not run)

stplanr documentation built on Oct. 20, 2018, 5:05 p.m.