Function index¶
Every public name is imported from the package itself, from iduedu import .... The tables link to the reference
page of each function; the topic pages explain how they work.
Building graphs¶
Data sources, Streets: drive, walk and bike, Public transport from OpenStreetMap, Public transport from GTFS, Intermodal graphs
Build a drivable UrbanGraph from OpenStreetMap within a given territory. |
|
Build a pedestrian UrbanGraph from OpenStreetMap within a given territory. |
|
Build a cycling UrbanGraph from OpenStreetMap within a given territory. |
|
Build one street network for walking, driving and cycling, with every street stored once. |
|
Take the graph of one mode from a street graph of |
|
Build a directed public-transport graph for one or multiple transport modes within a territory. |
|
Travel edges of one route in the order of travel. |
|
Stop nodes of one route in the order the route calls at them. |
|
Routes of the graph with a travel edge or a stop in an area. |
|
Build a static public-transport |
|
Build an intermodal (PT+walking) |
|
Join public-transport and pedestrian |
|
Combine several GTFS feeds into one that the graph builder can consume. |
|
Count once what several merged feeds publish twice. |
|
Configuration of a public-transport mode or service used to estimate travel time on graph edges. |
|
Registry of public-transport specifications for modes and service variants. |
|
Normalize a territory boundary to a single EPSG:4326 Polygon. |
|
Temporarily read OSM data from a local file, or from a territory downloaded from Geofabrik. |
|
OSM file for a territory, cut out of a Geofabrik extract: a drop-in replacement for Overpass downloads. |
|
Download the Geofabrik extract |
|
Id of the smallest Geofabrik extract that fully covers |
|
Geofabrik extracts as a GeoDataFrame in EPSG:4326. |
|
A local OpenStreetMap |
|
Write one compact, referentially complete |
|
Return the moment an OSM file reflects, from its header, as an aware UTC |
The graph model¶
The UrbanGraph model, Graph operations
Tabular representation of an urban transport graph. |
|
Read an |
|
Write an |
|
Validate all node, edge, topology and CRS contracts of an |
|
Return an induced |
|
Clip graph nodes by geometry and keep only edges with retained endpoints. |
|
Join two compatible |
|
Relabel node ids and update edge endpoints. |
|
Return a directed copy of |
|
Return an undirected copy of |
|
Collapse a multigraph |
|
Merge chains of edges through nodes of degree two into single edges. |
|
Merge groups of nearby nodes, such as the several nodes of one junction of dual carriageways, into one. |
|
Return the straight segments the edge geometries are made of, each physical segment once. |
|
Return connected components of an undirected |
|
Return weakly connected components. |
|
Return strongly connected components. |
|
Keep only the largest component of an |
|
Return the nearest graph node id for each input geometry. |
|
Return the nearest graph edge for each input geometry, with the distance and the position along it. |
|
Prepare graph changes that connect objects to their nearest edges. |
|
Apply prepared changes to an |
|
Set of table changes that can be applied to an |
|
Edits of a graph given by lines in any CRS, resolved by |
|
Stable int64 node ids packed from the coordinates of points. |
|
Bind geometric edits to the current graph. |
Routing¶
Shortest paths and matrices, Routes between two points
Search from one node; return distances, paths, or both from one traversal. |
|
Search from the nearest member of one combined source set. |
|
Return nearest source_node and dist columns for each reachable node. |
|
Run independent searches, sharing work for sources mapped to the same node. |
|
Return one shortest node route, or [] when unreachable or beyond cutoff. |
|
Compute OD distances, node routes, or both with one search per unique source. |
|
Yield OD results in origin-row blocks, using the same options as od_matrix. |
|
Convert an ordered node path to ordered graph edges. |
|
Distances and paths from the same Dijkstra searches. |
|
Return the cost and the node route of one shortest path from source_node to target_node. |
|
Return up to k distinct routes from source_node to target_node by the penalty method. |
|
Return up to k shortest loopless paths from source_node to target_node (Yen's algorithm). |
Network analysis¶
Network statistics, Objects around origins, Centrality, Flow assignment, Elevation
Measures of size, density, shape and connectivity of a street network. |
|
Network measures around every node, within a travel cost along the network. |
|
Edge counts, lengths and speeds for every value of an edge column. |
|
Stops, routes and stop spacing of every public-transport mode of a graph. |
|
Number of streets that meet at every node. |
|
Ratio of the shortest network distance to the straight distance between origins and destinations. |
|
Find the |
|
Count objects and sum their values within a travel cost of every origin. |
|
Diversity of object categories within a travel cost of every origin. |
|
Centralities of the nodes of a graph within travel-cost thresholds. |
|
Betweenness of the edges of a graph: how many shortest paths within a threshold run along each edge. |
|
Assign flows from sources to attractive nodes along shortest paths and sum them on the edges. |
|
Add node heights and edge grades to a graph. |
|
Rescale the travel times of a graph with elevation by a speed model that depends on the grade. |
NetworkX¶
Optional; install networkx separately (see Graph operations).
Convert an |
|
Convert a NetworkX graph to an |
|
Convert a NetworkX graph to GeoDataFrames for nodes and/or edges. |
|
Convert a GeoDataFrame of LineStrings into a directed graph (nx.DiGraph). |
|
Keep only the largest connected component of a NetworkX graph. |
|
Clip a NetworkX graph by a polygon and return the induced subgraph. |
|
Read a GML file into a NetworkX graph and cast edge geometry from WKT strings to shapely. |
|
Write a NetworkX graph to GML, coercing node coordinates to plain floats. |
|
Reproject node coordinates (x, y) and edge geometries to a new CRS (in place). |
Settings¶
iduedu.config holds the Overpass endpoint, the cache, the OSM source and logging; see Configuration.