技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
network-accessibility-analysis【数据与研究】Always invoke for access to facilities or opportunities by walking, driving, cycling, or public transport, even for a conceptual question with no routing terms or data yet. Covers hospital and service access, transit/GTFS, routes, isochrones, OD matrices, closest facility, 2SFCA, walkability, coverage, and equity. Invoke when Euclidean buffers proxy …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Purpose: replace as-the-crow-flies guesswork with network-true travel costs, at the right scale and with honest assumptions about speeds and modes. First decision on every task: Euclidean distance is only acceptable as a declared approximation — flag it whenever you see it standing in for access.
| Scale | Tool |
|---|---|
| Neighborhood-city, research flexibility | OSMnx + NetworkX |
| City-region, many-to-many OD (>10⁴×10⁴) | r5py (multimodal + transit w/ GTFS) or pandana (contraction-hierarchy speed) |
| Production routing service | Valhalla / OSRM / OpenRouteService API |
| Proprietary stacks | ArcGIS Network Analyst (script it headlessly) |
NetworkX chokes on metro-scale many-to-many — don't loop shortest_path
over thousands of origins; switch tools instead.
import osmnx as ox
G = ox.graph_from_place("City, Country", network_type="drive") # walk/bike/all
G = ox.add_edge_speeds(G) # imputes from highway tags where maxspeed missing
G = ox.add_edge_travel_times(G) # edge attr: travel_time (s)
G = ox.project_graph(G) # metric CRS before any distance work
drive graph misses
paths, stairs, plazas; driving on all uses footpaths. Match mode.ox.truncate.largest_component(G, strongly=True)); orphan islands
cause spurious infinities.ox.distance.nearest_nodes). Report the snap-distance distribution;
a facility snapped 2 km away (riverside, gated area) silently corrupts
results.k for big
graphs — exact is O(nm)); edge betweenness ≈ through-traffic potential.
Interpret as network structure, not observed traffic.| Metric | Question it answers | Weakness |
|---|---|---|
| Cumulative opportunities (# jobs/POIs within T min) | Simple, communicable | Cliff at T; all-or-nothing |
| Gravity-based (distance-decayed sum) | Smooth access | Decay parameter must be justified |
| 2SFCA / E2SFCA | Supply-demand ratio access (health care standard) | Catchment size choice drives results |
| Closest-facility time | Worst-case need | Ignores capacity/congestion |
For equity analyses, join metrics to population/demographic polygons
(area-weighted or dasymetric — see geo-data-engineering) and report
distributions per group, not just city means. Route statistical testing of
disparities to spatial-statistics.
Optimal siting (p-median, max-coverage) on the OD matrix: formulate with
PuLP/OR-Tools; inputs are the OD matrix + demand weights + candidate
sites. State the objective explicitly — minimize mean travel time
(p-median) vs maximize covered demand within T (max-coverage) give
different answers, and stakeholders rarely know which they asked for.
Feed results back to mcda-suitability-analysis when siting mixes network
access with other criteria.
Use r5py with OSM + GTFS feeds; results are departure-time sensitive — compute over a time window (e.g., 07:00-09:00 percentiles), never a single departure. Validate the feed (calendar coverage on your analysis date!) — an expired GTFS calendar yields walking-only times that look plausible.