I am using AWS Location Services Route Calculator to determine travel time and travel distance of several origin destination pairs. The code is working but it is not reflecting travel delay due to traffic. It calculates the difference between two cities with departure time at 2 AM and 11 AM are only a couple minutes of time difference. Doing the same search manually in Here Maps shows the same times but the 11 am departure time shows a significant delay like +40 minutes probably due to traffic. Is this data available in the AWS api?
Town1 Town2 Mile 2 Mile 8 Mile 16 Mile 23 Time 2 Time 8 Time 16 Time 23
ACTON CHARLEMONT 86.56 86.56 87.98 87.98 103.68 103.89 104.95 104.31
ACTON CHARLESTOWN 23.43 23.43 22.98 23.43 38.09 38.14 44.33 42.89
def initialize_amazon_client(aws_access_key_id, aws_secret_access_key):
"""Initialize and return an Amazon Location Service client."""
session = boto3.Session(
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
region_name='us-east-1'
)
return session.client('location')
client = initialize_amazon_client(aws_access_key_id, aws_secret_access_key)
response = client.calculate_route(
CalculatorName=calculator_name,
DeparturePosition=origin,
DestinationPosition=destination,
TravelMode='Car',
DepartNow=False,
DepartureTime=departure_time,
DistanceUnit='Miles',
CarModeOptions={
'AvoidFerries': False,
'AvoidTolls': False
}
)