fia_clean_best_cds: reformats current "best_coordinates" FIA plot coordinate...

View source: R/fia_clean_best_cds.R

fia_clean_best_cdsR Documentation

reformats current "best_coordinates" FIA plot coordinate table to be long format and adds optional geometry fields

Description

reformats current "best_coordinates" FIA plot coordinate table to be long format and adds optional geometry fields

Usage

fia_clean_best_cds(
  df_best,
  id_nms = c("INV_PLOT_ID", "STATECD", "REGION", "COUNTYCD", "PLOT", "PLOT_PUBLIC",
    "NFS_PLOT_NUMBER", "COORD_TYPE_NAME", "PC_COORD_METHOD_NAME", "PC_SRID"),
  sequential_steps = c("remove_duplicates", "filter_cds", "cds_wide_to_long",
    "reproject_crs_out", "create_geometry"),
  geom_type = c("SUBPLOT POINT", "SUBPLOT POLYGON", "PLOT POINT", "PLOT POLYGON"),
  filters = c("STATECD==41", "COORD_TYPE_NAME=='SP1'", "PC_COORD_METHOD_NAME == 'HPGPS'"),
  ply_radius = c(m = 24 * 0.3048, ft = 24)[1],
  crs_in = c(latlon = "EPSG:6318"),
  crs_out = c(utm10 = "EPSG:6339"),
  nms_cds = list(LON_X = paste(paste0("SP", 1:4), c("LON_X"), sep = "_"), LAT_Y =
    paste(paste0("SP", 1:4), c("LAT_Y"), sep = "_")),
  ...
)

Arguments

df_best

data.frame with coordinates from PNW NIMS view ~coords_best

id_nms

unique identifiers that will be attached to each coordinate

sequential_steps

these steps are sequential, and dropping one step will invalidate later steps

geom_type

if geometry is desired, what type: points and/or polygons and subplot and/or plot multipart objects

filters

vector of string filters used to subset input set of coordinates, see dplyr::filter

ply_radius

what radius should be used around the subplot centers when creating polygons, should be in units of crs_out

crs_in

what is the projection of input coordinates - the coords_best table (as of 10/08/2024) has NAD83 2011 LAT/LON (doesn't have to be named vector)

crs_out

what projection should the output geometry be in (doesn't have to be named vector)

nms_cds

a named list with two elements where each element is a named vector of coordinate columns. The output coordinates are placed in columns with the list names, see defaults for example

Details

reformats current "best_coordinates" FIA plot coordinate table to be long format and adds optional geometry fields

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.


Revision History

1.0 10/2/2024 Created
1.1 date and revisions..

Value

a list with up to 5 components:

1. long format SUBPLOT coordinate data 2. long format suSUBPLOT coordinate data with point geometry (optionally transformed to crs_out) 3. long format PLOT coordinate data with multipoint geometry (optionally transformed to crs_out) 4. long format SUBPLOT coordinate data with polygon geometry (MUST be transformed to crs_out) 5. long format PLOT coordinate data with multipolygon geometry (MUST be transformed to crs_out)

Author(s)

Jacob Strunk <some.body@somewhere.com>

See Also

dplyr::filter
data.table::melt

Examples


res1 = fia_clean_best_cds(cds_5k)




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