From: Michael Fellinger on
On Sat, Jun 5, 2010 at 4:54 AM, 12 34 <rubyforum(a)web.knobby.ws> wrote:
> One minor comment. I'm more used to seeing lon than lng.

The API uses lng everywhere, so of course I use it as well.

> Is there a way to get DST given lat lon and the date? isdst exists in
> Ruby, but AFAIK is only for local current time.

sigma github/manveru/geonames % irb
require './lib/geonames'
# true
GeoNames.timezone(lat: 47.01, lng: 10.2)
# {"time"=>"2010-06-05 08:27", "countryName"=>"Austria",
"rawOffset"=>1, "dstOffset"=>2, "countryCode"=>"AT", "gmtOffset"=>1,
"lng"=>10.2, "timezoneId"=>"Europe/Vienna", "lat"=>47.01}

> Is there a way to get the state or province?

See the API docs: http://www.geonames.org/export/ws-overview.html

GeoNames.country_subdivision(lat: 47.03, lng: 10.2, maxRows: 10, radius: 40)
# {"distance"=>0, "adminCode1"=>"07", "countryName"=>"Austria",
"countryCode"=>"AT", "codes"=>[{"code"=>"07", "type"=>"FIPS10-4"},
{"code"=>"7", "type"=>"ISO3166-2"}], "adminName1"=>"Tyrol"}


--
Michael Fellinger
CTO, The Rubyists, LLC