<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>All,</p>
    <p>I just posted a first draft of my geolocate extension: <a
        href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-00">https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-00</a></p>
    <p>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.<br>
    </p>
    <p>You can give my test implementation a test drive here: <br>
    </p>
    <p><a
href="https://cyrus-test.andrew.cmu.edu/tzdist/zones?location=geo:36.01596,-114.73748;u=25">https://cyrus-test.andrew.cmu.edu/tzdist/zones?location=geo:36.01596,-114.73748;u=25</a></p>
    <p>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.<br>
    </p>
    <br>
    <br>
    <div class="moz-cite-prefix">On 09/29/2016 06:38 PM, Ken Murchison
      wrote:<br>
    </div>
    <blockquote
      cite="mid:37201e84-bb51-e4d4-8671-f2570e6b3feb@andrew.cmu.edu"
      type="cite">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <p>All,</p>
      <p>(sending to <a moz-do-not-send="true"
          class="moz-txt-link-abbreviated" href="mailto:tz@iana.org">tz@iana.org</a>
        since <a moz-do-not-send="true"
          class="moz-txt-link-abbreviated" href="mailto:tzdist@ietf.org">tzdist@ietf.org</a>
        appears to be dead)<br>
      </p>
      <p>I was bored today (actually avoiding "real" work) and was
        playing around with the <a moz-do-not-send="true"
          href="http://efele.net/maps/tz/world/">ESRI shapefile for
          timezones</a><br>
      </p>
      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.<br>
      <br>
      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:<br>
      <br>
      <br>
      GET /tzdist/zones?latitude=43.070833&amp;longitude=-78.831667
      HTTP/1.1<br>
      <br>
      <pre>{
  "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"
      ]
    }
  ]
}</pre>
      <br>
      <br>
      The definition of the extension looks like this in the
      capabilities response:<br>
      <br>
      <pre>    {
      "name": "geolocate",
      "uri-template": "/zones{?latitude,longitude}",
      "parameters": [
        {
          "name": "latitude",
          "required": true
        },
        {
          "name": "longitude",
          "required": true
        }
      ]
    }
</pre>
      <br>
      Currently my code only accepts coordinates in decimal degrees, but
      I think it should probably support ISO 6709 formats.<br>
      <br>
      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.<br>
      <pre class="moz-signature" cols="72">-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University
</pre>
  </body>
</html>