//API abfragen
$xml = simplexml_load_file($request_url) or die("url not loading");
//Statuscode und Auswertung
$status = $xml->Response->Status->code;
if (strcmp($status, "200") == 0) {
// Erfolgreich codiert!
$geocode_pending = false;
$coordinates = $xml->Response->Placemark->Point->coordinates;
$coordinatesSplit = split(",", $coordinates);
// Format: Longitude, Latitude, Altitude
$lat = $coordinatesSplit[1];
$lng = $coordinatesSplit[0];
//Daten in die Tabelle schreiben
mysql_query("Update ADRESS Set GEO_LAT = '$lat', GEO_LNG= '$lng' Where ID ='$d[ID]'");
} else if (strcmp($status, "620") == 0) {
// Abfrage erfolgte zu schnell hintereinander
$delay += 100000;
} else {
// Fehler beim Codieren
$geocode_pending = false;
echo "Address " . $address . " failed to geocoded. ";
echo "Received status " . $status . "\n";
}