Skip to contents

This function calculates the coordinates of trees based on their azimuth and distance from the plot center, and optionally saves the results in sf format.

Usage

calculate_new_tree_position(
  plot,
  save,
  crs,
  dataset,
  plot_center_x,
  plot_center_y
)

Arguments

plot

The plot number for which tree positions are calculated (numeric).

save

Logical (TRUE or FALSE), indicating whether to save the results to a SHP file.

crs

Coordinate reference system in EPSG format (default is 2180, which is the PUWG 1992 system for Poland).

dataset

Path to the CSV file containing tree data with columns: plot_id, azimuth, distance.

plot_center_x

The x-coordinate of the plot center (numeric).

plot_center_y

The y-coordinate of the plot center (numeric).

Value

A spatial data frame (sf object) with calculated tree positions.

Examples

if (FALSE) { # \dontrun{
calculate_new_tree_position(
  plot = 1,
  save = TRUE,
  crs = 2180,
  dataset = "trees_data.csv",
  plot_center_x = 500000,
  plot_center_y = 400000
)
} # }