Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
Loading...
Searching...
No Matches
harvest_areas.h
Go to the documentation of this file.
1#ifndef PROGRAM_HARVEST_AREAS_H
2#define PROGRAM_HARVEST_AREAS_H
3
4#include <curl/curl.h>
5#include <cjson/cJSON.h>
6#include <time.h>
7#include <libpq-fe.h>
8#include <log.h>
9
11#include "transform.h"
12#include "http.h"
13#include "utils.h"
15#include "BOM/stations.h"
16
18#define FA_DEFAULT_DIRECTORY "datasets/nsw_food_authority"
20#define FA_DEFAULT_FILENAME "datasets/nsw_food_authority/statuses.csv"
21
23#define FA_MAX_NUMBER_HARVEST_AREAS 120
24
26typedef struct{
27 uint16_t count;
31
33CURLcode FA_GetHarvestAreas(FA_HarvestAreas_TypeDef* harvest_areas);
34
37
40 PGconn* psql_conn);
41
43void FA_CreateLocationsLookupDB(PGconn* psql_conn);
44
47 PGconn* psql_conn);
48
49#endif //PROGRAM_HARVEST_AREAS_H
int8_t FA_HarvestAreasToCSV(FA_HarvestAreas_TypeDef *harvest_areas)
Push harvest areas list into a .csv file.
Definition: harvest_areas.c:135
CURLcode FA_GetHarvestAreas(FA_HarvestAreas_TypeDef *harvest_areas)
Get a list of oyster harvest areas in NSW Australia.
Definition: harvest_areas.c:15
void FA_HarvestAreasToDB(FA_HarvestAreas_TypeDef *harvest_areas, PGconn *psql_conn)
Push harvest area statuses to DB.
Definition: harvest_areas.c:172
void FA_UniqueLocationsFromDB(T_LocationsLookup_TypeDef *locations, PGconn *psql_conn)
Get Unique harvest area locations from DB.
Definition: harvest_areas.c:371
void FA_CreateLocationsLookupDB(PGconn *psql_conn)
Create unique harvest area locations lookup table in DB.
Definition: harvest_areas.c:234
#define FA_MAX_NUMBER_HARVEST_AREAS
Maxiumum number of oyster harvest areas in response.
Definition: harvest_areas.h:23
Harvest area status information.
Definition: harvest_area.h:23
Holds a list of oyster harvest areas (and their status) in NSW.
Definition: harvest_areas.h:26
uint16_t count
Definition: harvest_areas.h:27
Locations lookup table structure.
Definition: transform.h:49