[R-sig-Geo] time zones overwater?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Dec 8 11:53:59 CET 2010


On Tue, Dec 7, 2010 at 8:59 PM, Francois Rousseu
<francoisrousseu at hotmail.com> wrote:
>
> Thanks. Although, the timezoneId is not given (or doesn't exists?) when the coordinates are in the water, I was able to determine the closest timezoneId by using the geonames url with the radius option. I would suggest adding the radius argument in the GNtimezone function.

 Ooh, I'd not seen that before. So you get the difference between
(note my method of constructing geonames URLS):

 > as.data.frame(geonames:::getJson("timezoneJSON",list(lat=0,lng=-40)))
 rawOffset dstOffset gmtOffset lng lat
   1        -3         0        -3 -40   0

 > as.data.frame(geonames:::getJson("timezoneJSON",list(lat=0,lng=-40,radius=200)))
              time countryName           sunset rawOffset dstOffset countryCode
1 2010-12-08 07:49      Brazil 2010-12-08 17:35        -3        -3          BR
  gmtOffset lng          sunrise        timezoneId lat
1        -3 -40 2010-12-08 05:28 America/Fortaleza   0

I think if I just have a radius=0 default that should suffice. Thanks!

Barry



More information about the R-sig-Geo mailing list