tests/testthat/test-spExportSpatial.R

test_that("Export Shapefile Works", {

  skip_on_cran()

  # Set Output
  outfolder <- tempdir()
  
  # Import Spatial File
  WYbhfn <- system.file("extdata",
                        "sp_data/WYbighorn_adminbnd.shp",
                        package = "FIESTA")

  WYbh <- spImportSpatial(WYbhfn)

  expect_no_error(spExportSpatial(WYbh,
                                  savedata_opts = list(out_dsn = "WYbh.shp", 
                                                       outfolder = outfolder, 
                                                       overwrite_dsn = TRUE)))


  expect_output(spExportSpatial(WYbh,
                                savedata_opts = list(out_dsn = "WYbh.shp", 
                                                     outfolder = outfolder, 
                                                     overwrite_dsn = TRUE)))

})

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.