Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include weather info in location records #40

Closed
aaronpk opened this issue Jan 1, 2018 · 2 comments
Closed

Include weather info in location records #40

aaronpk opened this issue Jan 1, 2018 · 2 comments

Comments

@aaronpk
Copy link
Owner

aaronpk commented Jan 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.

@aaronpk
Copy link
Owner Author

aaronpk commented Jan 2, 2018

More discussion from IRC: https://chat.indieweb.org/dev/2018-01-02#t1514910516855700

@aaronpk
Copy link
Owner Author

aaronpk commented Jan 28, 2018

After some thought, this would be better done on the server. Moving the discussion to aaronpk/Compass#20

@aaronpk aaronpk closed this as completed Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant