Skip to contents

This function uses coordinates to locate the start and stop points for a survey and then draws a line that follows the stream contours between those points. If multiple paths are available, it will choose the shortest, so it's best to eliminate multichannel sections ahead of time

Usage

MakeSurveyTracks(
  shape,
  surveys,
  surveys.crs = "wgs84",
  save.col = "all",
  maxdist = 25,
  survey.coords = c("startlon", "startlat", "endlon", "endlat")
)

Arguments

shape

A sf network or sf object with LINESTRING geometry

surveys

A data frame with coordinates and any other desired information

surveys.crs

a crs object or code for the survey coordinates

save.col

character vector with names of any columns to save, or "all"

maxdist

a maximum distance for when the coordinates are compared to the shape

survey.coords

vector of names or column numbers; order matters

Value

A sf object with LINESTRINGS and data representing each survey