isovist

Exact 2D isovists, isovist shape measures, point-to-point intervisibility and visibility graph analysis (VGA) for urban design, with GeoJSON in/out and a CLI.

Version 0.1.2 · Python >=3.9 · MIT licence
pip install isovist
PyPISourceIssuesChangelogCite (DOI)

isovist

PyPI version Python versions pipeline status License: MIT DOI Downloads

Exact 2D isovists and visibility graph analysis for urban design.

isovist computes what can be seen from a point in a plan of buildings, walls and columns, and describes the shape of that visible space with the classic isovist measures. It also runs visibility graph analysis (VGA) on a grid of points and answers point-to-point "can A see B?" questions. The only dependency is NumPy.

pip install isovist

Requires Python 3.9 or newer.


Quick start (Python)

from isovist import Environment

room = [(0, 0), (10, 0), (10, 10), (0, 10)]
pillar = [(4, 4), (6, 4), (6, 6), (4, 6)]
env = Environment(obstacles=[pillar], boundary=room)

iso = env.isovist((2, 5))
iso.area          # 70.0   (100 - pillar 4 - shadow 26)
iso.occlusivity   # 13.416 (two occluding edges of length sqrt(45))
iso.polygon       # [(x, y), ...] counter-clockwise ring

m = iso.measures()
m.compactness, m.drift, m.mean_radial, m.max_radial

env.isovist((2, 5), fov=90, direction=0, max_radius=6)   # 90 deg view cone, 6 m reach
env.is_visible((3, 5), (7, 5))                           # False: the pillar is in the way

from isovist import visibility_graph_analysis
vga = visibility_graph_analysis(env, spacing=1.0)
vga.connectivity, vga.clustering, vga.mean_depth, vga.integration

Obstacles and the boundary are isovist.Polygon objects (holes allowed) or plain vertex lists. Obstacles may overlap each other and may stick out of the boundary. Holes in the boundary act as obstacles. The viewpoint must lie strictly in free space.

Quick start (command line)

# isovists with all measures for two viewpoints and for every Point in a file
isovist compute --obstacles buildings.geojson --boundary site.geojson \
    --at 512340.5,4512200 --points viewpoints.geojson -o isovists.geojson

# 120 degree view cone towards north-east, 80 m reach
isovist compute --obstacles buildings.geojson --at 512340.5,4512200 \
    --fov 120 --direction 45 --max-radius 80

# VGA on a 2 m grid (writes grid points with the measures)
isovist vga --obstacles buildings.geojson --boundary site.geojson --spacing 2 -o vga.geojson

# intervisibility; exit code 0 = visible, 1 = not visible
isovist visible --obstacles buildings.geojson --from 10,20 --to 80,45

Write negative coordinates as --at=-12.5,40 so they are not read as options. Without --boundary, open-space isovists need --max-radius.

See examples/quickstart.py for a small plaza with two pavilions and a column.

Coordinates and GeoJSON

All geometry is planar, so coordinates must be projected (metres or feet), for example UTM. RFC 7946 GeoJSON is nominally longitude/latitude. isovist reads and writes the same structure with projected coordinates, as produced by ogr2ogr -t_srs EPSG:32635 -lco RFC7946=NO out.geojson in.gpkg. A legacy crs member in the input is copied to the output. load_environment warns when the coordinates look like degrees.

Outputs: isovist compute writes Polygon features with the viewpoint (vp_x, vp_y), the input point properties and every measure. isovist vga writes Point features with connectivity, clustering, mean_depth, relative_asymmetry, integration and node_count. Undefined values (nan, inf) become null.

API overview

Object / function Purpose
Environment(obstacles, boundary=None, tol=None) the plan; .isovist(), .is_visible(), .visibility_matrix(), .locate()
Environment.isovist(vp, max_radius=None, fov=None, direction=0, arc_step=1) exact Isovist
Isovist .polygon, .area, .perimeter, .centroid, .occlusivity, .occluding_edges, .radial(theta), .contains(pt), .measures(), .to_geojson()
IsovistMeasures area, perimeter, compactness, jaggedness, occlusivity, occluding_edges, drift, drift_angle, min/max/mean/std_radial
visibility_graph_analysis(env, points=None, spacing=None, max_radius=None) VGAResult with per-node arrays and .records()
grid_points(env, spacing, bounds=None, origin=None) cell-centre grid in free space
graph_measures(adjacency) VGA measures for any undirected graph
load_environment, polygons_from_geojson, points_from_geojson, feature_collection, write_geojson GeoJSON I/O

Angles are in degrees, counted counter-clockwise from east (+x), in both the API and the CLI. Isovist.radial takes radians.

Method and sources

Isovist. An isovist is the set of points visible from a vantage point (Benedikt 1979). Every edge end point, every crossing between overlapping polygons, every point where an edge meets the view-distance circle and each field-of-view limit gives a critical direction. Between two consecutive critical directions the nearest edge cannot change, so one ray at the mid-angle finds it. The isovist boundary on that interval is then the exact intersection of the two bounding rays with that edge's line, or a circular arc of radius max_radius. Edges face the viewer only when the viewpoint lies on their open side, so back faces are culled. Only arcs are discretised, and only for the output polygon (arc_step). Area, perimeter, centroid and radial statistics use exact sector formulas.

Measures. With A the area, P the perimeter and r(θ) the radial length:

Measure Definition Source
area, perimeter A, P Benedikt 1979
occlusivity total length of the radial occluding edges (boundary that is not a surface). View-cone sides and view-distance arcs are not counted. Benedikt 1979
compactness 4πA / P² (1 for a circle) circularity form used in isovist studies after Benedikt 1979; Batty 2001
jaggedness P² / A (4π for a circle) Wiener et al. 2007
drift, drift_angle distance and direction from the viewpoint to the isovist centroid Turner et al. 2001; Batty 2001
min/max/mean/std radial moments of r(θ) over the visible angle, as continuous integrals Benedikt 1979 (radial moments); Batty 2001

For a straight piece at perpendicular distance h, with tangential coordinate τ: ∫ r dθ = h ln((r₁+τ₁)/(r₀+τ₀)) and ∫ r² dθ = h (τ₁ − τ₀).

VGA (Turner et al. 2001). Nodes are grid points in free space. Two nodes are linked when they can see each other (both ways, by the same exact rule as is_visible). For each node:

Each row of the visibility matrix is computed from one exact isovist, so VGA costs one isovist per grid point plus an n × n BFS in matrix form.

References

Limitations

Development

pip install -e ".[dev]"
python -m pytest tests -q
python -m ruff check . && python -m ruff format --check src tests
python -m mypy src

The tests check results against hand-computed geometries: a convex room, a room with a pillar, an L-shaped corridor, view cones, view-distance circles clipped by walls and small graphs with known depths. They also cross-check against independent sampled rays.

Academic citation

If you use isovist in research, please cite it (see also CITATION.cff):

@software{eminoglu_isovist,
  author  = {Eminoğlu, Yusuf},
  title   = {isovist},
  year    = {2026},
  version = {0.1.2},
  doi     = {10.5281/zenodo.24122207},
  url     = {https://gitlab.com/geophilo1/isovist_sdk}
}

Related Geophilo SDKs

License

MIT © 2026 Yusuf Eminoğlu. See LICENSE.

Other Geophilo SDKs