test_that('centerish works', { act <- st_centerish(checkerboard, epsg = FALSE)$geometry expected <- structure( list( structure(c(0.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(0.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(1.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(2.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(3.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(4.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(5.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(6.5, 7.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 0.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 1.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 2.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 3.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 4.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 5.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 6.5), class = c('XY', 'POINT', 'sfg')), structure(c(7.5, 7.5), class = c('XY', 'POINT', 'sfg')) ), n_empty = 0L, precision = 0, crs = structure(list(input = NA_character_, wkt = NA_character_), class = 'crs'), bbox = structure(c(xmin = 0.5, ymin = 0.5, xmax = 7.5, ymax = 7.5), class = 'bbox'), class = c('sfc_POINT', 'sfc') ) expect_equal(act, expected) })