Description Usage Arguments Value Examples
Calculate routes from a single point to one or more coordinates.
1 2 |
fromaddress |
is an adress type: roadname+housenumber+postalcode |
fromcoord |
is a coordinate type: latitude, longtitude |
tocoords |
is a coordinate type: latitude, longtitude. Must be a data frame with a lat and lng column |
mot |
is a mode of transport designator
|
routepolyline |
append a route in the form of a list of coordinates.
|
traveltime |
used in combination with mot = public.
|
Returns a list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Create data frame with coordinates
coords <- dplyr::data_frame(
lat = c(55.689298, 55.683842, 55.679184),
lng = c(12.557549, 12.571044, 12.585228))
# Request with origintype as coordinate:
multiroute(fromcoord = "55.68958,12.557845", tocoords = coords)
# Request with origintype as address:
multiroute(fromaddress = "elmegade 5 2200", tocoords = coords)
# Request compressed polylines for each route:
mymultiroute <- multiroute(fromcoord = "55.68958,12.557845", tocoords = coords, routepolyline = 1)
# Decode the compressed polyline
decodepolyline(mymultiroute[[1]]$routepolyline)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.