pub struct AutoCostingOptions { /* private fields */ }Expand description
Auto Costing Options
Implementations§
Source§impl AutoCostingOptions
impl AutoCostingOptions
Sourcepub fn builder() -> Self
pub fn builder() -> Self
Creates a new instance of AutoCostingOptions.
Sourcepub fn gate_cost(self, gate_cost: f32) -> Self
pub fn gate_cost(self, gate_cost: f32) -> Self
A cost applied when a gate with undefined or private access is encountered.
This cost is added to the estimated time / elapsed time.
Default: 30 seconds
Sourcepub fn gate_penalty(self, gate_penalty: f32) -> Self
pub fn gate_penalty(self, gate_penalty: f32) -> Self
A penalty applied when a gate with no access information is on the road.
Default: 300 seconds
Sourcepub fn private_access_penalty(self, private_access_penalty: f32) -> Self
pub fn private_access_penalty(self, private_access_penalty: f32) -> Self
Sourcepub fn destination_only_penalty(self, destination_only_penalty: f32) -> Self
pub fn destination_only_penalty(self, destination_only_penalty: f32) -> Self
A penalty applied when entering a road which is only allowed to enter if necessary to reach the destination.
Sourcepub fn toll_booth_cost(self, toll_booth_cost: f32) -> Self
pub fn toll_booth_cost(self, toll_booth_cost: f32) -> Self
A cost applied when a toll booth is encountered.
This cost is added to the estimated and elapsed times.
Default: 15 seconds
Sourcepub fn toll_booth_penalty(self, toll_booth_penalty: f32) -> Self
pub fn toll_booth_penalty(self, toll_booth_penalty: f32) -> Self
A penalty applied to the cost when a toll booth is encountered.
This penalty can be used to create paths that avoid toll roads.
Default: 0
Sourcepub fn ferry_cost(self, ferry_cost: f32) -> Self
pub fn ferry_cost(self, ferry_cost: f32) -> Self
A cost applied when entering a ferry.
This cost is added to the estimated and elapsed times.
Default: 300 seconds (5 minutes)
Sourcepub fn use_ferry(self, use_ferry: f32) -> Self
pub fn use_ferry(self, use_ferry: f32) -> Self
This value indicates the willingness to take ferries.
This is a range of values between 0 and 1:
- Values near
0attempt to avoid ferries and - values near
1will favor ferries.
Note: sometimes ferries are required to complete a route so values of 0 are not guaranteed to avoid ferries entirely.
Default: 0.5
Sourcepub fn use_highways(self, use_highways: f32) -> Self
pub fn use_highways(self, use_highways: f32) -> Self
This value indicates the willingness to take highways.
This is a range of values between 0 and 1:
- Values near
0attempt to avoid highways and - values near
1will favor highways.
Note: sometimes highways are required to complete a route so values of 0 are not guaranteed to avoid highways entirely.
Default: 1.0
Sourcepub fn use_tolls(self, use_tolls: f32) -> Self
pub fn use_tolls(self, use_tolls: f32) -> Self
This value indicates the willingness to take roads with tolls.
This is a range of values between 0 and 1:
- Values near
0attempt to avoid tolls and - values near
1will not attempt to avoid them.
Note: sometimes roads with tolls are required to complete a route so values of 0 are not guaranteed to avoid them entirely.
Default: 0.5
Sourcepub fn use_living_streets(self, use_living_streets: f32) -> Self
pub fn use_living_streets(self, use_living_streets: f32) -> Self
This value indicates the willingness to take living streets.
This is a range of values between 0 and 1:
- Values near
0attempt to avoid living streets and - values near
1will favor living streets.
Note: sometimes living streets are required to complete a route so values of 0 are not guaranteed to avoid living streets entirely.
Default:
truck:0cars/buses/motor scooters/motorcycles:0.1
Sourcepub fn use_tracks(self, use_tracks: f32) -> Self
pub fn use_tracks(self, use_tracks: f32) -> Self
This value indicates the willingness to take track roads.
This is a range of values between 0 and 1:
- Values near
0attempt to avoid tracks and - values near
1will favor tracks a little bit.
Note: sometimes tracks are required to complete a route so values of 0 are not guaranteed to avoid tracks entirely.
Default:
0for autos,0.5for motor scooters and motorcycles.
Sourcepub fn service_penalty(self, service_penalty: f32) -> Self
pub fn service_penalty(self, service_penalty: f32) -> Self
A penalty applied for transition to generic service road.
Default:
0trucks and15for cars, buses, motor scooters and motorcycles.
Sourcepub fn service_factor(self, service_factor: f32) -> Self
pub fn service_factor(self, service_factor: f32) -> Self
A factor that modifies (multiplies) the cost when generic service roads are encountered.
Default: 1
Sourcepub fn country_crossing_cost(self, country_crossing_cost: f32) -> Self
pub fn country_crossing_cost(self, country_crossing_cost: f32) -> Self
A cost applied when encountering an international border.
This cost is added to the estimated and elapsed times.
Default: 600 seconds
Sourcepub fn country_crossing_penalty(self, country_crossing_penalty: f32) -> Self
pub fn country_crossing_penalty(self, country_crossing_penalty: f32) -> Self
A penalty applied for a country crossing.
This penalty can be used to create paths that avoid spanning country boundaries.
Default: 0
Sourcepub fn only_consider_quasi_shortest(self) -> Self
pub fn only_consider_quasi_shortest(self) -> Self
Changes the metric to quasi-shortest, i.e. purely distance-based costing.
Disables ALL other costings & penalties. Also note, shortest will not disable hierarchy pruning, leading to potentially sub-optimal routes for some costing models.
Default: false
Sourcepub fn use_distance(self, use_distance: f32) -> Self
pub fn use_distance(self, use_distance: f32) -> Self
A factor that allows controlling the contribution of distance and time to the route costs.
The value is in range between 0 and 1, where
0only takes time into account (default),0.5will weight them roughly equally1only distance.
Note: this costing is currently only available for super::Costing::Auto.
Sourcepub fn disable_hierarchy_pruning(self) -> Self
pub fn disable_hierarchy_pruning(self) -> Self
Disable hierarchies to calculate the actual optimal route.
Note: This could be quite a performance drainer so there is an upper limit of distance.
If the upper limit is exceeded, this option will always be false.
Default: false
Sourcepub fn top_speed(self, top_speed: f32) -> Self
pub fn top_speed(self, top_speed: f32) -> Self
Top speed the vehicle can go.
Also used to avoid roads with higher speeds than this value.
Must be between 10 and 252 KPH.
Default:
truck:120 KPHauto/bus:140 KPH
Sourcepub fn fixed_speed(self, fixed_speed: u32) -> Self
pub fn fixed_speed(self, fixed_speed: u32) -> Self
Fixed speed the vehicle can go. Used to override the calculated speed.
Can be useful if speed of vehicle is known.
Must be between 1 and 252 KPH.
Default: 0KPH which disables fixed speed and falls back to the standard calculated speed
based on the road attribution.
Sourcepub fn closure_factor(self, closure_factor: f32) -> Self
pub fn closure_factor(self, closure_factor: f32) -> Self
A factor that penalizes the cost when traversing a closed edge
Example:
If search_filter.exclude_closures is false for origin and/or destination
location and the route starts/ends on closed edges.
Its value can range from
1.0don’t penalize closed edges,- to
10.0apply high cost penalty to closed edges.
Note: This factor is applicable only for motorized modes of transport, i.e auto, motorcycle, motor_scooter, bus, truck & taxi.
Default: 9.0
Sourcepub fn ignore_closures(self) -> Self
pub fn ignore_closures(self) -> Self
If set ignores all closures, marked due to live traffic closures, during routing.
Note: This option cannot be set if location.search_filter.exclude_closures is also
specified in the request and will return an error if it is
Sourcepub fn ignore_restrictions(self) -> Self
pub fn ignore_restrictions(self) -> Self
If set, ignores any restrictions (e.g. turn/dimensional/conditional restrictions).
Especially useful for matching GPS traces to the road network regardless of restrictions.
Default: false
Sourcepub fn ignore_oneways(self) -> Self
pub fn ignore_oneways(self) -> Self
If set, ignores one-way restrictions.
Especially useful for matching GPS traces to the road network ignoring uni-directional traffic rules.
Not included in Self::ignore_restrictions option.
Default: false
Sourcepub fn ignore_non_vehicular_restrictions(self) -> Self
pub fn ignore_non_vehicular_restrictions(self) -> Self
Similar to Self::ignore_restrictions, but will respect restrictions that impact vehicle safety,
such as weight and size restrictions.
Default: false
Sourcepub fn ignore_access(self) -> Self
pub fn ignore_access(self) -> Self
Ignore mode-specific access tags.
Especially useful for matching GPS traces to the road network regardless of restrictions.
Default false
Sourcepub fn speed_types(self, speed_types: UsedSpeedSources) -> Self
pub fn speed_types(self, speed_types: UsedSpeedSources) -> Self
Will determine which speed sources are used, if available.
A list of strings with the following possible values:
UsedSpeedSources::AllUsedSpeedSources::FreeflowUsedSpeedSources::ConstrainedUsedSpeedSources::PredictedUsedSpeedSources::Current
Default: UsedSpeedSources::All sources (again, only if available)
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
The height of the vehicle (in meters).
Default:
car/bus/taxi:1.9andtruck:4.11
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
The width of the vehicle (in meters).
Default:
car/bus/taxi:1.6andtruck:2.6
Sourcepub fn exclude_unpaved(self) -> Self
pub fn exclude_unpaved(self) -> Self
Exclude unpaved roads.
If exclude_unpaved is set it is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path, otherwise they are allowed.
Default: false.
Sourcepub fn exclude_cash_only_tolls(self, exclude_cash_only_tolls: bool) -> Self
pub fn exclude_cash_only_tolls(self, exclude_cash_only_tolls: bool) -> Self
Desire to avoid routes with cash-only tolls.
Default: false.
Sourcepub fn include_hov2(self, include_hov2: bool) -> Self
pub fn include_hov2(self, include_hov2: bool) -> Self
Include HOV roads with a 2-occupant requirement in the route when advantageous.
Default: false.
Sourcepub fn include_hov3(self, include_hov3: bool) -> Self
pub fn include_hov3(self, include_hov3: bool) -> Self
Include HOV roads with a 3-occupant requirement in the route when advantageous.
Default: false.
Sourcepub fn include_hot(self, include_hot: bool) -> Self
pub fn include_hot(self, include_hot: bool) -> Self
Include tolled HOV roads which require the driver to pay a toll if the occupant requirement isn’t met.
Default: false.
Trait Implementations§
Source§impl Clone for AutoCostingOptions
impl Clone for AutoCostingOptions
Source§fn clone(&self) -> AutoCostingOptions
fn clone(&self) -> AutoCostingOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more