|
Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
|
#include <time.h>#include <stdio.h>#include <stdlib.h>#include <libpq-fe.h>#include "http.h"#include "WillyWeather/forecast.h"#include "WillyWeather/location.h"#include "utils.h"Go to the source code of this file.
Data Structures | |
| struct | WW_Rainfall_TypeDef |
| Rainfall forecast for a day. More... | |
| struct | WW_RainfallForecast_TypeDef |
| Holds daily forecast rainfall information from Willy Weather. More... | |
Macros | |
| #define | WW_RANGE_CODE_SIZE 6 |
| Willy Weather range code (e.g. 0-15 or 5-10 or <0) max size. More... | |
| #define | WW_MAX_DAILY_RAINFALL_RESULTS 9 |
| Max number of daily rainfall forecast results from Willy Weather. More... | |
| #define | WW_MAX_TS_SIZE 30 |
| Max timestamp size. More... | |
Functions | |
| CURLcode | WillyWeather_GetRainfallForecast (WW_Location_TypeDef *location, WW_RainfallForecast_TypeDef *daily_rainfall) |
| Gets the rainfall forecast (next 7 days inc today) for a location. More... | |
| void | WillyWeather_RainfallToDB (WW_Location_TypeDef *location, WW_RainfallForecast_TypeDef *forecast, PGconn *psql_conn) |
| Rainfall to PostgreSQL table method. More... | |
| #define WW_MAX_DAILY_RAINFALL_RESULTS 9 |
Max number of daily rainfall forecast results from Willy Weather.
| #define WW_MAX_TS_SIZE 30 |
Max timestamp size.
| #define WW_RANGE_CODE_SIZE 6 |
Willy Weather range code (e.g. 0-15 or 5-10 or <0) max size.
| CURLcode WillyWeather_GetRainfallForecast | ( | WW_Location_TypeDef * | location, |
| WW_RainfallForecast_TypeDef * | rainfall_forecast | ||
| ) |
Gets the rainfall forecast (next 7 days inc today) for a location.
Get forecast precipitation data from Willy Weather.
Willy Weather provides forecast rainfall probability and amount as a range e.g. 10-15 mm 90 %. These data are provided for the past 2 days, the current day and the next 6 days (9 days in total). A location needs to be provided along with a daily rainfall struct to hold the responses.
| location | Location struct (see location.h). |
| daily_rainfall | Daily rainfall forecast struct to hold responses. |
| void WillyWeather_RainfallToDB | ( | WW_Location_TypeDef * | location, |
| WW_RainfallForecast_TypeDef * | forecast, | ||
| PGconn * | psql_conn | ||
| ) |
Rainfall to PostgreSQL table method.
Write Willy Weather forecast for a particular location to PostgreSQL table.
The target table is called weather_ww.
| location | Location information for Willy Weather dataset. |
| forecast | Willy Weather weather forecast. |
| psql_conn | PostgreSQL connection handler. |