add_locations_into_ssdb | R Documentation |
Add locations ("locations" table) to a SumavaDB-like spatiotemporal database
add_locations_into_ssdb( conn, locations, new = FALSE, append = !new, sql_files = system.file("sql/create_or_replace_functions.sql", package = "SuSnowDB"), warn = TRUE, err = !warn, nn_locations = default_nn_locations(), ... )
conn |
database (preferably PostgreSQL) connection. See output of |
locations |
locations, spatial object (or |
new |
logical. If |
append |
logical. If |
sql_files |
file names containing database initialization SQL queries. They are used in case |
warn |
logical argument if the column names of |
err |
logical argument if the column names of |
nn_locations |
names of the columns in the "locations" table. See the vignette. |
... |
further arguments (currently not used) |
## Not run: library(RPostgreSQL) dbname <- "hydroclimatedb_testing00" val <- sumava_snow_dataset() conn = dbConnect(PostgreSQL(), dbname = dbname) add_locations_into_ssdb(conn,val$locations,new=TRUE) ### Add weather station from MeteoTrentino network, Trentino, Italy val_smet <- meteotrentino_smet_dataset(smet_files=c("T0175","T0179")) add_locations_into_ssdb(conn,val_smet$locations,append=TRUE) dbDisconnect(conn) conn = dbConnect(PostgreSQL(), dbname = dbname) out <- st_read(conn,"locations") dbDisconnect(conn) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.