tests/testthat/test-spGetXY.R

test_that("Get XY creates consistent result", {
  
  skip_on_cran()

  # 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)
})

Try the FIESTA package in your browser

Any scripts or data that you put into this service are public.

FIESTA documentation built on June 22, 2024, 7:37 p.m.