Search code examples
google-maps-api-3google-maps-api-2

Google Geocoding API, HTTP, CSV-data in API v3


I'm developing embedded software for a gps-tracker. Until this time I used Google Maps v2 for reverse geocoding (to convert GPS-coordinates to address string). I used http-request and a short-response-form (csv) (http://maps.googleapis.com/maps/geo?q=&output=csv&...). Now, when the support of API v2 is almost over, I try to migrate to v3, but I can't find a csv response-format in http-request settings. The response-size is a critical parameter for the device. How do I solve this problem? Thank you.


Solution

  • According to the documentation you're stuck with JSON or XML.

    A Geocoding API request must be of the following form:
    
    http://maps.googleapis.com/maps/api/geocode/output?parameters
    where output may be either of the following values:
    
    • json (recommended) indicates output in JavaScript Object Notation (JSON)
    • xml indicates output as XML

    Example: the query should look like this:

    http://maps.googleapis.com/maps/api/geocode/json?sensor=true&address=Your+address+here

    or

    http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=Your+address+here

    where required parameter sensor indicates you are calling from a location sensor enabled device or not.