Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Google Maps help

  • 12-04-2011 02:34AM
    #1
    Registered Users, Registered Users 2, Paid Member Posts: 8,000 ✭✭✭
    Something about sandwiches


    Hi,

    I have an XML file with ~50 sets of locations (lat/long).

    When I run my code I get a "GoogleMapsError" saying "Error 620: G_GEO_TOO_MANY_QUERIES".

    Google allows about 2500 requests per day apparently, so it seems even on my first run if this code, I went over the limit! Its probably more to do with the fact that I'm using a shared hosting provider, to be honest.

    Anyway, the piece of code I'm using is for getting directions to the nearest location, given the users current location (GPS on their phone). It loops until EOF, gets each set of coords, and sends a request to Google to see if there is less of a distance between that set of coords and the previous set.

    My question is, does anyone know of a way I can loop through all 50 locations, take their coords and pass all 50 of them to Google in one go, instead of looping through 50 times like I'm currently doing?

    Thanks.


    EDIT: I'm just thinking actually. I never put my API Key in anywhere. Maybe thats the issue. Does anyone know how to include it in python??


Advertisement