tests/testthat/test-spGetXY.R

test_that("Get XY creates consistent result", {
  
  # skip for now until alternative testing dataset is configured
  skip()

  # Set up Data
  WYbhfn <- system.file("extdata",
                        "sp_data/WYbighorn_adminbnd.shp",
                        package = "FIESTA")

  # Run spGetXY and expect snapshots
  WYbhxy <- spGetXY(bnd = WYbhfn,
                    xy_datsource = "datamart",
                    eval = "FIA",
                    eval_opts = eval_options(Cur = TRUE),
                    returnxy = TRUE)

  pltids <- WYbhxy$pltids
  spxy <- WYbhxy$spxy

  expect_snapshot(pltids)
  expect_snapshot(spxy)


  # Run spGetXY returning only nonspatial pltids and expect snapshots
  WYbhxyids <- spGetXY(bnd = WYbhfn,
                       xy_datsource = "datamart",
                       eval = "FIA",
                       eval_opts = eval_options(Cur = TRUE),
                       returnxy = FALSE)

  nonsp_plotids <- WYbhxyids$pltids

  expect_snapshot(nonsp_plotids)
})
USDAForestService/FIESTA documentation built on April 5, 2025, 4:13 a.m.