Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
Loading...
Searching...
No Matches
stations.h
Go to the documentation of this file.
1#ifndef PROGRAM_STATIONS_H
2#define PROGRAM_STATIONS_H
3
4#include <math.h>
5#include <ctype.h>
6
7#include "ftp.h"
8#include "utils.h"
9
11#define BOM_STATION_MAX_RESPONSES 500
13#define BOM_STATION_ID_SIZE 7
15#define BOM_STATION_STATE_SIZE 4
17#define BOM_STATION_NAME_SIZE 150
19#define BOM_STATION_FILENAME_SIZE 150
20
22#define BOM_FTP_STATIONS_URL "ftp://ftp.bom.gov.au/anon/gen/clim_data/IDCKWCDEA0/tables/stations_db.txt"
23
25typedef struct {
30 double latitude;
31 double longitude;
33
35typedef struct {
36 int16_t count;
39
42
44int8_t BOM_LoadStationsFromTxt(const char* filename,
46
48int16_t BOM_ClosestStationIndex(double latitude,
49 double longitude,
51
52#endif //PROGRAM_STATIONS_H
int8_t BOM_LoadStationsFromTxt(const char *filename, BOM_WeatherStations_TypeDef *stations)
Load BOM station list from cached .txt file (obtained from BOM FTP server)
Definition: stations.c:81
#define BOM_STATION_NAME_SIZE
BOM site name size (length)
Definition: stations.h:17
#define BOM_STATION_STATE_SIZE
BOM state identifier size (length)
Definition: stations.h:15
#define BOM_STATION_MAX_RESPONSES
Max number of BOM sites to hold.
Definition: stations.h:11
#define BOM_STATION_FILENAME_SIZE
BOM filename max size.
Definition: stations.h:19
CURLcode BOM_GetWeatherStations(BOM_WeatherStations_TypeDef *stations)
Get a list of NSW BOM weather stations.
Definition: stations.c:17
#define BOM_STATION_ID_SIZE
BOM site id size (length)
Definition: stations.h:13
int16_t BOM_ClosestStationIndex(double latitude, double longitude, BOM_WeatherStations_TypeDef *stations)
Index of the closest BOM station to a define latitude and longitude.
Definition: stations.c:204
BOM weather station (id, state, name, latitude, longitude)
Definition: stations.h:25
double longitude
Longitude of station.
Definition: stations.h:31
double latitude
Latitude of station.
Definition: stations.h:30
BOM weather stations list and count.
Definition: stations.h:35
int16_t count
Definition: stations.h:36