These scripts were created to generate basin delineations and other value-added products from Water Survey of Canada hydrometric stations.
download the latest build from the /built subdirectory and from your R session type:
devtools::install_local(<path to *.tar.gz>)
Most dependencies will download automatically provided that you install using devtools::install_local
from a built *.tar.gz
file. Others will need to be downloaded and installed manually such as HYDAT
The R package consists of the following files:
-
DEM_tools.R: creates DEM mosaics from local files or from various online FTP servers (e.g. CDED, NED) after downloading them
-
geonames_db.R: For interacting with canadian geographic names database API
-
HYDROBASINS_Rscript.R: For interacting with HydroBASINS tables
-
misc.R: miscellaneous helper functions
-
SAGA_Tools.R: Wrappers for RSAGA functions, mostly those suited to basin delineation and DEM preprocessing
-
spatial_stations.R: Functions to create R Spatial* objects corresponding to hydrometric stations from ECDE table exports or the HYDAT sqlite database
-
station_names.R: Functions to parse hydrometric station names and
-
basin_creation.R: Relies on above files to create basin delineations from a few input parameters such as station names/numbers and coordinates
-
upstReam.R: Used to construct and query large matrices describing upstream/downstream hydrometric station relationships