# NOT RUN {
data_dir <- system.file("extdata", package = "stplanr")
unzip(file.path(data_dir, "smallsa1.zip"))
unzip(file.path(data_dir, "testcycleway.zip"))
sa1income <- as(sf::read_sf("smallsa1.shp"), "Spatial")
testcycleway <- as(sf::read_sf("testcycleway.shp"), "Spatial")
cway_catch <- calc_catchment(
polygonlayer = sa1income,
targetlayer = testcycleway,
calccols = c("Total"),
distance = 800,
projection = "austalbers",
dissolve = TRUE
)
plot(sa1income)
plot(cway_catch, add = TRUE, col = "green")
plot(testcycleway, col = "red", add = TRUE)
sa1income <- sf::read_sf("smallsa1.shp")
testcycleway <- sf::read_sf("testcycleway.shp")
f <- list.files(".", "testcycleway|smallsa1")
file.remove(f)
cway_catch <- calc_catchment(
polygonlayer = sa1income,
targetlayer = testcycleway,
calccols = c("Total"),
distance = 800,
projection = "austalbers",
dissolve = TRUE
)
plot(sa1income$geometry)
plot(testcycleway$geometry, col = "red", add = TRUE)
plot(cway_catch["Total"], add = TRUE)
# }
Run the code above in your browser using DataLab