MazamaSpatialUtils (version 0.6.4)

getTimezone: Return Olson timezones at specified locations

Description

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.

If allData=TRUE, additional data is returned.

Usage

getTimezone(lon, lat, dataset = "SimpleTimezones", countryCodes = NULL,
  allData = FALSE, useBuffering = FALSE)

Arguments

lon

vector of longitudes in decimal degrees

lat

vector of latitudes in decimal degrees

dataset

name of spatial dataset to use

countryCodes

vector of countryCodes

allData

logical specifying whether a full dataframe should be returned

useBuffering

logical flag specyfing the use of location buffering to find the nearest polygon if not target polygon is found

Value

Vector of Olson timezones.

References

http://efele.net/maps/tz/

See Also

SimpleTimezones

getSpatialData

Examples

Run this code
# NOT RUN {
lon <- seq(-120,-60,5)
lat <- seq(20,80,5)
getTimezone(lon,lat)
# }

Run the code above in your browser using DataLab