make_lines: make_lines()

View source: R/make_lines.R

make_linesR Documentation

make_lines()

Description

Converts GPS data/ waypoints to line features. Attribute data is maintained. Currently, this function generates points to transect by converting the POINT feature data to LINES sf features. A placeholder has been made to generate transect lines via the transect method created by M. Coghill.

Usage

make_lines(
  GPSPoints,
  Transects,
  method = "pts2lines",
  sortby = "none",
  tBuffer = 20,
  PROJ = 3005
)

Arguments

GPSPoints

is a simple features POINT object. Minimum attributes in this file include fields named 'id' and 'time'. Waypoints will be sorted by these two entries.

Transects

is the original planned transect simple feature. The 'id' attribute in this feature will be used to group points by their transect id. This transect id will be named 'TID' in the output data.

method

Multiple methods to be made available:

  • pts2lines takes a sf POINT object and converts it to lines. _This is currently the only function available

  • tracklog uses the tracklog and the sample points to generate the lines. Not implemented yet.

sortby

Field in the points data to sort the points by. Defaults to "none" (i.e. assumes no sorting of data)

tBuffer

is optional with a default of 20m. This is the buffer distance to place around the transect. Waypoints outside this distance will not be considered.

PROJ

is an optional the epsg projection code with a default of BC Albers (3005). Data imported will be transfored to this projection and final data will be exported in this projection.

Examples

## Convert GPS waypoints to line features (i.e. transect data)
transects <- convert_pts2lines(gpsData, PlannedTransects)

ColinChisholm/pemgeneratr documentation built on March 14, 2023, 10:47 p.m.