This function will execute all TNETshape function in order to prepare the river network for TNET computation.
Arguments
- path_segments
Path to the shapefile with segments to merge.
- path_node
Path to the shapefile with all segments nodes.
- path_SafranGRID
Path to the shapefile with all SAFRAN GRID IDs.
- path_DEM
Path to the raster DEM used for drain area calculation.
- export_file
Path to the shapefile with results to create.
- hydro_model
can be 'J2000' or 'EROS' depending on the hydrological model used.
- ...
All arguments to be past to other function. All arguments used are the following:
Arguments Function using it ID_special
TNETshape_computeAreaDrain()
(ifhydro_model = 'J2000'
)to_calc
TNETshape_computeCoefQcalc()
all other arguments will be ignored
Details
This function will execute all TNETshape function with all arguments and order as intended by the package author, in order to:
Compute data needed for discharge dispatch coefficients:
if
hydro_model = 'J2000'
: Drain area of all segments are computed (TNETshape_computeAreaDrain()
).if
hydro_model = 'EROS'
: Upstream segment length are computed (TNETshape_computeUpstreamLength()
).
Compute coefficient for specific discharge hypothesis calculations (
TNETshape_computeCoefQcalc()
).Get all SAFRAN IDs of all segments (
TNETshape_getSafran()
).Compute Position and orientation of all segments (
TNETshape_computePosition()
).
Just for clarification, all function in TNETshape functions are independentes,
so they can be launch in every order, not only in the order configure in this function. Only TNETshape_computeCoefQcalc()
used results from TNETshape_computeAreaDrain()
or TNETshape_computeUpstreamLength()
depending on the hydrological
model used.
Examples
## Run directly the function providing all info
TNETshape_prepare(path_segments = "path/to/segments.shp",
path_node = "path/to/nodes.shp",
path_SafranGRID = "path/to/SafranGRID.shp",
path_DEM = "path/to/DEM.tif",
export_file = "path/to/exportFolder")
#> Warning: cannot create dir 'path/to', reason 'No such file or directory'
#> Warning: cannot create dir 'path/to/tmp', reason 'No such file or directory'
#> Warning: cannot create dir 'path/to/tmp/tmp_wbt', reason 'No such file or directory'
#> Warning: GDAL Error 4: path/to/DEM.tif: No such file or directory
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'res': Cannot create a RasterLayer object from this file. (file does not exist)