Skip to content

transitlos.flex.cells

Stations of every H3 cell on a street network: snap -> multi-label search -> edge/cell distances -> floors, dominance, cap.

net = CsrNetwork.load(network_cache_folder) # or CsrNetwork(nodes, edges, crs) from a StreetNetwork's tables res = compute_cell_stops(net, stations_lat, stations_lon, prof, cfg) los, slot, profile = recompute(res, prof, params) # any scoring, 5-10 ms per 10^4 cells

CellStops(cells, station, dist, flag, cropped, stats) dataclass

The stations each H3 cell can walk to: up to K per cell, with the walking distance, plus flags and search statistics.

compute_cell_stops(net, lat, lon, prof, cfg=core.Config(), params=DEFAULT, resolution=10, max_snap_m=300.0)

net = UrbanAccessAnalyzer.csr_network.CsrNetwork; stations at (lat, lon) with prof profiles (same order).

Parameters:

Name Type Description Default
net

Street network (UrbanAccessAnalyzer.csr_network.CsrNetwork).

required
lat

Station latitudes.

required
lon

Station longitudes.

required
prof Profiles

Station profiles, in the same order as the stations.

required
cfg Config

Caps and floors.

Config()
params ScoreParams

Scoring parameters (used by the cap).

DEFAULT
resolution int

H3 resolution of the cells.

10
max_snap_m float

Stations farther than this from a street are not used.

300.0

Returns:

Name Type Description
The CellStops

class:CellStops.

recompute(res, prof, params=DEFAULT)

Cell scores (0-100) under params: (los[nc], winning station slot[nc], winning profile[nc]).

Parameters:

Name Type Description Default
res CellStops

Result of :func:compute_cell_stops.

required
prof Profiles

Station profiles.

required
params ScoreParams

Scoring parameters.

DEFAULT