fia_make_geom: convert xy coordinates to fia plots

View source: R/fia_make_geom.R

fia_make_geomR Documentation

convert xy coordinates to fia plots

Description

supply fia PLOT centers (x,y NOT lat,long) and generate SUBPLOT locations as a multipoint sf object assuming feet, although distances to subplots are provided as parameters. Simply set offx = c("2"=0,"3"=103.923,"4"=-103.923)*0.3048 and offy= c("2"=120,"3"=-60,"4"=-60)*0.3048 respectively to obtain metric equivalen if the input coordinates are meters. If lat/long coordinates are desired, simply reproject from a projected system to lat/long after generating PLOT footprints

Declination: This function assumes the PLOT is perfectly north facing and does not account for declination.

This program is free software but it is provided WITHOUT WARRANTY and with ABSOLUTELY NO GUARANTEE of fitness or functionality for any purpose; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Usage

fia_make_geom(
  data,
  col_names = c(PLOT = "PLOT", x = "x", y = "y"),
  output = c("SUBPLOT data.frame", "SUBPLOT POINT", "SUBPLOT POLYGON", "PLOT POINT",
    "PLOT POLYGON"),
  subplot_radius = 24,
  endCapStyle = "ROUND",
  offx = c(`2` = 0, `3` = 103.923, `4` = -103.923),
  offy = c(`2` = 120, `3` = -60, `4` = -60)
)

Arguments

data

dataframe with id, x, y columns available

col_names

a named vector with serves as a lookup a table for the input data - must use provided names: PLOT, x, y

subplot_radius

radius or side length of SUBPLOT

endCapStyle

enable square or round plots

offx

named vector to set x offsets for subplots 2-4 (must have names "2","3","4")

offy

named vector to set y offsets for subplots 2-4 (must have names "2","3","4")

create_polys

TRUE / FALSE create polygons or just return theoretical SUBPLOT centers

Details

<Delete and Replace>


Revision History

1.0 09/09/2022 Upgraded to sf added more parameters for output PLOT

Value

a named list with possible elements output = c("SUBPLOT data.frame","SUBPLOT POINT","SUBPLOT POLYGON","PLOT POINT","PLOT POLYGON"):

"SUBPLOT data.frame" - a data.frame with records for each each PLOT and SUBPLOT "SUBPLOT POINT" - a point sf object for each PLOT and SUBPLOT "SUBPLOT POLYGON" - a polygon sf object for PLOT and SUBPLOT "PLOT POINT" - a multipoint sf object for each PLOT "PLOT POLYGON" - a multipolygon sf object for each PLOT

Author(s)

Jacob Strunk <strunky@gmail.com>

See Also

bbox2polys
sf
st_buffer

Examples


   res= fia_make_geom(data.frame(PLOT=1:10, x=101:110*10000, y=101:110*10000),create_polys=T)


jstrunk001/RForInvt documentation built on April 17, 2025, 5:02 p.m.