todindex

Transit-oriented development (TOD) assessment of station areas: catchments, 3D/5D built-environment indicators, Bertolini node-place model and a composite TOD index with AHP or PCA weights.

Version 0.1.3 · Python >=3.9 · MIT licence
pip install todindex
PyPISourceIssuesChangelogCite (DOI)

todindex

PyPI version Python versions pipeline status License: MIT DOI Downloads

Transit-oriented development (TOD) assessment of station areas.

todindex measures how transit-oriented the areas around stations are. It covers:

It needs only the Python standard library and NumPy. Geometry (clipping streets and land-use polygons to catchments) is exact planar computation in pure Python.

pip install todindex

Requires Python 3.9 or newer.


Quick start (Python)

from todindex import (
    Station, PointFeature, LineFeature, AreaFeature,
    assess, node_place, composite_index, ahp_weights, pairwise_matrix,
)

stations = [
    Station("Centre", 0, 0, {"departures": 600, "lines": 5}),
    Station("Suburb", 3000, 0, {"departures": 180, "lines": 1}),
]
population = [PointFeature(120, 80, weight=350), PointFeature(3100, 50, weight=90)]
jobs = [PointFeature(-60, 40, weight=900), PointFeature(2900, -100, weight=40)]
streets = [LineFeature([(-1000, 0), (0, 0), (4000, 0)]),
           LineFeature([(0, -1000), (0, 0), (0, 1000)], pedestrian=True)]

rows = assess(stations, population=population, jobs=jobs, streets=streets,
              radii=(400, 800))
rows[0]["activity_density_800"]      # residents + jobs per hectare
rows[0]["intersection_density_400"]  # intersections per km2

np_res = node_place(rows, ["departures", "lines"],
                    ["activity_density_800", "intersection_density_800"])
np_res.classes                       # e.g. ['stress', 'dependency']

tod = composite_index(rows, ["activity_density_800", "intersection_density_800"],
                      normalization="minmax", weights="equal")
tod.scores, tod.ranks

Longitude/latitude input: pass lonlat=True to assess; coordinates are projected with a local equirectangular projection centred on the stations.

A longer synthetic example is in examples/quickstart.py.

Quick start (command line)

# 5D indicators for 400 m and 800 m buffers, from GeoJSON layers in lon/lat
todindex assess stations.geojson --station-id code \
    --population blocks.geojson --population-field pop \
    --jobs firms.geojson --jobs-field employees \
    --landuse parcels.geojson --landuse-field landuse \
    --streets osm_streets.geojson \
    --stops bus_stops.geojson \
    -o indicators.csv --geojson indicators.geojson \
    --catchments buffers.geojson --report report.md

# node-place model from any table (CSV or GeoJSON)
todindex nodeplace indicators.csv --node departures,lines \
    --place activity_density_800,landuse_entropy_800 -o nodeplace.csv

# AHP weights and consistency ratio from a pairwise matrix ("1/3" allowed)
todindex ahp matrix.csv

# composite index with AHP weights; walk distance is a cost indicator
todindex composite indicators.csv \
    --indicators activity_density_800,landuse_entropy_800,mean_distance_to_station_800 \
    --cost mean_distance_to_station_800 --ahp matrix.csv -o tod.csv

Use --crs projected when the layers are in a metric projected CRS. todindex ahp exits with code 3 when the consistency ratio exceeds 0.10.

API overview

Function / class Purpose
Station, PointFeature, LineFeature, AreaFeature Input data model (projected metres or lon/lat)
stations_from_geojson, points_from_geojson, lines_from_geojson, areas_from_geojson GeoJSON loaders
Catchment.buffer / .polygon / .network Station catchments
assess(stations, population=..., jobs=..., ...) 5D indicators per station and catchment
entropy, jobs_population_balance, street_intersections Individual indicator functions
node_place, classify_node_place Node-place model
normalize, ahp_weights, pairwise_matrix, pca_weights, composite_index Composite TOD index
stations_geojson, catchments_geojson, write_geojson, write_csv, read_table, markdown_report Outputs

Indicators produced by assess

Each column is suffixed with the catchment label (_400, _800, _net800, _poly ...).

D Column Definition
Density population, jobs, dwellings Sum of point weights inside the catchment
population_density, job_density, dwelling_density Per hectare of catchment
activity_density (residents + jobs) per hectare
Diversity landuse_entropy -sum p_j ln p_j / ln K, K = all land-use categories in the study
jobs_population_balance 1 - abs(J - rP) / (J + rP), r = regional jobs per resident by default
Design street_length_km Street length clipped to the catchment
intersection_count, intersection_density Nodes of degree >= 3; per km²
pedestrian_street_share Share of street length flagged pedestrian-oriented
Destination accessibility destinations (Weighted) destinations inside
destination_gravity Hansen (1959): sum w exp(-beta d) (if gravity_beta given)
Distance to transit transit_stops Other stops inside the catchment
mean_distance_to_station Population-weighted mean distance to the station (network distance when available)
nearest_station_m Distance to the nearest other station

Land use can be polygons (the clipped area is the amount) or points with a weight such as floor area. Streets must be noded like OpenStreetMap ways (streets crossing at grade share a vertex). By default the OSM highway values pedestrian, footway, living_street, path, steps and residential count as pedestrian-oriented; pass your own set with pedestrian_values.

Method and sources

Limitations

Development

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

Academic citation

@software{eminoglu_todindex,
  author  = {Eminoğlu, Yusuf},
  title   = {todindex},
  year    = {2026},
  version = {0.1.3},
  doi     = {10.5281/zenodo.24235592},
  url     = {https://gitlab.com/geophilo1/todindex_sdk}
}

Related Geophilo SDKs

License

MIT License. Copyright (c) 2026 Yusuf Eminoğlu. See LICENSE.

Other Geophilo SDKs