This function sets the options to be passed to the API service. For full details of available options see https://docs.targomo.com/core/

targomoOptions(
  travelType = "bike",
  travelTimes = list(600, 1200, 1800),
  intersectionMode = "union",
  carRushHour = FALSE,
  walkSpeed = 5,
  walkUpHillAdjustment = 10,
  walkDownHillAdjustment = 0,
  bikeSpeed = 15,
  bikeUpHillAdjustment = 20,
  bikeDownHillAdjustment = -10,
  transitDate = NULL,
  transitTime = NULL,
  transitDuration = NULL,
  transitMaxWalkingTimeFromSource = NULL,
  transitMaxWalkingTimeToTarget = NULL,
  transitEarliestArrival = FALSE,
  transitMaxTransfers = NULL,
  edgeWeight = "time",
  maxEdgeWeight = 1800,
  elevation = FALSE,
  serializer = "geojson",
  srid = 4326,
  minPolygonHoleSize = NULL,
  buffer = NULL,
  simplify = NULL,
  quadrantSegments = NULL,
  decimalPrecision = NULL
)

Arguments

travelType

What mode of transport to use - car, bike, walk or public transport.

travelTimes

A list of times - each time corresponds to a different polygon. Your API key will determine how many you can add. Acceptable formats are numeric (interpreted as seconds), or a string of the form .h.m.s. E.g. for 1 hour, "1h", 90 minutes = "1h30m" or "90m" etc.

intersectionMode

Whether to calculate the union or intersection of multiple sources.

carRushHour

Account for rush hour while driving.

walkSpeed, walkUpHillAdjustment, walkDownHillAdjustment

Settings for walking travel type.

bikeSpeed, bikeUpHillAdjustment, bikeDownHillAdjustment

Settings for cycling travel type.

transitDate

The date for public transport calculations (YYYYMMDD).

transitTime

The time in seconds since midnight to begin transit.

transitDuration

The duration of the transit timeframe (seconds or .h.m.s string).

transitMaxWalkingTimeFromSource, transitMaxWalkingTimeToTarget

Settings for transit travel type.

transitMaxTransfers, transitEarliestArrival

Further transit settings.

edgeWeight

Should calculations be in "time" or "distance"?

maxEdgeWeight

The max time or distance to search for routes/times in - acceptable formats are numeric (seconds or metres), or a string of the form .h.m.s for time, or .km.m.ml for distance, where ml represents miles (1609 metres).

elevation

Account for elevation?

serializer

Should be "geojson" or "json". See API for details.

srid

The spatial reference of the returned data.

minPolygonHoleSize

Minimum area of holes in returned polygons.

simplify, buffer

Parameters for manipulating the returned polygons.

quadrantSegments, decimalPrecision

Parameters for fine-tuning the returned polygons.

Value

A (filtered, no NULLs) list of options to pass to the API

Examples

targomoOptions(travelType = "transit")
#> $travelType #> [1] "transit" #> #> $travelTimes #> $travelTimes[[1]] #> [1] 600 #> #> $travelTimes[[2]] #> [1] 1200 #> #> $travelTimes[[3]] #> [1] 1800 #> #> #> $intersectionMode #> [1] "union" #> #> $carRushHour #> [1] FALSE #> #> $walkSpeed #> [1] 5 #> #> $walkUpHillAdjustment #> [1] 10 #> #> $walkDownHillAdjustment #> [1] 0 #> #> $bikeSpeed #> [1] 15 #> #> $bikeUpHillAdjustment #> [1] 20 #> #> $bikeDownHillAdjustment #> [1] -10 #> #> $transitEarliestArrival #> [1] FALSE #> #> $edgeWeight #> [1] "time" #> #> $maxEdgeWeight #> [1] 1800 #> #> $elevation #> [1] FALSE #> #> $serializer #> [1] "geojson" #> #> $srid #> [1] 4326 #>
targomoOptions(travelTimes = list("15m", "30m", "45m", "1h"), maxEdgeWeight = "1h")
#> $travelType #> [1] "bike" #> #> $travelTimes #> $travelTimes[[1]] #> [1] 900 #> #> $travelTimes[[2]] #> [1] 1800 #> #> $travelTimes[[3]] #> [1] 2700 #> #> $travelTimes[[4]] #> [1] 3600 #> #> #> $intersectionMode #> [1] "union" #> #> $carRushHour #> [1] FALSE #> #> $walkSpeed #> [1] 5 #> #> $walkUpHillAdjustment #> [1] 10 #> #> $walkDownHillAdjustment #> [1] 0 #> #> $bikeSpeed #> [1] 15 #> #> $bikeUpHillAdjustment #> [1] 20 #> #> $bikeDownHillAdjustment #> [1] -10 #> #> $transitEarliestArrival #> [1] FALSE #> #> $edgeWeight #> [1] "time" #> #> $maxEdgeWeight #> [1] 3600 #> #> $elevation #> [1] FALSE #> #> $serializer #> [1] "geojson" #> #> $srid #> [1] 4326 #>