Function to return a list of the capabilities of the API Key. Comes with a print method to print out the main results nicely in the console.

getTargomoCapabilities(
  api_key = Sys.getenv("TARGOMO_API_KEY"),
  region = Sys.getenv("TARGOMO_REGION"),
  config = list(),
  verbose = FALSE,
  progress = FALSE
)

# S3 method for tgm_capabilities
print(x, ...)

Arguments

api_key

Your Targomo API key - defaults to the TARGOMO_API_KEY ennvironment variable

region

Your Targomo region - defaults to the TARGOMO_REGION environment variable

config

Config options to pass to httr::GET e.g. proxy settings

verbose

Whether to print out information about the API call.

progress

Whether to show a progress bar of the API call.

x

A list, output of getTargomoCapabilities

...

Further arguments to print

Value

A list of the capabilities of the given API key, in the given region

Examples

# \donttest{ caps <- getTargomoCapabilities() # print default print.default(caps)
#> $general #> $general$`default-max-routing-length` #> [1] 60000 #> #> $general$`default-max-routing-time` #> [1] 1800 #> #> $general$pathSerializer #> [1] "compact" "geojson" #> #> $general$edgeWeights #> [1] "time" "distance" #> #> $general$`min-polygon-hole-size` #> [1] 1e+08 #> #> $general$`edge-classes` #> [1] 11 12 13 14 15 16 21 22 31 32 41 42 51 63 62 71 72 81 91 92 #> #> $general$`reverse-routing` #> [1] TRUE #> #> $general$polygonSerializer #> [1] "json" "geojson" #> #> $general$`enable-bikes-on` #> NULL #> #> $general$congestion #> [1] TRUE #> #> $general$version #> [1] "targomo-config b2b2e5d" #> #> #> $transit #> property value #> 1 min-time-s 0 #> 2 min-transfer-time 180 #> 3 changing-transit-penalty-time 180 #> 4 min-date 20190320 #> 5 entering-transit-penalty-time 90 #> 6 available 1 #> 7 leaving-transit-penalty-time 90 #> 8 max-time-s 10000000 #> 9 default-frame-duration 10800 #> 10 max-date 20190905 #> 11 default-transfer-time 180 #> #> $speeds #> $speeds$defaults #> property value #> 1 default-bike-downhill-penalty -10 #> 2 default-bike-speed 15 #> 3 default-bike-uphill-penalty 20 #> 4 default-walk-downhill-penalty 0 #> 5 default-walk-speed 5 #> 6 default-walk-uphill-penalty 10 #> #> $speeds$`osm-classes` #> class factor speed #> 1 33 1 30 #> 2 99 1 5 #> 3 11 1 120 #> 4 22 1 30 #> 5 12 1 30 #> 6 13 1 90 #> 7 14 1 30 #> 8 15 1 70 #> 9 16 1 30 #> 10 1 1 10 #> 11 91 1 5 #> 12 81 1 15 #> 13 92 1 5 #> 14 71 1 10 #> 15 72 1 10 #> 16 51 1 5 #> 17 62 1 5 #> 18 41 1 30 #> 19 63 1 7 #> 20 42 1 30 #> 21 31 1 40 #> 22 32 1 40 #> 23 21 1 60 #> #> #> attr(,"class") #> [1] "tgm_capabilities" "list"
# print using bespoke method print(caps)
#> Targomo Config Version: targomo-config b2b2e5d #> #> Transit capabilities: #> ========================================= #> property value #> 1 min-time-s 0 #> 2 min-transfer-time 180 #> 3 changing-transit-penalty-time 180 #> 4 min-date 20190320 #> 5 entering-transit-penalty-time 90 #> 6 available 1 #> 7 leaving-transit-penalty-time 90 #> 8 max-time-s 10000000 #> 9 default-frame-duration 10800 #> 10 max-date 20190905 #> 11 default-transfer-time 180 #> ========================================= #> #> Default speeds: #> ========================================= #> property value #> 1 default-bike-downhill-penalty -10 #> 2 default-bike-speed 15 #> 3 default-bike-uphill-penalty 20 #> 4 default-walk-downhill-penalty 0 #> 5 default-walk-speed 5 #> 6 default-walk-uphill-penalty 10 #> =========================================
# }