Open zagorski32611 opened 4 years ago
NWS API ENDPOINTS First, I explored the NWS's enpoints to find which ones I will need to communicate with and for which ones I will need to capture data. I found two, specifically from the NWS:
{{NWS}}/points/41.4437,-81.7745
https://api.weather.gov/gridpoints/CLE/80,61/forecast
Forecast Response Variables:
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
{
"@version": "1.1",
"wx": "https://api.weather.gov/ontology#",
"geo": "http://www.opengis.net/ont/geosparql#",
"unit": "http://codes.wmo.int/common/unit/",
"@vocab": "https://api.weather.gov/ontology#"
}
],
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-81.784286300000005,
41.446528999999998
],
[
-81.787124200000008,
41.424769699999999
],
[
-81.758109500000003,
41.422640199999996
],
[
-81.755265399999999,
41.444399299999994
],
[
-81.784286300000005,
41.446528999999998
]
]
]
},
"properties": {
"updated": "2020-09-11T13:31:44+00:00",
"units": "us",
"forecastGenerator": "BaselineForecastGenerator",
"generatedAt": "2020-09-11T15:37:37+00:00",
"updateTime": "2020-09-11T13:31:44+00:00",
"validTimes": "2020-09-11T07:00:00+00:00/P7DT18H",
"elevation": {
"value": 228.90479999999999,
"unitCode": "unit:m"
},
"periods": [
{
"number": 1,
"name": "Today",
"startTime": "2020-09-11T11:00:00-04:00",
"endTime": "2020-09-11T18:00:00-04:00",
"isDaytime": true,
"temperature": 69,
"temperatureUnit": "F",
"temperatureTrend": null,
"windSpeed": "8 to 13 mph",
"windDirection": "NE",
"icon": "https://api.weather.gov/icons/land/day/bkn?size=medium",
"shortForecast": "Mostly Cloudy",
"detailedForecast": "Mostly cloudy, with a high near 69. Northeast wind 8 to 13 mph."
},```
I will also need to use the Google Geocaching endpoint point to get the coordinates. This is until I can find how to do in the NWS. THey use something called "weather stations" which are 2.5 km by 2.5km grids. You call them with the coordinates and they give you the weather station and a link to the weatherStation/forecast endpoint. Later, you can just use that enpoint specifically.
This will need one main model, ForecastController. The geocaching data should be in the same model just a different class. (I do not know if that's a very good idea)
Workflow as it stands now:
All in, this doesn't seem like a very efficient workflow and I want to look in the NWS more.
I found that the Cesus Bureau provides a geocoding api. It's 100% free and it seems pretty easy to use.
Census Bureau documentation URL: https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.html
I have a request in Postman that works!
Names and data for each model.
This will focus on the NWS API Endpoints for location, current weather, weather forecasts and alerts.
This will also include any migrations to create the database.