| Title: | Geospatial Tools for Visibility Analysis |
|---|---|
| Description: | Provides tools for visibility analysis in geospatial data. It offers functionality to perform isovist calculations, using arbitrary geometries as both viewpoints and occluders. |
| Authors: | Claudiu Forgaci [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-3218-5102>), Francesco Nattino [aut] (ORCID: <https://orcid.org/0000-0003-3286-0139>), Netherlands eScience Center [fnd] |
| Maintainer: | Claudiu Forgaci <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.1.1 |
| Built: | 2026-06-02 09:35:46 UTC |
| Source: | https://github.com/cityriverspaces/visor |
Create a polygon representing an occluder
create_occluder(center_x, center_y, length, width)create_occluder(center_x, center_y, length, width)
center_x |
Center x coordinate |
center_y |
Center y coordinate |
length |
Length of the occluder |
width |
Width of the occluder |
object of class sfc_POLYGON
occluder <- create_occluder(0, 0, 10, 2)occluder <- create_occluder(0, 0, 10, 2)
Isovists are estimated by shooting a set of rays from each viewpoint, and by constructing the envelope of the (partially occluded) rays.
get_isovist( viewpoints, occluders = NULL, ray_num = 40, ray_length = 100, remove_holes = TRUE )get_isovist( viewpoints, occluders = NULL, ray_num = 40, ray_length = 100, remove_holes = TRUE )
viewpoints |
object of class sf_POINT or sfc_POINT |
occluders |
object of class sf, sfc or sfg |
ray_num |
number of rays per viewpoint. The number of rays per quadrant
needs to be a whole number, so |
ray_length |
length of rays |
remove_holes |
whether to remove holes from the overall isovist geometry |
object of class sfc_POLYGON or sfc_MULTIPOLYGON
# 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)# 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)
Generate a discrete set of points on the given geometry. If the geometry is a (MULTI)POLYGON, points are generated on its boundary.
get_viewpoints(x, density = 1/50)get_viewpoints(x, density = 1/50)
x |
object of class sf, sfc or sfg |
density |
number of points per distance unit |
object of class sfc_POINT
line <- sf::st_linestring(cbind(c(-1, 1), c(0, 0))) get_viewpoints(line, density = 5)line <- sf::st_linestring(cbind(c(-1, 1), c(0, 0))) get_viewpoints(line, density = 5)