get_measurements_from_ssdb | R Documentation |
Get measurements ("measurements" table) from a SumavaDB-like spatiotemporal database
get_measurements_from_ssdb( conn, table_name = "measurements", all = FALSE, variables_code0 = NULL, locations_code0 = NULL, returns.data.frame = FALSE, start_time = NA, end_time = NA, ... )
conn |
database (preferably PostgresSQL) connection. See output of |
table_name |
name of the table . Default is |
all |
logical. if it is |
variables_code0 |
code of the types ( |
locations_code0 |
code of the locations ( |
returns.data.frame |
logical. if it is |
start_time, end_time |
start and end time instants of the time interval in which measurements are to be extrated. |
... |
further arguments for |
## Not run: library(RPostgreSQL) dbname <- "hydroclimatedb_testing00" conn = dbConnect(PostgreSQL(), dbname = dbname) ### Add weather data from stations from MeteoTrentino network, Trentino, Italy val_smet <- meteotrentino_smet_dataset(smet_files=c("T0175","T0179")) add_locations_into_ssdb(conn,val_smet$locations,new=TRUE) add_measurement_types_into_ssdb(conn,val_smet$measurement_type) add_measurements_into_ssdb(conn,val_smet$measurements) dbDisconnect(conn) conn = dbConnect(PostgreSQL(), dbname = dbname) out <- get_measurements_from_ssdb(conn) out <- get_measurements_from_ssdb(conn,locations_code0="IT-TN_T0179") out <- get_measurements_from_ssdb(conn,locations_code0="IT-TN_T0179", variables_code0=c("SMET_TA","SMET_PINT")) out <- get_measurements_from_ssdb(conn, variables_code0=c("SMET_TA","SMET_PINT")) time_interval <- as.Date(c("2021-03-01","2021-03-31")) out <- get_measurements_from_ssdb(conn, variables_code0=c("SMET_TA","SMET_PINT"), start_time=time_interval[1],end_time=time_interval[2]) dbDisconnect(conn) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.