Thanks.  This seems to return the correct offset.  For example, it knows
about the time zone not following the meridian in this part of the Pacific:

> GNtimezone(14,-172)
  rawOffset dstOffset gmtOffset  lng lat
1       -11         0       -11 -172  14
Warning message:
In readLines(u) :
  incomplete final line found on '
http://ws.geonames.org/timezoneJSON?lat=14&lng=-172'
> GNtimezone(24,-172)
  rawOffset dstOffset gmtOffset  lng lat
1       -10         0       -10 -172  24
Warning message:
In readLines(u) :
  incomplete final line found on '
http://ws.geonames.org/timezoneJSON?lat=24&lng=-172'
> GNtimezone(34,-172)
  rawOffset dstOffset gmtOffset  lng lat
1       -11         0       -11 -172  34
Warning message:
In readLines(u) :
  incomplete final line found on '
http://ws.geonames.org/timezoneJSON?lat=34&lng=-172'

Too bad it doesn't accept vectors of coordinates.

> GNtimezone(c(14,24,34),c(-172,-172,-172))
  rawOffset dstOffset gmtOffset  lng lat
1       -11         0       -11 -172  14
Warning message:
In readLines(u) :
  incomplete final line found on '
http://ws.geonames.org/timezoneJSON?lat=14&lng=-172'

How to get daylight time?

Regards,

Carlisle


On Mon, Sep 23, 2013 at 3:26 PM, David Winsemius <dwinsem...@comcast.net>wrote:

>
> On Sep 23, 2013, at 9:05 AM, carlisle thacker wrote:
>
> Gabor,
>
> Thanks for your tip about zone.tab.  It provides country codes and lat/lon
> of the zone's principal location, which while useful is not exactly what I
> need.  I would like to know the coordinates of time zone boundaries.
> Better still would be a function, which returns the name of the time zone
> in which given lat/lon is situated.
>
> For example, in which time zone is 22N,166W?  And at what times of year
> might daylight savings time be in effect?
>
>
> From the posting from Olivier Eterradossi:
>
> library(geonames)
> GNtimezone(22,166)
> #----------------
> Loading required package: rjson
>   rawOffset dstOffset gmtOffset lng lat
> 1        11         0        11 166  22
> Warning message:
> In readLines(u) :
>   incomplete final line found on '
> http://ws.geonames.org/timezoneJSON?lat=22&lng=166'
>
> So it looks like the middle of the Pacific (GMT-11) near Hawaii. Seems a
> reasonable result.
>
> --
> David
>
>
>
> Regards,
>
> Carlisle
>
>
> On Sat, Sep 21, 2013 at 3:17 AM, Gabor Grothendieck <
> ggrothendi...@gmail.com> wrote:
>
>> On Fri, Sep 20, 2013 at 4:31 PM, carlisle thacker
>> <carlisle.thac...@gmail.com> wrote:
>> > I was looking for something like shown on the map:
>> >
>> http://upload.wikimedia.org/wikipedia/commons/8/88/World_Time_Zones_Map.png
>> >
>> > Information about local daylight savings times would also help.
>> >
>> > The data are from ships, supposedly in local time, but no time-zone
>> info is
>> > given.  A function that would return time zone and whether or not
>> daylight
>> > savings time applies at given date would would help.  I'm trying to
>> track
>> > down more information about the data and whether they can be referenced
>> to
>> > UTC.
>>
>> The zone.tab file has this information.  See the Examples section at
>> the end of ?Sys.timezone for info on its whereabouts.
>>
>
>
> David Winsemius, MD
> Alameda, CA, USA
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to