lat/lon to time offset database

Paw Nielsen paw at boel-it.dk
Thu Feb 3 19:24:01 UTC 2011


>> What you need is the analog of zone.tab but with the bounding polygon
for each zone rather than a point inside it.  I believe that data exists
somewhere, but I don't remember the location.

For mapping lon/lats to timezones I use the maps that can be downloaded
from this location:
http://efele.net/maps/tz/world/

Just bear in mind the maps do not cover sea lon/lat's only land.

Paw

---------------------------
DISCLAIMER:
The information contained in this electronic message and in any
attachments to this message is intended only for the person or entity to
which this electronic message is addressed. If you are not the intended
recipient, you are hereby notified that any distribution, copying,
review, retransmission, dissemination or other use of this electronic
transmission or the information contained in it is strictly prohibited.

-----Original Message-----
From: Paul Koning [mailto:paul_koning at Dell.com] 
Sent: 04 February 2011 02:54
To: tz at lecserver.nci.nih.gov; Larry Ober
Subject: Re: lat/lon to time offset database


On Feb 3, 2011, at 1:33 PM, Larry Ober wrote:

> I'm a nubie at understanding the ins and outs of timezones so please 
> forgive me for my potentially dumb questions.
> 
> I am looking at building a small embedded system (No OS) that will 
> require determining the local time from the lat/lon of a location. So 
> basically I need lat/lon to time offset from "GMT".
> 
> I don't really need the geo political information like country or
city. 
> However it seems like tz is structured continent/country/city/... 

Actually, you do.  

What you're trying to do may be too hard for a "small embedded system"
(depending on what "small" means).

The problem you're up against is that timezones are political
constructs.  To know the timezone for a spot on the globe, you have to
know what political subdivision it's in; that will tell you what the
timezone rule (law or regulation) is that applies to it.

For example, if your position is 41 N, 71 W, that puts you in a part of
the USA that uses the Americas/New_York rules (US Eastern Time with
daylight savings).  On the other hand, if you're at 35 40 N, 109 03 W,
you're in US Mountain time with DST, and move to 35 40 N, 111 30 W, now
you're still in US Mountain Time but you've lost DST.

So you need a database of zone boundaries -- which is likely to be
fairly large.  Then you figure out which polygon in that database
contains your current position.  From that, you have the zone rule that
applies to this position.

The zone.tab file might seem like a starting point, but it isn't really;
it just lists each of the zones with a single point in that zone.  What
you need is the analog of zone.tab but with the bounding polygon for
each zone rather than a point inside it.  I believe that data exists
somewhere, but I don't remember the location.

	paul






More information about the tz mailing list