Isoline Routing
Isoline Routing API is used to calculate the area that a driver can reach within a given time or distance.
Example
import os
from datetime import datetime
from here_location_services import LS
from here_map_widget import Map, Marker, GeoJSON
from here_location_services.config.isoline_routing_config import RANGE_TYPE, ISOLINE_ROUTING_TRANSPORT_MODE
LS_API_KEY = os.environ.get("LS_API_KEY") # Get API KEY from environment.
ls = LS(api_key=LS_API_KEY)
iso_response = ls.calculate_isoline(
origin=[52.53086, 13.38469],
range="1800",
departure_time=datetime.now(),
range_type=RANGE_TYPE.time,
transport_mode=ISOLINE_ROUTING_TRANSPORT_MODE.car,
)
data = iso_response.to_geojson()
geo_layer = GeoJSON(data=data)
iso_marker = Marker(lat=52.53086, lng=13.38469)
m = Map(api_key=LS_API_KEY, center=[52.53086, 13.38469], zoom=9)
m.add_layer(geo_layer)
m.add_object(iso_marker)
m
Attributes
Attribute |
Type |
Doc |
---|---|---|
range |
string |
A string representing a range of isoline, unit is defined by parameter |
range_type |
string |
A string representing a type of |
transport_mode |
string |
Represents transport mode to be used for the calculation of isolines. Values are defined in |
origin |
list |
optional A list of |
departure_time |
|
optional departure time. |
destination |
list |
optional A list of |
arrival_time |
|
optional arrival time. |
routing_mode |
string |
optional routing mode is defined in |
shape_max_points |
int |
optional An integer to Limit the number of points in the resulting isoline geometry. If the isoline consists of multiple components, the sum of points from all components is considered. This parameter doesn’t affect performance. |
optimised_for |
string |
optional A string to specify how isoline calculation is optimized. Specify values from config: |
avoid_features |
list |
optional specify values from config: |
truck |
object of |
optional used to define truck options when transport mode is truck. |
origin_place_options |
optional place options for |
|
origin_waypoint_options |
optional waypoint options for |
|
destination_place_options |
optional place options for |
|
destination_waypoint_options |
optional waypoint options for |