costing_models: Costing model constructors and helpers

Description Usage Format See Also Examples

Description

Mapzen's Isochrone service (mz_isochrone) as well as other mobility services (currently not implemented in this package, read more at https://mapzen.com/documentation/mobility/) require users to specify a "costing model." See https://mapzen.com/documentation/mobility/turn-by-turn/api-reference/#costing-models for details. These can be difficult to construct correctly, so the objects mz_costing and mz_costing_options exist to make that process less error-prone and more convenient.

Usage

1
2
3

Format

An object of class list of length 4.

See Also

mz_isochrone

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## creates a pedestrian costing model with walking speed of 2 km/hr
## that also avoids alleys.
## non-multimodal costing models will accept 0 or more options from the
## appropriate list.
mz_costing$pedestrian(
    mz_costing_options$pedestrian$walking_speed(2.0),
    mz_costing_options$pedestrian$alley_factor(0)
)

## creates a multimodal costing model that favors buses over rails, and
## has a slower than default walking speed
## (note multimodal has named arguments requiring list inputs)
mz_costing$multimodal(
    transit = list(
        mz_costing_options$transit$use_bus(1.0),
        mz_costing_options$transit$use_rail(5)
    ),
    pedestrian = list(
        mz_costing_options$pedestrian$walking_speed(4.1)
    )
)

tarakc02/rmapzen documentation built on Oct. 8, 2018, 12:20 a.m.