Google Maps API Services Geocoding

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Google Maps API Services Geocoding

dtrussardi@tiscali.it
Hi All,
 
i work with Squeak and Seaside 2.8.
 
In my application i have integrate a Google StaticMap support  from squeakSource GoogleStaticMaps.
 
Now i'm interested, when the user create a new address,  to define and save the relative geographic coordinates.
 
In the Google documentation i read: 

***********************************************************************************

Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map. The Google Maps API Geocoding Service provides a direct way to access a geocoder via an HTTP request.

Note: the geocoding service may only be used in conjunction with displaying results on a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

Geocoding Requests

You may access the Google Maps API Geocoding Service directly over HTTP. To access the geocoder, send a request to http://maps.google.com/maps/geo? with the following parameters in the URL:

  • q (required) — The address that you want to geocode.
  • key (required) — Your API key.
  • sensor (required) — Indicates whether or not the geocoding request comes from a device with a location sensor. This value must be either true or false. (Note that devices with sensors generally perform their own geocoding by definition; therefore, most geocoding requests to the Maps API Geocoding service should set sensor to false.)
  • output (required) — The format in which the output should be generated. The options are xml, kml, csv, or (default) json. (For more information, see Geocoding Responses below.)
  • oe (optional but strongly encouraged) — The output encoding format of the response. It is recommended that you set this output encoding explicitly to utf8 unless you have specific requirements to handle other encoding types.
  • ll (optional) — The {latitude,longitude} of the viewport center expressed as a comma-separated string (e.g. "ll=40.479581,-117.773438" ). This parameter only has meaning if the spn parameter is also passed to the geocoder. (For more information see Viewport Biasing below.)
  • spn (optional) — The "span" of the viewport expressed as a comma-separated string of {latitude,longitude} (e.g. "spn=11.1873,22.5" ). This parameter only has meaning if the ll parameter is also passed to the geocoder. (For more information see Viewport Biasing below.)
  • gl (optional) — The country code, specified as a ccTLD ("top-level domain") two-character value. (For more information see Country Code Biasing below.)

Note: The gl and spn,ll viewport parameters will only influence, not fully restrict, results from the geocoder.

In this example, we request the geographic coordinates of Google's headquarters:

http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=json&oe=utf8&sensor=true_or_false&key=your_api_key
**********************************************
Now :
after the user crate new address i can create a new WAUrl as above with specific address.
My question is: how,  i can, send from squeak this request to the internet for receive the answer?
It's a good solution or i wrong?

Any pointers would be greatly appreciated!

Thanks!

 

Dario

 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside