Predicting cycling overtake exposure on street network edges from openSenseMap bicycle sensor data.
senseBox:bike devices record GPS tracks with measured lateral distances of overtaking vehicles. We match these measurements to OSM street network edges, enrich the edges with static traffic and infrastructure attributes, and test how well sparse sensor data can predict overtake exposure across the network — what hurts prediction more, starving the temporal dimension (collection frequency) or the spatial coverage (which edges get sampled)?
conda env create -f environment.yml
conda activate sensebox_network_samplingsenseboxbike_preprocessing.py builds the analysis network for Münster:
-
Acquisition — downloads the cyclable street network (
network_type="bike": all ways cyclists may legally use, not just bike infrastructure) via OSMnx, topologically simplified, projected to EPSG:25832, cached as GraphML ininput/. -
Sidepath detection — Münster's cycle infrastructure is largely sidewalk-level tracks alongside roads. Car-free edges are flagged as sidepaths via the OSM tag
is_sidepath=yescombined with a geometric check: within 12 m of a motor-traffic road unconditionally, within 12–30 m only if roughly parallel (bearing of longest segment within 25°). -
Classification — each edge gets one riding-regime class (precedence-ordered, most specific first):
class meaning bicycle_streetFahrradstraße, cars are guests roadside_trackseparated track along a road (red tiles etc.) independent_pathcycleway/path away from motor traffic painted_laneon-carriageway cycle lane pedestrian_zoneriding among pedestrians residential_streetlow-speed residential streets service_wayaccess/parking/service ways offroad_trackunpaved field/forest tracks bus_lanebus and bikes share the carriageway minor_road_sharedmixed traffic, minor connector roads main_road_sharedmixed traffic on an arterial road OSM tag booleans (
has_lane_tag,is_cycling_street,is_sidepath, …) are kept as separate columns for modelling. -
Audit & outputs — diagnostics (highway-tag crosstab, precedence audit, length-weighted class shares, small-multiple maps) are written to
output/inspection/; the classified edges toinput/muenster_edges_classified.gpkg; an overview map tooutput/network_overview.png.
Run with:
python network_preprocessing.pyThe OSM download is cached — delete input/muenster_bike.graphml or call
get_graph(force_download=True) to refresh.
OpenStreetMap for the street network and static attributes, openSenseMap
for the bicycle sensor measurements. Raw data lives in input/ and is
not tracked in the repo.
Network semantics informed by the IIP bikeability pipeline (OSMBicycleInfrastructure, IP-OSeM-Backend), reimplemented in Python on a complete cyclable network.
Work in progress.