rchlumsk / RavenR

R package for handling Raven hydrologic modelling framework inputs, outputs, and diagnostics
36 stars 16 forks source link

Addition of Nith River HRU shapefile to package library #32

Closed aviolinist closed 6 months ago

aviolinist commented 4 years ago

This is required for the rvn_gen_gridweights.R example, which uses grid and HRU shapefiles as part of the function inputs to generate an .rvi file of grid weights for the basin.

Grid shapefile is generated by passing Nith.nc into rvn_netcdf_to_gridshp.R, which currently has external package dependencies that are not yet compatible with R 4.0+. Requires follow-up.

The example workflow for rvn_gen_gridweights.R (revised by SL, 2020-07-23) is shown below:

#'   # Example workflow
#'   # load example rvh file
#'   nith <- system.file("extdata",'Nith.rvh', package = "RavenR")
#'   rvh <- rvn_rvh_read(nith)
#'
#'   # define HRU shapefiles (needs to be added to library)
#'   HRUshpfile <- system.file("extdata","Nith_HRU.shp",package = "RavenR")
#'
#'   # write grid shapefile from netcdf file
#'   nithnc <- system.file("extdata","Nith.nc",package = "RavenR")
#'   GridCells <- "Nith_GridCells.shp"
#'   UTMzone <- 17
#'   GRDshpfile <- rvn_netcdf_to_gridshp(nithnc,UTMzone,GridCells)
#'
#'   # generate .rvi file of grid weights
#'   validHRUIDs <- rvh$HRUtable$ID
#'   tmp <- rvn_gen_gridweights(HRUshpfile, GRDshpfile, validHRUIDs,
#'    gridIDcol = 'GridIDs', HRUIDcol = "HRU_ID", outfile = "Nith_GridWeights.rvi)
rchlumsk commented 4 years ago

Updated the example for this function to use the existing subbasin shapefile and updating Nith rvh HRU table to just one for each subbasin.

Getting the full HRU shapefile would still be helpful.

rchlumsk commented 6 months ago

Closing as spatial functions have been since removed from RavenR package