multiroute: Route to multiple destinations

Description Usage Arguments Value Examples

View source: R/apicalls.R

Description

Calculate routes from a single point to one or more coordinates.

Usage

1
2
multiroute(fromaddress = NULL, fromcoord = NULL, tocoords = NULL,
  mot = NULL, routepolyline = NULL, traveltime = NULL)

Arguments

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

  • car (default)

  • bicycle

  • foot

  • public

  • auto

routepolyline

append a route in the form of a list of coordinates.

  • 0 (default): without route description

  • 1: with route description as a an encoded polyline string

  • 2: with route description as a list of latitude,longtitude pairs.

traveltime

used in combination with mot = public.

  • WEEKSTART (default): 09:00 on the first following weekday.

  • NOW: Use current time

  • datetime: Datetime string in the ISO 8601 format YYYY-MM-DDThh:mm (ie. 2016-10-30T16:56)

Value

Returns a list

Examples

 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)

56north/hvorlangterder documentation built on May 5, 2019, 11:27 a.m.