here_location_services.routing_api module

This module contains classes for accessing HERE Routing API.

class here_location_services.routing_api.RoutingApi(api_key=None, auth=None, proxies=None, country='row')[source]

Bases: here_location_services.apis.Api

A class for accessing HERE routing APIs.

Parameters
__init__(api_key=None, auth=None, proxies=None, country='row')[source]
Parameters
route(transport_mode, origin, destination, via=None, origin_place_options=None, origin_waypoint_options=None, destination_place_options=None, destination_waypoint_options=None, scooter=None, departure_time=None, routing_mode='fast', alternatives=0, units='metric', lang='en-US', return_results=None, spans=None, truck=None, avoid_features=None, avoid_areas=None, exclude=None)[source]

Calculate route between two endpoints.

See further information here <https://developer.here.com/documentation/routing-api/8.16.0/api-reference-swagger.html>_.

Parameters
  • transport_mode (str) – A string to represent mode of transport.

  • origin (List) – A list of latitude and longitude of origin point of route.

  • destination (List) – A list of latitude and longitude of destination point of route.

  • via (Optional[List[here_location_services.config.routing_config.Via]]) – A list of tuples of latitude and longitude of via points.

  • origin_place_options (Optional[here_location_services.config.base_config.PlaceOptions]) – PlaceOptions optinal place options for origin.

  • origin_waypoint_options (Optional[here_location_services.config.base_config.WayPointOptions]) – WayPointOptions optional waypoint options for origin.

  • destination_place_options (Optional[here_location_services.config.base_config.PlaceOptions]) – PlaceOptions optinal place options for destination.

  • destination_waypoint_options (Optional[here_location_services.config.base_config.WayPointOptions]) – WayPointOptions optional waypoint options for destination.

  • scooter (Optional[here_location_services.config.routing_config.Scooter]) – Additional attributes for scooter route.

  • departure_time (Optional[datetime.datetime]) – datetime.datetime object.

  • routing_mode (str) – A string to represent routing mode.

  • alternatives (int) – Number of alternative routes to return aside from the optimal route. default value is 0 and maximum is 6.

  • units (str) – A string representing units of measurement used in guidance instructions. The default is metric.

  • lang (str) – A string representing preferred language of the response. The value should comply with the IETF BCP 47.

  • return_results (Optional[List]) – A list of strings.

  • spans (Optional[List]) – A list of strings to define which attributes are included in the response spans.

  • truck (Optional[here_location_services.config.base_config.Truck]) – Different truck options to use during route calculation. use object of Truck here_location_services.config.matrix_routing_config.Truck>

  • avoid_features (Optional[List[str]]) – Avoid routes that violate these properties. Avoid features are defined in AVOID_FEATURES

  • avoid_areas (Optional[List[here_location_services.config.matrix_routing_config.AvoidBoundingBox]]) – A list of areas to avoid during route calculation. To define avoid area use object of AvoidBoundingBox here_location_services.config.matrix_routing_config.AvoidBoundingBox>.

  • exclude (Optional[List[str]]) – A comma separated list of three-letter country codes (ISO-3166-1 alpha-3 code) that routes will exclude.

Returns

requests.Response object.

Raises

ApiError – If status_code of API response is not 200.