Calculates UTM coordinates for all trees in a user-provided mapping dataset and returns a spatial object that can be plotted and joined with other spatial datasets such as fine-scale topography data.

tree_utm(tree_x_y, stand_locs, original_crs, utm_crs)

Arguments

tree_x_y

Data frame containing mapping information for trees. Must contain the columns stand_id (name of stand the tree is located in), x_coord (local x coordinate), and y_coord (local y coordinate). Any additional columns will appear unchanged in the output.

stand_locs

Data frame containing locations of stand origins (i.e. local coordinates (0, 0)) and their y-azimuths (i.e. bearing from (0, 0) to (0, maximum y)). Columns must be named stand_id, y_azim, latitude, longitude - see dataset stand_locations for an example. Latitudes and longitudes must be in decimal degrees or UTM units.

original_crs

Coordinate reference system of the location data in stand_locs as an ESPG code.

utm_crs

ESPG code of the UTM zone in which the trees are located. If the location data are in UTM, this will be the same as original_crs.

Value

The input data frame tree_x_y with one additional column containing spatial information.

Details

Location data for stands (argument stand_locs) must be provided in either decimal degrees or UTM format. If your data are in another format such as degrees/minutes/seconds, please convert them to one of the accepted formats. The measurements::conv_unit function is particularly useful for achieving this.

Examples

mapping_utm <- tree_utm(mapping, stand_locations, 4326, 32610)