Please log into your user account or create a new one
Solution for: #47: finding a time zone give lat/lon coordinates
use the flickr API
-
kueda on May 22, 2009, 09:06 PM UTC
The Flickr API is amazing. using the places.findByLatLon method, you can not only reverse geocode your coordinates, but each place response comes with a a TZ time zone identifier! TZ is the database used by the Rails time zone stuff, so it's perfect for use in rails. Here's a trivial example using the excellent flickraw gem:
Also, it's Flickr, so pretty robust and open.
1 2 o = Observation.first 3 places = flickr.places.findByLatLon(:lat => o.latitude, :lon => o.longitude) 4 o.time_zone = ActiveSupport::TimeZone::MAPPING.invert[places.first.timezone]
Also, it's Flickr, so pretty robust and open.
