[R] time zones from longitude, latitude, and date

MacQueen, Don macqueen1 at llnl.gov
Mon Sep 23 23:43:32 CEST 2013


The very first response, from Jeff Newmiller, included a link
   http://efele.net/maps/tz/world/
which says it has offers a shapefile of timezones of the world.

An outline of a solution, then it to

  download the shapefile
  load it into R
  input your lat/long data into R
  use the over() function in the sp package

Of course there are many details amongst those steps; I would suggest
r-sig-geo would be the place for help with those details.

It remains to be seen whether the way in which the timezones are
identified in that shapefile is compatible with how timezones are
identified in R POSIXt classes (R uses the OS for this). Daylight savings
time information is, I believe, provided by the OS for at least some time
zones, but I don't know if its provided for all of them.

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 9/23/13 7:05 AM, "carlisle thacker" <carlisle.thacker at gmail.com> 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?
>
>Regards,
>
>Carlisle
>
>
>On Sat, Sep 21, 2013 at 3:17 AM, Gabor Grothendieck
><ggrothendieck at gmail.com
>> wrote:
>
>> On Fri, Sep 20, 2013 at 4:31 PM, carlisle thacker
>> <carlisle.thacker at 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.p
>>ng
>> >
>> > 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.
>>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at 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.



More information about the R-help mailing list