mvanveen / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
1 stars 0 forks source link

Google Maps Distance_Matrix timing out #344

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Running my program that calls the Google Maps Distance Matrix some 
(currently unknown) number of times

What is the expected output? What do you see instead?

I expect to return a Distance Matrix, but instead I get a Timeout exception.  
If I exceeded the daily usage for my API key, I believe a different exception 
should be raised (i.e. OVER_QUERY_LIMIT).

What version of the product are you using? On what operating system?

I am using the Python Client for Google Maps Services 
(google-maps-services-python),
Python IDLE version 2.7.10,
Mac OS X 10.10.3,
Google Developer free API key

Please provide any additional information below.

I wrote a program that creates a list of locations using Google's Places API 
and then makes a Distance Matrix using that list.  It works the first 25 or so 
times that it runs (with about a 4x20 matrix), but then it stops working.
Instead, I get the following error:

Traceback (most recent call last):
  File "/Users/akubota/Documents/BusRouting.py", line 117, in <module>
    matrixW = client.distance_matrix(origins1, places, mode = 'walking', units = 'imperial')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/distance_matrix.py", line 118, in distance_matrix
    return client._get("/maps/api/distancematrix/json", params)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/client.py", line 185, in _get
    base_url, accepts_clientid, extract_body)
.
.
.
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/client.py", line 185, in _get
    base_url, accepts_clientid, extract_body)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/client.py", line 150, in _get
    raise googlemaps.exceptions.Timeout()
Timeout

Where there are 12 copies of the following line:
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/client.py", line 185, in _get
    base_url, accepts_clientid, extract_body)

I was able to create a distance matrix using a different program but the same 
API key, but I am almost always unable to make any size matrix in this program 
for the rest of the day.  Something seems to reset after 24 hours though, as 
the program works again as it should the next day.

Any fixes or suggestions would be greatly appreciated, thanks!

Original issue reported on code.google.com by akub...@g.hmc.edu on 2 Jun 2015 at 6:13