Calculate additive function values for sites in a LSN

afv_sites(
  sites,
  edges,
  afv_col,
  save_local = TRUE,
  lsn_path = NULL,
  overwrite = TRUE
)

Arguments

sites

A named list of one or more sf objects with POINT geometry that have been snapped to the LSN using sites_to_lsn.

edges

An sf object with LINESTING geometry created using lines_to_lsn.

afv_col

Name of the column in edges containing the additive function value for each feature, in character format. Created using afv_edges.

save_local

Logical indicating whether the updated sites should be saved to lsn_path in geopackage format. File basenames are taken from the names assigned to the sites list. Default is TRUE.

lsn_path

Optional. Local pathname to a directory in character format specifying where the LSN resides, which is created using link[SSNbler]{lines_to_lsn}. Must be specified if save_local = TRUE.

overwrite

A logical indicating whether results should be overwritten if afv_col already exists in sites or sites.gpkg already exists in lsn_path and save_local = TRUE. Default = TRUE.

Value

One or more sf object(s) with all the original data from sites, along with a new afv_col column in each sites sf object. A named list is returned. If save_local = TRUE, a geopackage for each sf object is saved in lsn_path. Output file names are assigned based on the input sites attribute names.