Async Route
This module provides functionality for working with routes.
- class AsyncRouting[source]
Bases:
object- BASE_ENDPOINT = 'routing/'
- async classmethod route(api, stops, **kwargs)[source]
Find best driving routes between coordinates and return results.
- Parameters:
api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.
stops (str) – Comma-separated list of stop coordinates in the format lon,lat;lon,lat.
- Keyword Arguments:
alternatives (bool) – Whether to return alternative routes. Default value : False.
steps (bool) – Whether to include step-by-step navigation instructions. Default value : False.
geometries (RoutingGeometryType) – Format of the returned geometry.
overview (RoutingOverviewLevel) – Level of detail in the returned geometry.
annotations (bool) – Whether to include additional metadata like speed, weight, etc.
- Returns:
the routing output
- Return type:
Dict
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.route import AsyncRouting >>> async with AsyncGeoboxClient() as client: >>> route = await AsyncRouting.route(client, ... stops="53,33;56,36", ... alternatives=True, ... steps=True, ... geometries=RoutingGeometryType.geojson, ... overview=RoutingOverviewLevel.full, ... annotations=True) or >>> route = await client.route(stops="53,33;56,36", ... alternatives=True, ... steps=True, ... geometries=RoutingGeometryType.geojson, ... overview=RoutingOverviewLevel.full, ... annotations=True)