inst/tinytest/test_getLinkLayer.R

library(sf)
library(sp)
mtq <- st_read(system.file("gpkg/mtq.gpkg", package="cartography"), quiet = TRUE)
mob <- read.csv(system.file("csv/mob.csv", package="cartography"))
mob_97209 <- mob[mob$i == 97209, ]
mob.sf <- getLinkLayer(x = mtq, df = mob_97209, dfid = c("i", "j"))


expect_equal(nrow(mob.sf), 10 )


expect_silent(getLinkLayer(x = as(mtq, "Spatial"),df = mob_97209, dfid = c("i", "j")))
expect_error(getLinkLayer(spdf = as(mtq, "Spatial")))
expect_error(getLinkLayer(mtq[1:5,], df = mob_97209))
expect_warning(getLinkLayer(mtq[1:20,], df = mob_97209))

Try the cartography package in your browser

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

cartography documentation built on Sept. 14, 2023, 5:08 p.m.