Skip to contents

Updating wst_id information in model text files

Usage

update_wst_txt(fname, write_path, wst_sf, spacing, folder_to_save = "temp")

Arguments

fname

character, model file name (example 'aquifer.con').

write_path

character, path to SWAT+ txtinout folder (example "my_model").

wst_sf

sf dataframe with weather station information. Should contain "name" and "geometry" columns.

spacing

character, should contain information about spacing between columns in the file. Example c('%8s', '%-12s', rep('%12s', 5), '%8s', '%16s', rep('%8s', 4)).

folder_to_save

character, folder to save function results. Optional, default = "temp".

Value

Updated text file, which would have updated station names (with nearest stations to features).

Examples

if (FALSE) {
spacing <- c('%8s', '%-12s', rep('%12s', 5), '%8s', '%16s', 
rep('%8s', 4), '%12s', '%8s', rep('%12s', 2))
update_wst_txt("reservoir.con", "model_folder", wst_sf, spacing)
}