[tz] Geolocation extension to tzdist

Ken Murchison murch at andrew.cmu.edu
Fri Oct 14 19:12:17 UTC 2016


All,

I just posted a first draft of my geolocate extension: 
https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-00

I switched to using the existing geo URI format for specifying location 
at the suggestion of one of the authors of TZDIST.  The draft includes 
an example of doing a query using an uncertainty value.

You can give my test implementation a test drive here:

https://cyrus-test.andrew.cmu.edu/tzdist/zones?location=geo:36.01596,-114.73748;u=25

That server is using Evan Siroky's new shapefiles.  Note that the 
implementation is not perfect yet as I'm not checking for holes in 
timezones, nor doing any calculations when a location is in 
international waters.  Also note that the calculations for finding time 
zones within an uncertainty range are based on the earth being a sphere 
(using mean radius), not a spheroid.  I may change this later, but I'm 
not sure that it matters over short distances. Finally, there is no data 
for Antarctica.



On 09/29/2016 06:38 PM, Ken Murchison wrote:
>
> 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

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20161014/355c2a22/attachment.html>


More information about the tz mailing list