Bill Shupp Software engineer, photographer, musician, space geek

12Aug/121

Local Timezone Lookups by Coordinates with PostGIS

For my project "Where the ISS at?", I rely on a few external services for GIS related data.  For example, when a browser gets permission to determine the end user's location coordinates, a call is then made to Google to look up the local name of that location, such as San Francisco, CA, based on those coordinates.  This is so that I can determine the upcoming ISS passes for the user's location.  But to show that data in their local time, I need to know what timezone they are in.  Unfortunately, this isn't included with the data I get back from Google.  So I need to make a second call to Geonames for this data.  Since this is a small, non-commercial project I do for fun, it gets expensive quickly to pay for data.   And understandably the Geonames API has a lower SLA for their free service, resulting in occasional outages for timezone lookups.  What would be really handy is a way to look this up locally.