Recieving a 403 forbidden error when using latitude and longitude: geocoding

自古美人都是妖i 提交于 2019-11-26 11:36:26

问题


Our site has the option to insert your postcode in, which in turn works with geocoding to work out the latitude and longitude.

This code has not been changed for years but today if the user trys to insert a postcode or update it from yesterday or before the error \'The remote server returned an error: (403) Forbidden.\' pops up.

The requests have not shot past 2,500 so I cant see Google blocking us because of that..

Any ideas??


回答1:


The version 2 Geocoding API was turned off September 9th as announced...

From Upgrading Your Geocoding API Application To v3

Version 2 ("v2") of the Geocoding API was officially deprecated on 8 March 2010 and has now been turned down. As of 9 September 2013 the v2 API will no longer work.




回答2:


Copy of my answer to: this duplicate question

Api v2 was closed down on sept 13, 2013. Your question was asked on 14th - so that migh be a clue. What I managed to do is simply modify URLs in googlemaps.py

I changed _DIRECTIONS_QUERY_URL (line 165 of googlemaps.py) to:

_DIRECTIONS_QUERY_URL = 'http://maps.googleapis.com/maps/api/directions/output?'

And it worked fine. Also I tried modiying line 164: _GEOCODE_QUERY_URL = 'http://maps.googleapis.com/maps/api/geocode/output?' as suggested here but there's some error, and a) I don't need it anyway b) it's already covered by pygeocoder which is a bit more advanced that googlemaps.py



来源:https://stackoverflow.com/questions/18743128/recieving-a-403-forbidden-error-when-using-latitude-and-longitude-geocoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!