-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in speed_limits method #190
Comments
Looks like you're using a place ID that doesn't have a corresponding speed limit, eg here's a valid one: https://roads.googleapis.com/v1/speedLimits?placeId=ChIJLQcticc0GQ0RoiNZJVa5GxU&key=YOUR_KEY |
Oh wow. Just my luck that the first street I tried doesn't have speed limits in Google database! Surprising, this is a major interstate freeway. |
Should this really error out? I can deal with this with a try/except clause, but it doesn't seem right that this should error out like this. Maybe add a check in the library and return a success/failure flag? |
You're right, I fixed that in de0ddab |
Hi,
I'm getting this error when trying to use the speed_limits method:
Traceback (most recent call last):
File "testurl.py", line 38, in
speed_lim = gmaps.speed_limits("ChIJVQcunKIA3IAReSI1GXlR1Yk")
File "/Library/Python/2.7/site-packages/googlemaps/client.py", line 356, in wrapper
result = func(*args, **kwargs)
File "/Library/Python/2.7/site-packages/googlemaps/roads.py", line 95, in speed_limits
extract_body=_roads_extract)["speedLimits"]
KeyError: 'speedLimits'
I think I'm making the call correctly. Here is how I'm calling it:
speed_lim = gmaps.speed_limits("ChIJVQcunKIA3IAReSI1GXlR1Yk")
Everything else (directions) seems to be working fine.
Thanks
The text was updated successfully, but these errors were encountered: