Adresse -> Koordinaten

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Adresse -> Koordinaten

    Erstmal Servus!

    Für ein Webprojekt ähnlich wie Kwick (Community) bräuchten wir in PHP etwas, was uns eine gegebene Adresse in Koordinaten umwandelt sodass wir den Abstand von 2 Adressen ermitteln können. Bisher haben wir die Community nur in unsererm Landkreis gemacht und ich hab fast 100 Städte mit Namen und Koordinaten in die DB eingegeben.. und dann halt den Abstand berechnet.

    Is eigentlich vieeeeeel zu vieeeeel aufwand, daher hab ich im Internet rumgesucht und herausgefunden dass wir genau das active-value.de/geocoder/ brauchen würden^^

    Hat jemand eine Idee wie man das realisieren könnte? Google Maps?

    PS: Ich kann PHP, aber in Google Maps bin ich totaler einsteiger^^ hab da noch nie was damit gmacht...
  • siehe Google Maps API Dokumentation: code.google.com/apis/maps/docu…n/services.html#Geocoding
    Geocoding via HTTP
    You may also access the Maps API geocoder directly using server-side scripting. This method is not recommended over using the client-side geocoder; however, it is useful for debugging purposes or for cases where a JavaScript GClientGeocoder object is not available.
    To access the Maps API Geocoder, send a request to maps.google.com/maps/geo? with the following parameters in the URI:
    • q (required) -- The address that you want to geocode.
    • key (required) -- Your API key.
    • output (required) -- The format in which the output should be generated. The options are xml, kml, csv, or (default) json.
    • ll (optional)-- The {latitude,longitude} of the viewport center expressed as a comma-separated string (e.g. "ll=40.479581%2C-117.773438" ). This parameter only has meaning if the spn parameter is also passed to the geocoder.
    • spn (optional)-- The "span" of the viewport expressed as a comma-separated string of {latitude,longitude} (e.g. "spn11.1873%2C22.5" ). This parameter only has meaning if the ll parameter is also passed to the geocoder.<
    • gl (optional) -- The country code, specified as a ccTLD ("top-level domain") two-character value.
    Einfach API Schlüssel registrieren und die folgende URL aufrufen:
    maps.google.com/maps/geo?q=160…CA&output=csv&key=abcdefg

    bzw mit PHP abholen file_get_contents('http://maps.google....');