Does apple give any api to calculate eta(Estimated Time of Arrival) between two locations like google directions api does?if yes then kindly give some reference of it.
Related
I want to find a travel time (including traffic) between two addresses.
Inputs - origin, destination, arrival time, mode of transportation, traffic model (pessimistic, optimistic, best guess)
Output - Travel time
It looks like the Google Distance Matrix API is the API I should be using for this except that I am not able to add an input of arrival time for driving. I am prompted to add a departure time. When the transportation mode is transit I am able to enter an arrival time.
Is this a limitation of the distance matrix API? Is there a paid for version or another work around for this?
As of today (January 6, 2019) arrival time for driving is not supported. Here is the relevant portion of the help file for the API's directions method:
:param arrival_time: Specifies the desired time of arrival for transit
directions. Note: you can't specify both departure_time and
arrival_time.
:type arrival_time: int or datetime.datetime
The key being that arrival time is only used for transit directions and not driving directions. When I use mode='driving' and an arrival_time, I get and error that ends with:
raise googlemaps.exceptions.HTTPError(response.status_code)
googlemaps.exceptions.HTTPError: HTTP Error: 400
When I change this to a departure_time, the function call works just fine.
Explicit answers to the questions:
Is this a limitation of the distance matrix API?
Yes.
Is there a paid for version or another work around for this?
No. Your only option is call the API with a guess for the departure time, find the travel time and then iterate until the arrival time converges.
instead of using the google direction matrix try to use google map direction API, it will give you best results with the time distance and traffic update, see GOOGLE MAP DIRECTIONS API docs.
You need to use the Google map distance matrix API, which get input as source latitude, longitude and destination latitude, longitude. It will return the json file contains the source address, destination address, distance in km and time with traffic and without traffic.Below is link follow it
https://developers.google.com/maps/documentation/distance-matrix/intro
There is also a limit of this API, it allows only 2500 hits per day
I use the Google Directions API for calculating the needed time between 2 places. The API gives me an option departure_time, where I can pass the timestamp of the departure time (or "now"). Then the answer is the duration_in_traffic. This is working really great.
But I need to show the amount of time that the user needs with his car, when he want to be at his target at a specific time.
E.g. the user wants to be in Dortmund at 8pm (20:00). So I need to show him when he should start driving to arrive in time at his desired goal. The API-documentation says, that there is a parameter arrival_time, which does exactly what I need. Unfortunately they say it does only work for public-transport.
But Google maps itself offers the desired functionallity even for cars! As you can see in the screenshot: I said that I want to be in dortmund at 20:00 and google-maps says, I should start driving 'arround 18:30'
So how I can I achieve this with my app? Do I need another API or do I need to pass other parameters?
Here is my current API call:
https://maps.googleapis.com/maps/api/directions/json?origin=Bielefeld&destination=Dortmund&arrival_time=1460836800&key=AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxx
best regards
Michael
My company is looking for map API that supports driving route and time inquiries for future trips, e.g. getting a best route for a trip tomorrow at noon. A closer prediction would be use historical average traffic to generate such a route.
I thought Google Maps would have such capability, but it doesn't seem that they do, according to the description on their website:
"For driving directions: Google Maps API for Work customers can specify the departure_time to receive trip duration considering current traffic conditions. The departure_time must be set to within a few minutes of the current time."
So my question is: why Google is not doing general departure_time based inquiries at the moment? Is Google planning to offer the service in future? If so, when?
Thanks!
You can submit a feature request at Google Maps Issue Tracker
When I use the Google Maps directions API (server-side) the distance and duration are almost always different then the embedded (iframe) maps tells me.
I use the embedded version to show to the customer, and I use the API version to calculate the taxi price. It is therefore necessary that I get the same distance and duration from both services.
I am using the following origin address: Straße des 17. Juni, Berlin, Germany
I am using the following destination address: Amsterdam Airport Schiphol, Netherlands
With the above route, this is the output:
Embedded (iframe): 6 hours 31 mins - 661km
API (server-side): 6 hours 3 mins - 662km
Directions API: https://developers.google.com/maps/documentation/directions/
Directions Embed: https://developers.google.com/maps/documentation/embed/start
Hope somebody can help me out.
Different distance:
the embedded changes your destination to "Schiphol Amsterdam Airport, Evert van de Beekstraat 202, 1118 CP Schiphol, Netherlands" while the API call leaves it exactly like you entered it. The resulting coordinates are different
API call with exact string
API call with slightly modified destination
Different time:
Looks like the embed is taking into account traffic conditions and departure_time and the API call does not. Are you using an API key?
For driving directions: Google Maps API for Work customers can specify the departure_time to receive trip duration considering current traffic conditions
I am working on plotting a multi-colored route using Google Maps API. It should plot different colors based on time elapsed between two points. For this I am trying to find location after user enters time taken to reach that location.
Is there any method to do so?