Uses spatial comparison to determine which timezone polygons the locations fall into and returns the Olson timezone strings for those polygons.
Specification of countryCodes limits spatial searching to the specified countries and greatly improves performance.
countryCodes
If allData=TRUE, additional data is returned.
allData=TRUE
getTimezone(lon, lat, dataset = "SimpleTimezones", countryCodes = NULL, allData = FALSE, useBuffering = FALSE)
vector of longitudes in decimal degrees
vector of latitudes in decimal degrees
name of spatial dataset to use
vector of countryCodes
logical specifying whether a full dataframe should be returned
logical flag specyfing the use of location buffering to find the nearest polygon if not target polygon is found
Vector of Olson timezones.
http://efele.net/maps/tz/
SimpleTimezones
getSpatialData
# NOT RUN { lon <- seq(-120,-60,5) lat <- seq(20,80,5) getTimezone(lon,lat) # }
Run the code above in your browser using DataLab