78°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • https://github.com/aaronpk/Overland-iOS

    Include weather info in location records

    January 1, 2018

    Right now, the process of getting weather info into my posts involves an extra step I would like to avoid. I would also like if my GPS logs contained weather info themselves, to avoid having to link up an external dataset to correlate that info.

    It might make sense to add the weather info at the time the location records are created. If you add a DarkSky API key to Overland, then it could periodically fetch the weather info and add the data to the location records.

    Here's an example weather record from my current weather DB:

    {
      "data": {
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            -122.62125708873,
            45.535584429375
          ]
        },
        "properties": {
          "timestamp": "2018-01-01T21:00:05Z",
          "location_date_utc": "2018-01-01 20:56:37 +0000",
          "location_timezone": "America/Los_Angeles",
          "location_accuracy": null,
          "temp_f": 43.5,
          "humidity": "64",
          "pressure_mb": "1029",
          "feelslike_f": "41",
          "description": "Clear",
          "icon": "clear",
          "wind_mph": 5,
          "wind_gust_mph": "10.0",
          "precip_1hr_metric": "0"
        }
      }
    }
    

    Some notes about how this could work:

    • Keep a cached copy of the latest weather info on the phone
    • If more than 5 minutes has elapsed since the weather was last updated, fetch new weather info
    • If the distance from the last weather update changes by more than 5km, fetch new weather info
    • For every location point recorded, add the weather info from the cache
    • Include the timestamp of the weather info so consumers will know how old the weather info is

    Since the properties object in GeoJSON can include full JSON (not limited to key/value pairs), we can store the weather info in a new nested object weather containing these properties.

    Portland, Oregon, USA • 43°F
    Mon, Jan 1, 2018 1:20pm -08:00
Posted in /replies using quill.p3k.io

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv