Route

The route service guides you between points by car, bike, foot, and multimodal combinations involving walking and riding public transit. Your apps can use the results from the route service to plan multimodal journeys with narratives to guide users by text and by voice.

SecurityApiKeyAuth
Request
Request Body schema: application/json
Array of objects >= 2 items
costing
string (CostingModel)

Routing service uses dynamic, run-time costing to generate the route path. The route request must include the name of the costing model and can include optional parameters available for the chosen costing model.

  • auto - Standard costing for driving routes by car, motorcycle, truck, and so on that obeys automobile driving rules, such as access and turn restrictions. Auto provides a short time path (though not guaranteed to be shortest time) and uses intersection costing to minimize turns and maneuvers or road name changes. Routes also tend to favor highways and higher classification roads, such as motorways and trunks.
  • bicycle - Standard costing for travel by bicycle, with a slight preference for using cycleways or roads with bicycle lanes. Bicycle routes follow regular roads when needed, but avoid roads without bicycle access.
  • bus - Standard costing for bus routes. Bus costing inherits the auto costing behaviors, but checks for bus access on the roads.
  • bikeshare - A combination of pedestrian and bicycle. Use bike share station(amenity:bicycle_rental) to change the travel mode.
  • truck - Standard costing for trucks. Truck costing inherits the auto costing behaviors, but checks for truck access, width and height restrictions, and weight limits on the roads.
  • taxi - Standard costing for taxi routes. Taxi costing inherits the auto costing behaviors, but checks for taxi lane access on the roads and favors those roads.
  • motor_scooter - Standard costing for travel by motor scooter or moped. By default, motor_scooter costing will avoid higher class roads unless the country overrides allows motor scooters on these roads. Motor scooter routes follow regular roads when needed, but avoid roads without motor_scooter, moped, or mofa access.
  • motorcycle - Standard costing for travel by motorcycle. This costing model provides options to tune the route to take roadways (road touring) vs. tracks and trails (adventure motorcycling).
  • pedestrian - Standard walking route that excludes roads without pedestrian access. In general, pedestrian routes are shortest distance with the following exceptions: walkways and footpaths are slightly favored, while steps or stairs and alleys are slightly avoided.
  • multimodal - pedestrian and transit
Enum: "auto" "bicycle" "bus" "bikeshare" "truck" "taxi" "motor_scooter" "motorcycle" "pedestrian" "multimodal"
object

Costing methods can have several options that can be adjusted to develop the route path, as well as for estimating time along the path. Specify costing model options in your request using the format of costing_options.type, such as auto.

  • Cost options are fixed costs in seconds that are added to both the path cost and the estimated time. Examples of costs are gate_costs and toll_booth_costs, where a fixed amount of time is added. Costs are not generally used to influence the route path; instead, use penalties to do this. Costs must be in the range of 0.0 seconds to 43200.0 seconds (12 hours), otherwise a default value will be assigned.
  • Penalty options are fixed costs in seconds that are only added to the path cost. Penalties can influence the route path determination but do not add to the estimated time along the path. For example, add a toll_booth_penalty to create route paths that tend to avoid toll booths. Penalties must be in the range of 0.0 seconds to 43200.0 seconds (12 hours), otherwise a default value will be assigned.
  • Factor options are used to multiply the cost along an edge or road section in a way that influences the path to favor or avoid a particular attribute. Factor options do not impact estimated time along the path, though. Factors must be in the range 0.1 to 100000.0, where factors of 1.0 have no influence on cost. Anything outside of this range will be assigned a default value. Use a factor less than 1.0 to attempt to favor paths containing preferred attributes, and a value greater than 1.0 to avoid paths with undesirable attributes. Avoidance factors are more effective than favor factors at influencing a path. A factor's impact also depends on the length of road containing the specified attribute, as longer roads have more impact on the costing than very short roads. For this reason, penalty options tend to be better at influencing paths. A special costing option is shortest, which, when true, will solely use distance as cost and disregard all other costs, penalties and factors. It's available for all costing models except multimodal & bikeshare. Another special case is disable_hierarchy_pruning costing option. As the name indicates, disable_hierarchy_pruning = true will disable hierarchies in routing algorithms, which allows us to find the actual optimal route even in edge cases. For example, together with shortest = true they can find the actual shortest route. When disable_hierarchy_pruning is true and arc distances between source and target are not above the max limit, the actual optimal route will be calculated at the expense of performance. Note that if arc distances between locations exceed the max limit, disable_hierarchy_pruning is true will not be applied. This costing option is available for all motorized costing models, i.e auto, motorcycle, motor_scooter, bus, truck & taxi. For bicycle and pedestrian hierarchies are always disabled by default.
units
string
Default: "km"

Distance units for output. Allowable unit types are miles (or mi) and kilometers (or km). If no unit type is specified, the units default to kilometers.

Enum: "km" "mi"
directions_type
string
Default: "instructions"
  • none indicating no maneuvers or instructions should be returned. * maneuvers indicating that only maneuvers be returned. * instructions indicating that maneuvers with instructions should be returned (this is the default if not specified).
Enum: "none" "maneuvers" "instructions"
language
string
Default: "en"

The language of the narration instructions based on the IETF BCP 47 language tag string. If no language is specified or the specified language is unsupported, English en is used. Currently supported language list:

  • bg - Bulgarian (Bulgaria)
  • ca - Catalan (Spain)
  • cs - Czech (Czech Republic)
  • da - Danish (Denmark)
  • de - German (Germany)
  • el - Greek (Greece)
  • en - English
  • es - Spanish (Spain)
  • et - Estonian (Estonia)
  • fi - Finnish (Finland)
  • fr - French (France)
  • hi - Hindi (India)
  • hu - Hungarian (Hungary)
  • it - Italian (Italy)
  • ja - Japanese (Japan)
  • nb - Bokmal (Norway)
  • nl - Dutch (Netherlands)
  • pl - Polish (Poland)
  • pt - Portuguese
  • ro - Romanian (Romania)
  • ru - Russian (Russia)
  • sk - Slovak (Slovakia)
  • sl - Slovenian (Slovenia)
  • sv - Swedish (Sweden)
  • tr - Turkish (Turkey)
  • uk - Ukrainian (Ukraine)
Enum: "bg" "ca" "cs" "da" "de" "el" "en" "es" "et" "fi" "fr" "hi" "hu" "it" "ja" "nb" "nl" "pl" "pt" "ro" "ru" "sk" "sl" "sv" "tr" "uk"
alternates
number
Default: 1

A number denoting how many alternate routes should be provided. There may be no alternates or less alternates than the user specifies. Alternates are not yet supported on multipoint routes (that is, routes with more than 2 locations). They are also not supported on time dependent routes.

Array of objects

A set of locations to exclude or avoid within a route can be specified using a JSON array of exclude_locations. The exclude_locations have the same format as the locations list. At a minimum each excluded location must include latitude and longitude. The exclude_locations are mapped to the closest road or roads and these roads are excluded from the route path computation.

exclude_polygons
Array of numbers

One or multiple exterior rings of polygons in the form of nested JSON arrays, e.g. [[[lon1, lat1], [lon2,lat2]],[[lon1,lat1],[lon2,lat2]]]. Roads intersecting these rings will be avoided during path finding. If you only need to avoid a few specific roads, it's much more efficient to use exclude_locations.

object

This is the local date and time at the location.

linear_references
boolean

When present and true, the successful route response will include a key linear_references. Its value is an array of base64-encoded OpenLR location references, one for each graph edge of the road network matched by the input trace.

roundabout_exits
boolean
Default: true

A boolean indicating whether exit instructions at roundabouts should be added to the output or not.

Responses
200

Route result.

400

Incorrect request parameters.

401

API key is incorrect or not provided.

402

Subscription daily limit exceeded.

403

Subscription suspended.

post/route
Request samples
application/json
{
  • "locations": [
    • {
      • "lat": -90,
      • "lon": -180,
      • "type": "break"
      },
    • {
      • "lat": -90,
      • "lon": -180,
      • "type": "break"
      }
    ],
  • "costing": "auto",
  • "costing_options": {
    • "auto": {
      • "maneuver_penalty": 5,
      • "gate_cost": 30,
      • "gate_penalty": 300,
      • "private_access_penalty": 450,
      • "toll_booth_cost": 15,
      • "toll_booth_penalty": 0,
      • "ferry_cost": 300,
      • "use_ferry": 0.5,
      • "use_highways": 1,
      • "use_tolls": 0.5,
      • "use_living_streets": 1,
      • "use_tracks": 1,
      • "service_penalty": 0,
      • "service_factor": 1,
      • "country_crossing_cost": 600,
      • "country_crossing_penalty": 1,
      • "shortest": false,
      • "disable_hierarchy_pruning": false,
      • "top_speed": 140,
      • "fixed_speed": 0,
      • "ignore_closures": true,
      • "closure_factor": 9,
      • "height": 0,
      • "width": 0,
      • "exclude_unpaved": true,
      • "exclude_cash_only_tolls": false,
      • "include_hov2": false,
      • "include_hov3": false,
      • "include_hot": false
      },
    • "bus": {
      • "maneuver_penalty": 5,
      • "gate_cost": 30,
      • "gate_penalty": 300,
      • "private_access_penalty": 450,
      • "toll_booth_cost": 15,
      • "toll_booth_penalty": 0,
      • "ferry_cost": 300,
      • "use_ferry": 0.5,
      • "use_highways": 1,
      • "use_tolls": 0.5,
      • "use_living_streets": 1,
      • "use_tracks": 1,
      • "service_penalty": 0,
      • "service_factor": 1,
      • "country_crossing_cost": 600,
      • "country_crossing_penalty": 1,
      • "shortest": false,
      • "disable_hierarchy_pruning": false,
      • "top_speed": 140,
      • "fixed_speed": 0,
      • "ignore_closures": true,
      • "closure_factor": 9,
      • "height": 0,
      • "width": 0,
      • "exclude_unpaved": true,
      • "exclude_cash_only_tolls": false,
      • "include_hov2": false,
      • "include_hov3": false,
      • "include_hot": false
      },
    • "truck": {
      • "maneuver_penalty": 5,
      • "gate_cost": 30,
      • "gate_penalty": 300,
      • "private_access_penalty": 450,
      • "toll_booth_cost": 15,
      • "toll_booth_penalty": 0,
      • "ferry_cost": 300,
      • "use_ferry": 0.5,
      • "use_highways": 1,
      • "use_tolls": 0.5,
      • "use_living_streets": 1,
      • "use_tracks": 1,
      • "service_penalty": 0,
      • "service_factor": 1,
      • "country_crossing_cost": 600,
      • "country_crossing_penalty": 1,
      • "shortest": false,
      • "disable_hierarchy_pruning": false,
      • "top_speed": 140,
      • "fixed_speed": 0,
      • "ignore_closures": true,
      • "closure_factor": 9,
      • "height": 0,
      • "width": 0,
      • "exclude_unpaved": true,
      • "exclude_cash_only_tolls": false,
      • "include_hov2": false,
      • "include_hov3": false,
      • "include_hot": false,
      • "length": 21.64,
      • "weight": 21.77,
      • "axle_load": 9.07,
      • "axle_count": 5,
      • "hazmat": false
      },
    • "taxi": {
      • "height": 0,
      • "width": 0,
      • "exclude_unpaved": true,
      • "exclude_cash_only_tolls": false,
      • "include_hov2": false,
      • "include_hov3": false,
      • "include_hot": false
      },
    • "bicycle": {
      • "bicycle_type": "Road",
      • "cycling_speed": 18,
      • "use_roads": 0.5,
      • "use_hills": 0.5,
      • "use_ferry": 0.5,
      • "use_living_streets": 0.5,
      • "avoid_bad_surfaces": 0.25,
      • "bss_return_cost": 120,
      • "shortest": false
      },
    • "bikeshare": {
      • "walking_speed": 5.1,
      • "walkway_factor": 1,
      • "sidewalk_factor": 1,
      • "alley_factor": 2,
      • "driveway_factor": 5,
      • "step_penalty": 0,
      • "use_ferry": 0.5,
      • "use_living_streets": 0.5,
      • "use_tracks": 0.5,
      • "use_hills": 0.5,
      • "use_lit": 0,
      • "service_penalty": 0,
      • "service_factor": 1,
      • "max_hiking_difficulty": 1,
      • "bss_rent_cost": 120,
      • "shortest": false,
      • "transit_start_end_max_distance": 2145,
      • "transit_transfer_max_distance": 800,
      • "bicycle_type": "Road",
      • "cycling_speed": 18,
      • "use_roads": 0.5,
      • "avoid_bad_surfaces": 0.25,
      • "bss_return_cost": 120
      },
    • "motor_scooter": {
      • "top_speed": 45,
      • "use_primary": 0.5,
      • "use_hills": 0.5,
      • "shortest": false,
      • "disable_hierarchy_pruning": false
      },
    • "motorcycle": {
      • "use_highways": 1,
      • "use_trails": 0,
      • "shortest": false,
      • "disable_hierarchy_pruning": false
      },
    • "pedestrian": {
      • "walking_speed": 5.1,
      • "walkway_factor": 1,
      • "sidewalk_factor": 1,
      • "alley_factor": 2,
      • "driveway_factor": 5,
      • "step_penalty": 0,
      • "use_ferry": 0.5,
      • "use_living_streets": 0.6,
      • "use_tracks": 0.5,
      • "use_hills": 0.5,
      • "use_lit": 0,
      • "service_penalty": 0,
      • "service_factor": 1,
      • "max_hiking_difficulty": 1,
      • "bss_rent_cost": 120,
      • "shortest": false,
      • "transit_start_end_max_distance": 2145,
      • "transit_transfer_max_distance": 800
      },
    • "transit": {
      • "use_bus": 1,
      • "use_rail": 1,
      • "use_transfers": 1,
      • "filters": {
        • "routes": {
          • "ids": [
            • "NYC_AUR"
            ],
          • "action": "exclude"
          },
        • "operators": {
          • "ids": [
            • "paris_CFG"
            ],
          • "action": "exclude"
          }
        }
      },
    • "multimodal": {
      • "use_bus": 1,
      • "use_rail": 1,
      • "use_transfers": 1,
      • "filters": {
        • "routes": {
          • "ids": [
            • "NYC_AUR"
            ],
          • "action": "exclude"
          },
        • "operators": {
          • "ids": [
            • "paris_CFG"
            ],
          • "action": "exclude"
          }
        }
      }
    },
  • "units": "km",
  • "directions_type": "none",
  • "language": "bg",
  • "alternates": 1,
  • "exclude_locations": [
    • {
      • "lat": -90,
      • "lon": -180
      }
    ],
  • "exclude_polygons": [
    • [
      • 0
      ]
    ],
  • "date_time": {
    • "type": 0,
    • "value": "2023-07-08T08:06"
    },
  • "linear_references": true,
  • "roundabout_exits": true
}
Response samples
application/json
{
  • "trip": {
    • "locations": [
      • {
        • "type": "string",
        • "lat": 0,
        • "lon": 0,
        • "side_of_street": "left",
        • "original_index": 0
        }
      ],
    • "legs": {
      • "maneuvers": [
        • {
          • "type": 38,
          • "instruction": "string",
          • "verbal_succinct_transition_instruction": "string",
          • "verbal_pre_transition_instruction": "string",
          • "verbal_post_transition_instruction": "string",
          • "street_names": [
            • "string"
            ],
          • "begin_street_names": [
            • "string"
            ],
          • "time": 0,
          • "length": 0,
          • "cost": 0,
          • "begin_shape_index": 0,
          • "end_shape_index": 0,
          • "toll": true,
          • "highway": true,
          • "rough": true,
          • "gate": true,
          • "ferry": true,
          • "sign": {
            • "text": "string",
            • "consecutive_count": 0
            },
          • "roundabout_exit_count": 0,
          • "depart_instruction": "string",
          • "verbal_depart_instruction": "string",
          • "arrive_instruction": "string",
          • "verbal_arrive_instruction": "string",
          • "transit_info": {
            • "onestop_id": "string",
            • "short_name": "string",
            • "long_name": "string",
            • "headsign": "string",
            • "color": "string",
            • "text_color": "string",
            • "description": "string",
            • "operator_onestop_id": "string",
            • "operator_name": "string",
            • "operator_url": "string",
            • "transit_stops": [
              • {
                • "type": null,
                • "name": null,
                • "arrival_date_time": null,
                • "departure_date_time": null,
                • "is_parent_stop": null,
                • "assumed_schedule": null,
                • "lat": null,
                • "lon": null,
                • "verbal_multi_cue": null,
                • "travel_mode": null,
                • "travel_type": null,
                • "bss_maneuver_type": null
                }
              ]
            },
          • "verbal_multi_cue": true,
          • "travel_mode": "string",
          • "travel_type": "string"
          }
        ],
      • "summary": {
        • "has_time_restrictions": true,
        • "has_toll": true,
        • "has_highway": true,
        • "has_ferry": true,
        • "min_lat": 0,
        • "min_lon": 0,
        • "max_lat": 0,
        • "max_lon": 0,
        • "time": 0,
        • "length": 0,
        • "cost": 0
        },
      • "shape": [
        • [
          • 0
          ]
        ]
      },
    • "summary": {
      • "has_time_restrictions": true,
      • "has_toll": true,
      • "has_highway": true,
      • "has_ferry": true,
      • "min_lat": 0,
      • "min_lon": 0,
      • "max_lat": 0,
      • "max_lon": 0,
      • "time": 0,
      • "length": 0,
      • "cost": 0
      },
    • "status_message": "string",
    • "status": 0,
    • "units": "string",
    • "language": "string",
    • "warnings": [ ]
    }
}
Copyright © PickPoint.io LLC 2024. All rights reserved.