tests/testthat/test-degenerate.R

context("test-degenerate.R")
# library(sf)
# > Linking to GEOS 3.5.1, GDAL 2.2.1, proj.4 4.9.3
# library(anglr)
# library(raster)
# > Loading required package: sp
# my_extent <- st_as_sf(as(extent(c(153.185183093, 153.19443135, -27.705328446, -27.6967222119999)),
#                         "SpatialPolygons"))
gm <- tibble::tibble(nrow = 5L, ncol = 2L, type = "POLYGON", object_ = 1L)
cd <- tibble::as_tibble(list(x_ = c(153.185183093, 153.185183093, 153.19443135, 
                            153.19443135, 153.185183093), 
                     y_ = c(-27.705328446, -27.6967222119999, -27.6967222119999, -27.705328446, 
                            -27.705328446)))
my_extent <- structure(list(geometry = build_sf(gm, cd)), 
                       class = c("sf", "data.frame"), row.names  = "1", sf_column = "geometry", agr = factor(c("constant", "aggregate", "identity")))

test_that("sanity reigns", {
  expect_equal(nrow(my_extent), nrow(silicate::PATH(my_extent)$object))
})
mdsumner/sc documentation built on April 4, 2018, 1:36 a.m.