[R-sig-Geo] time zones overwater?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Dec 7 18:58:32 CET 2010


On Tue, Dec 7, 2010 at 4:57 PM, Francois Rousseu
<francoisrousseu at hotmail.com> wrote:
>
> Hello
>
> I need to determine time zone location (eg. America/Montreal) for several latlon coordinates mostly in North America. I found some freely available .shp files giving polygons for the various time zones, but the polygons exclude most large bodies of water. For example, coordinates falling in the Great Lakes or between islands in the canadian arctic are not associated with any time zone. Does anybody know of some freely available .shp files or any other way to obtain an ID for these zones to be able to get the correct time?

 www.geonames.org can help, my geonames package can query it from R,
and you can get timezone offsets:

> library(geonames)
Loading required package: rjson

> GNtimezone(lng=37,lat=0)
             time countryName           sunset rawOffset dstOffset countryCode
1 2010-12-07 20:57       Kenya 2010-12-07 18:27         3         3          KE
 gmtOffset lng          sunrise     timezoneId lat
1         3  37 2010-12-07 06:19 Africa/Nairobi   0

Barry



More information about the R-sig-Geo mailing list