Create a list of parameters that can be passed to a function that supports
additional parameters. For further information on parameters, visit the
API playground or
the backend reference.
param_info provides an overview of the checks and
preparations performed by ors_params.
Note that this function provides a means to manually construct parameters.
For all high-level endpoint functions such as ors_inspect,
parameters can be passed as dot arguments.
Usage
ors_params(
profile,
n = NULL,
bearings = NULL,
alternative_routes = list(),
geometry_simplify = FALSE,
continue_straight = FALSE,
preference = "recommended",
radiuses = NULL,
maximum_speed = NULL,
attributes = NULL,
extra_info = NULL,
elevation = FALSE,
skip_segments = NULL,
roundabout_exits = FALSE,
maneuvers = FALSE,
suppress_warnings = FALSE,
id = NULL,
instructions = TRUE,
instructions_format = "text",
language = "en",
avoid_borders = NULL,
avoid_countries = NULL,
avoid_features = NULL,
avoid_polygons = NULL,
round_trip = list(),
vehicle_type = "hgv",
restrictions = list(),
weightings = list(),
surface_quality_known = FALSE,
allow_unsuitable = FALSE,
...
)Arguments
- profile
[character]A routing profile defined by ORS. Not all combinations of profiles and parameters are supported.
- n
[integer]Number of observations used for routing. This value refers to segments as described in
ors_inspect. For use inors_pairwiseit should always be 1.- bearings
[numeric]Numeric vector or matrix with
nrows and 1 or 2 columns. The first column contains bearings that can take radial degrees between 0 and 360 (clockwise) that represent the direction during routing. An optional second column specifies the possible deviation from the bearings. Both values can also beNA_real_to skip a value or an entire input row. Bearings default to 100 if not specified. Only available forcycling-*profiles.- alternative_routes
{list}List of options for generating alternative routes. Can be one of the following options:
target_countNumber of alternatives that should be computed.
weight_factorMultiplier that specifies by what factor an alternative routes is allowed to diverge from the optimal route. Defaults to 1.4.
share_factorMultiplier that specificies the fraction an alternative route is allowed to share with the optimal route. Defaults to 0.6.
Because this parameter changes the output format, it is only available in
ors_inspect.- geometry_simplify
[logical]Whether to simplify the route geometry. Only possible if
length(n) == 1. Not available ifextra_infos are specified.- continue_straight
[logical]Whether to force the route to go straight and avoid u-turns.
- preference
[character]Specifies the route preference. Must be once of
"fastest","shortest"or"recommended". Defaults to"recommended".- radiuses
[numeric]Maximum snapping distance (in m) from an input point to the nearest road. Expects a vector of length
n. If a vector of length 1 is provided, values are recycled to lengthn.-1represents an unlimited radius. Defaults tomaximum_snapping_radiusin the configuration or 350m if not changed.- maximum_speed
[numeric]Maximum allowed speed in km/h. Must be at least 80 km/h. Only available for
driving-*profiles.- attributes
[character]Route attributes to be sent with each routing result. One or several of
"avgspeed","detourfactor"or"percentage".- extra_info
[character]Extra information to be sent with each routing result. For a list of possible values, see the details section in
ors_inspect. Becauseextra_infochanges the output format, it is only available forors_inspect.- elevation
[logical]Whether to include elevation information in the routing response.
- skip_segments
[numeric]Vector of route segments to skip. Must be values between 1 and n where 1 represents the segment between the first and second input point.
- roundabout_exits
[logical]Whether to include information about bearings of roundabout exits in the routing response.
- maneuvers
[logical]Whether to include information about maneuvers in the routing response. Maneuvers describe the bearing before and after a waypoint has been passed on a route.
- suppress_warnings
[logical]Whether to suppress warnings in the routing response.
- id
[character]Any identifier to be sent with the routing request and returned in the routing response.
- instructions
[logical]Whether to include navigation information in the routing response.
- instructions_format
[character]Format for navigation instructions. Can be one of
"text"or"html". HTML instructions are more verbose.- language
[character]Language of the navigation instructions. One of
"cs","cs-cz","de","de-de","en","en-us","eo","eo-eo","es","es-es","fr","fr-fr","gr","gr-gr","he","he-il","hu","hu-hu","id","id-id","it","it-it","ja","ja-jp","ne","ne-np","nl","nl-nl","nb","nb-no","pl","pl-pl","pt","pt-pt","ro","ro-ro","ru","ru-ru","tr","tr-tr","zh"or"zh-cn".- avoid_borders
[character]Type of border to avoid. One of
"all","controlled", or"none". Requiresdriving-*profiles.- avoid_countries
[integer]Vector of country codes to avoid. Requires
avoid_borders = "controlled". A list of country codes can be found in the API reference or by runningcountry_info. Requiresdriving-*profiles.- avoid_features
[character]Features to avoid. One of
"highways","tollways"or"ferries".- avoid_polygons
[sf/sfc]sfobject containing polygons or multipolygons that describe areas to avoid. Must have CRSEPSG:4326.- round_trip
[list]List of options for generating round trips. Can include the following options:
lengthTarget length of the round trip (in m)
pointsNumber of points to create the round trip
seedRNG seed to control randomness in the direction of the round trip
Because this parameter changes the output format, it is only available in
ors_inspect.- vehicle_type
[character]If
profileis"driving-hgv", specifies the vehicle type. One of"hgv","bus","agricultural","agricultural","delivery","forestry","goods"or"unknown".- restrictions
[list]List of options for restricting waypoint edges. If an edge does not meet the restrictions, it is discarded. Can include the following options:
lengthLength restrictions for
"driving-hgv"in m.widthWidth restrictions for
"driving-hgv"in m.heightHeight restrictions for
"driving-hgv"in m.axleloadAxleload restrictions for
"driving-hgv"in tons.weightWeight restrictions for
"driving-hgv"in m.hazmatWhether to adjust routing for transportation hazardous goods, i.e. avoid protected areas, for
"driving-hgv". Defaults toFALSE.surface_typeMinimum surface type for
"wheelchair". Corresponds to the values of OSM Key:surface. Defaults to"sett".track_typeMinimum track grade for
"wheelchair". Corresponds to the values of OSM Key:tracktype. Defaults to"grade1".smoothness_typeMinimum track smoothness for
"wheelchair". Corresponds to the values of OSM Key:smoothness. Defaults to"good".maximum_sloped_kerbMaximum sloped curb height for
"wheelchair"(in m). Defaults to 0.6 m.maximum_inclineMaximum incline for
"wheelchair"(in percent). Defaults to 6 percent.minimum_widthMinimum footway width for
"wheelchair"(in m). Defaults to 2.5 m.
- weightings
[list]List of options for weighting waypoint edges. Can include the following options:
- steepness_difficulty
Proficiency level for
cycling-*profiles. Can be an integer between 0 and 3 corresponding to the levels "novice", "moderate", "amateuer" and "pro".- green
Multiplier between 0 and 1 that weights the importance of green areas at waypoint edges. If 1, always prefers green routes. Only available for
foot-*profiles.- quiet
Multiplier between 0 and 1 that weights the importance of quiet areas at waypoint edges. If 1, always prefers quiet routes. Only available for
foot-*profiles.- shadow
Multiplier between 0 and 1 that weights the importance of shadow areas at waypoint edges. If 1, always prefers shadowy routes. Only available for
foot-*profiles.
- surface_quality_known
[logical]Whether to force routes to follow ways whose surface quality is known. Only available for
"wheelchair"profile.- allow_unsuitable
[logical]Whether unsuitable ways should be included in routing. Only available for
"wheelchair"profile.- ...
Reserved for further expansion. If a dot argument is used, an error is thrown.
Details
This function performs some basic validation checks. If a check fails, an error is thrown. In particular, the following reasons can lead to an error:
"requires a different profile": Some parameters require a specific profile. For example,
vehicle_typeis only meaningful for profiledriving-hgv. If the profile inprofiledoes not match the required profile, an error is thrown."invalid length": Some parameters allow vectors of length > 1, but some require scalar values.
"exceeds defined value limits": Some parameters are only valid within a certain value range. For example, the
green,quiet, andshadowparameters expect a value between 0 and 1. If outside of the defined value range, an error is thrown."undefined values": Some parameters require a specific pre-defined string. For example, the
preferenceparameters expects either "fastest", "shortest", or "recommended". If any other value, an error is thrown."invalid sf object": The
avoid_polygonsparameter expects an sf object. Otherwise, an error is thrown.
