OVH Community, votre nouvel espace communautaire.

Google API - geocode: OVER_QUERY_LIMIT


stanleyljansen
10/09/2014, 12h18
f you exceed the usage limits you will get an OVER_QUERY_LIMIT status code as a response.

This means that the web service will stop providing normal responses and switch to returning only status code OVER_QUERY_LIMIT until more usage is allowed again. This can happen:

Within a few seconds, if the error was received because your application sent too many requests per second.
Some time in the next 24 hours, if the error was received because your application sent too many requests per day. The time of day at which the daily quota for a service is reset varies between customers and for each API, and can change over time.

Nicolas.C
20/08/2014, 13h16
Bonjour,

Peux-tu me préciser ton NIC et le domaine concerné?

spy70
14/08/2014, 14h57
Bonjour,

J'utilise drupal et le module pour geocoder une adresse.
Avant j'étais sur infomaniak et tout fonctionnait parfaitement sur ce point.

Maintenant l'encodage d'une adresse en lat-lon ne fonctionne plus.

J'ai réussi à le faire fonctionner une seule fois. Puis impossible.

Du coup en tentant de faire un script php retournant le coordonnée d'une adresse via l'utilisation de l'API google, j'obtiens le fameux message:

"error_message" : "You have exceeded your daily request quota for this API.", "results" : [], "status" : "OVER_QUERY_LIMIT"

J'ai tenté d'utiliser les solutions trouvé sur le net pour débloquer la situation mais rien n'y fait.

Au secours

J'aimerai déjà que le code suivant fonctionne avant de tenter de debuger le module drupal:


/*
Description : The following code convert the address to co-ordinates using google map api
Author: Dnyanesh Pawar,
Copyright: Dnyanesh Pawar (http://www.techrecite.com)
Link: http://www.techrecite.com
See the GNU General Public License for more details: http://www.creativecommons.org/
*/

// Take the address in a variable
$address = "Capitol Avenue, Elsmere, Kentucky";

// Replace the empty spaces in the address with + sign
// + Sign is the concatanation/separation character used by google map service
$address = str_replace(" ", "+", $address);
echo $address;

$address_url = "http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $address_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
echo $response;
curl_close($ch);

$response_a = json_decode($response);

//Print the provided address in Human readable/ complete Postal address;
echo $formatted_address = $response_a->results[0]->formatted_address.'
';

//Print the Latitude and Longitude of the address
echo $lat = $response_a->results[0]->geometry->location->lat.'
';
echo $long = $response_a->results[0]->geometry->location->lng;

//$json=file_get_contents('http://nominatim.openstreetmap.org/search?format=json&limit=1&q=75000 paris');

//$obj = json_decode($json, true);

//$latitude = $obj[0]['lat'];
//$longitude = $obj[0]['lon'];

?>