[tz] Geolocation extension to tzdist

Ken Murchison murch at andrew.cmu.edu
Thu Sep 29 22:38:39 UTC 2016


All,

(sending to tz at iana.org since tzdist at ietf.org appears to be dead)

I was bored today (actually avoiding "real" work) and was playing around 
with the ESRI shapefile for timezones <http://efele.net/maps/tz/world/>

I hacked up a quick extension to my tzdist implementation using the 
tz_world shapefile and basic ray tracing to be able to query a time zone 
by geo coordinates, similar to what Google offers in their Time Zone 
API.  Note that I have yet to spend any time writing code to account for 
"holes" in time zones like the Navajo Reservation in Arizona.

I modeled the extension after the "find" action in RFC 7808 but with 
lat/long query params rather than a glob pattern.  A request and 
response for the timezone in which my home is located looks something 
like this:


GET /tzdist/zones?latitude=43.070833&longitude=-78.831667 HTTP/1.1

{
   "synctoken": "890939292-1466089793",
   "timezones": [
     {
       "tzid": "America/New_York",
       "etag": "6602582-1466089793",
       "last-modified": "2016-06-16T15:09:53Z",
       "publisher": "IANA Time Zone Database",
       "version": "2016e",
       "aliases": [
         "US/Eastern"
       ]
     }
   ]
}



The definition of the extension looks like this in the capabilities 
response:

     {
       "name": "geolocate",
       "uri-template": "/zones{?latitude,longitude}",
       "parameters": [
         {
           "name": "latitude",
           "required": true
         },
         {
           "name": "longitude",
           "required": true
         }
       ]
     }


Currently my code only accepts coordinates in decimal degrees, but I 
think it should probably support ISO 6709 formats.

Is this something that folks would like to see documented as a formal 
extension to tzdist, either as specified above or with some 
modification?  If so, I'd be willing to write it up as a draft and then 
move it through IETF in whatever fashion the ADs recommend.

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20160929/987ce75e/attachment.htm>


More information about the tz mailing list