Construct the configuration for an ORS profile. The ors_profile
object created by this function can be used as input to the
$add_profiles()
method of ORS instances
.
Arguments
- name
[character]
Name of the ORS profile. If a length-2 vector is passed, the first value is taken as the actual name and the second value is taken as the title of the profile in the configuration file (e.g.
c("driving-car", "car")
).- ...
Configuration parameters for the ORS profile. Must be key-value pairs. For details, refer to the configuration reference.
- template
logical
Whether to use a template if
name
is one of the base profiles (see details).
Value
An object of class ors_profile
that can be used to add
profiles to ors_instance
Details
ORS defines a number of base profiles including:
driving-car
driving-hgv
cycling-regular
cycling-road
cycling-electric
cycling-mountain
foot-walking
foot-hiking
wheelchair
public-transport
All base profiles have a pre-defined template. Profiles other than
the base profiles can also be constructed with ors_profile
, but
need some more sophisticated preparation (see e.g. Butzer 2017).
References
Butzer, A.S. (2017). Erstellung eines Routing-Profils für Feuerwehrfahrzeuge auf Basis von OpenStreetMap-Daten. Bachelor Thesis. Ruprecht Karl University of Heidelberg.
Examples
# Create a car profile with pre-defined defaults
ors_profile("driving-car")
#> <ors_profile>
#> car:
#> profile: driving-car
#> enabled: true
#> encoder_options:
#> turn_costs: true
#> block_fords: false
#> use_acceleration: true
#> maximum_grade_level: 1
#> conditional_access: true
#> conditional_speed: true
#> elevation: true
#> preparation:
#> min_network_size: 200
#> min_one_way_network_size: 200
#> methods:
#> ch:
#> enabled: true
#> threads: 1
#> weightings: fastest
#> lm:
#> enabled: false
#> threads: 1
#> weightings: fastest
#> landmarks: 16
#> core:
#> enabled: true
#> threads: 1
#> weightings: fastest,shortest
#> landmarks: 64
#> execution:
#> methods:
#> lm:
#> active_landmarks: 8
#> core:
#> disabling_allowed: true
#> active_landmarks: 6
# Defaults can be modified
ors_profile("driving-car", elevation = FALSE)
#> <ors_profile>
#> car:
#> profile: driving-car
#> enabled: true
#> encoder_options:
#> turn_costs: true
#> block_fords: false
#> use_acceleration: true
#> maximum_grade_level: 1
#> conditional_access: true
#> conditional_speed: true
#> elevation: false
#> preparation:
#> min_network_size: 200
#> min_one_way_network_size: 200
#> methods:
#> ch:
#> enabled: true
#> threads: 1
#> weightings: fastest
#> lm:
#> enabled: false
#> threads: 1
#> weightings: fastest
#> landmarks: 16
#> core:
#> enabled: true
#> threads: 1
#> weightings: fastest,shortest
#> landmarks: 64
#> execution:
#> methods:
#> lm:
#> active_landmarks: 8
#> core:
#> disabling_allowed: true
#> active_landmarks: 6
# Create a walking profile with given encoder options
ors_profile("bike-regular", template = FALSE, encoder_options = list(turn_costs = FALSE))
#> <ors_profile>
#> bike-regular:
#> profile: cycling-regular
#> enabled: true
#> encoder_options:
#> turn_costs: false