Skip to content

Instantly share code, notes, and snippets.

@deangrant
Created July 25, 2022 15:55
Show Gist options
  • Save deangrant/1734cd0dd33a5800552aab2010cf2aa3 to your computer and use it in GitHub Desktop.
Save deangrant/1734cd0dd33a5800552aab2010cf2aa3 to your computer and use it in GitHub Desktop.
Returns light version of TimeZoneFinder class and load all binary files into memory. Shows example of applying time zone to coordinates returned in a GeoJSON FeatureCollection.
from timezonefinder import TimezoneFinderL
def timezone_finder_l():
return TimeZoneFinderL(in_memory=True)
# Initialize class and load binary files into memory.
get_timezone = timezone_finder_l()
# Return timezone for coordinates based on precomputed shortcuts.
get_timezone.timezone_at(
lng=row['geometry.coordinates'][0],
lat=row['geometry.coordinates'][1]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment