Cityseer: Urban Network Analysis

4.24.1 · active · verified Thu Apr 16

Cityseer is a Python library providing computational tools for network-based pedestrian-scale urban analysis. It enables users to model urban environments, analyze accessibility, connectivity, and other urban metrics using spatial data and graph theory. The current version is 4.24.1, and it typically sees regular updates, often with significant changes between major versions.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a `Cityseer` `City` object from an `OSMnx` graph and perform a basic accessibility analysis. It highlights the primary entry point (`City.from_osmnx`) and a common analysis method (`analyze_accessibility`). Ensure `osmnx` is also installed (`pip install osmnx`).

import osmnx as ox
from cityseer import City

# Define a place and retrieve its street network using OSMnx
place_name = 'Piedmont, California, USA'
G = ox.graph_from_place(place_name, network_type='walk')

# Create a Cityseer City object from the OSMnx graph
city = City.from_osmnx(G, crs='EPSG:4326')

# Perform a simple accessibility analysis
accessibility_result = city.analyze_accessibility(target_points=city.nodes.geometry)

# Print a sample of results (e.g., average accessibility)
print(f"Average accessibility (example): {accessibility_result.mean():.2f}")

# To save or visualize, you would typically use city.to_gdfs() or city.draw_network()
# For example, to get nodes with accessibility data:
# nodes_gdf = city.nodes.copy()
# nodes_gdf['accessibility'] = accessibility_result
# print(nodes_gdf.head())

view raw JSON →