# Define viewpoints and occluder geometries
viewpoints <- sf::st_sfc(
sf::st_point(c(-1, 1)),
sf::st_point(c(0, 0)),
sf::st_point(c(1, -1))
)
occluder1 <- sf::st_polygon(list(sf::st_linestring(
cbind(c(-1, -1, -0.9, -0.9, -1),
c(-1, -0.9, -0.9, -1, -1))
)))
occluder2 <- sf::st_polygon(list(sf::st_linestring(
cbind(c(0.4, 0.4, 0.6, 0.6, 0.4),
c(0.5, 0.7, 0.7, 0.5, 0.5))
)))
occluders <- sf::st_sfc(occluder1, occluder2)
# Calculare isovist based on 40 rays (default)
get_isovist(viewpoints, occluders, ray_length = 1.5)
# Increase number of rays to get higher resolution
get_isovist(viewpoints, occluders, ray_num = 400, ray_length = 1.5)
Run the code above in your browser using DataLab