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

Replace Weather Underground #116

Closed
peterwcode opened this issue Mar 1, 2019 · 5 comments
Closed

Replace Weather Underground #116

peterwcode opened this issue Mar 1, 2019 · 5 comments

Comments

@peterwcode
Copy link

The free API is dead and needs to be replaced: https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api

@peterwcode
Copy link
Author

Has anyone looked at the National Weather Service APIs? https://www.weather.gov/documentation/services-web-api#/

To get historical data it looks like you start with a lat long point:
https://api.weather.gov/points/38.5,-77.5

Look for properties.observationStations and call that URL to get individual station identifiers, e.g.
https://api.weather.gov/gridpoints/LWX/82,50/stations
shows Stafford Regional Airport as "KRMN".

Then comes the huge call, getting all historical observations. (While it is possible to request a single observation with a URL like https://api.weather.gov/stations/KRMN/observations/2019-03-01T06:35:00+00:00, you have to know the exact time; pick an arbitrary time and you get a 404.)

https://api.weather.gov/stations/KRMN/observations

properties.presentWeather tells you if it's raining or snowing and of course there are properties for things like temperature and wind speed.

@hozn
Copy link
Contributor

hozn commented Mar 1, 2019

I originally used the national weather service API; the data was just really poor quality (mostly empty values), but maybe I didn't discover the secret high quality stations to use. Also, that was a long time ago so hopefully both the API and the data is better now.

@peterwcode
Copy link
Author

Also it's unfortunate that NWS is US-only; I assume WU handled global locations.

It looks like the NWS data goes back about 1.5 years; it might be interesting to compare their data for BAFS 2018 with what was fetched from WU.

I think this was mentioned on WABF discussion about limiting API calls: for weather, bafs could round lat/long, effectively snapping all points to a grid. (bafs does still only look up the conditions at the starting point of a ride, right?) So maybe export from bafs 2018 data the rounded lat/long (which would also help preserve rider privacy) + ride start time + weather conditions, then write some code to get the corresponding NWS data? To me it looks like rounding to the nearest 0.1 degree would be pretty good for this purpose. For WU I would have argued for 0.01 degree because there are so many Personal Weather Stations that that might help, but since NWS has so few stations 0.1 would be better.

@obscurerichard
Copy link
Member

This is a known issue, this is a duplicate of freezingsaddles/freezing-sync#5 (the syncing happens in the freezing-sync component). Alas we haven't had time to fix it yet. The leading candidate is the Dark Sky API: https://darksky.net/dev

@obscurerichard
Copy link
Member

@peterwcode I would welcome help in fixing this, please collaborate with me on freezingsaddles/freezing-sync#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants