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.ApiA class for accessing HERE routing APIs.
- Parameters
api_key (Optional[str]) –
auth (Optional[here_location_services.platform.auth.Auth]) –
proxies (Optional[dict]) –
country (str) –
- __init__(api_key=None, auth=None, proxies=None, country='row')[source]¶
- Parameters
api_key (Optional[str]) –
auth (Optional[here_location_services.platform.auth.Auth]) –
proxies (Optional[dict]) –
country (str) –
- 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
latitudeandlongitudeof origin point of route.destination (List) – A list of
latitudeandlongitudeof destination point of route.via (Optional[List[here_location_services.config.routing_config.Via]]) – A list of tuples of
latitudeandlongitudeof via points.origin_place_options (Optional[here_location_services.config.base_config.PlaceOptions]) –
PlaceOptionsoptinal place options fororigin.origin_waypoint_options (Optional[here_location_services.config.base_config.WayPointOptions]) –
WayPointOptionsoptional waypoint options fororigin.destination_place_options (Optional[here_location_services.config.base_config.PlaceOptions]) –
PlaceOptionsoptinal place options fordestination.destination_waypoint_options (Optional[here_location_services.config.base_config.WayPointOptions]) –
WayPointOptionsoptional waypoint options fordestination.scooter (Optional[here_location_services.config.routing_config.Scooter]) – Additional attributes for scooter route.
departure_time (Optional[datetime.datetime]) –
datetime.datetimeobject.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
0and maximum is6.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_FEATURESavoid_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.Responseobject.- Raises
ApiError – If
status_codeof API response is not 200.