tests/testthat/test_boxes_to_polygons.R

context("Check conversion of submission dataframe to polygon objects")
test_that("dataframe to polygons", {

  xml_path <-get_data("SJER_052_2018","annotations")
  df <- xml_parse(xml_path)

  # load rgb data
  rgb <- raster::stack(get_data("SJER_052_2018","rgb"))

  # Check raster
  expect_s4_class(rgb, "RasterStack")

  ground_truth <- boxes_to_spatial_polygons(df, rgb)
  # correct size
  expect_equal(dim(ground_truth)[1], 9)
})
weecology/NeonTreeEvaluation_package documentation built on Aug. 27, 2024, 10:53 a.m.