inst/tinytest/test_vect-geom.R

f <- system.file("ex/lux.shp", package="terra")
lux <- vect(f)

listofraw <- geom(lux[1:2, ], wkb = TRUE)
wkb <- listofraw[[1]]
hex <- geom(lux[1, ], hex = TRUE)


expect_equal(typeof(listofraw), "list") 
expect_equal(typeof(wkb), "raw")

expect_equal(tolower(paste0(as.character(wkb), collapse = "")), tolower(hex))

Try the terra package in your browser

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

terra documentation built on Oct. 14, 2024, 5:07 p.m.