Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 689
user2082893 Avatar asked Oct 05 '22 00:10

user2082893


1 Answers

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.

like image 132
Rick Avatar answered Oct 13 '22 12:10

Rick