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

前端 未结 2 1406
灰色年华
灰色年华 2020-11-30 14:38

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 ye

2条回答
  •  一个人的身影
    2020-11-30 14:58

    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

提交回复
热议问题