Shared Micromobility (GBFS)
1. Overview
Shared micromobility systems—such as docked and dockless bikeshare and e-scooter fleets—publish operational data using the GBFS (General Bikeshare Feed Specification) standard. In an access study, shared micromobility acts as a first-mile, last-mile, or point-to-point mode governed by spatial geofencing rules:
- Service and Boarding Zones: Where a traveler is allowed to pick up a vehicle and start a ride (
ride_start_allowed). - Ride-Through Zones: Where a boarded rider is permitted to travel (
ride_through_allowed) and whether localized speed caps apply (maximum_speed_kph). - Drop-Off Zones: Where a rider is permitted to end a trip and park the vehicle (
ride_end_allowed).
BAMBAM’s bambam-gbfs tool downloads GBFS feeds (supporting v2.2, v2.3, and v3.0), extracts geofencing zones and operational rules, and compiles them into spatial lookup tables that constrain and price micromobility legs during multimodal routing.
2. Setup
1. Download and Process GBFS Feeds (bambam-gbfs)
First, compile the workspace binaries (including bambam-gbfs) and download either a single GBFS endpoint or a batch of feeds from a MobilityData systems.csv catalog into denver_buf/gbfs/:
# Download a single GBFS feed endpoint
./rust/target/release/bambam-gbfs download \
--gbfs-url "https://example-operator.com/gbfs/3.0/gbfs.json" \
--version v3.0 \
--output-directory denver_buf/gbfs \
--overwrite
# Or batch-download from a systems.csv catalog
./rust/target/release/bambam-gbfs batch-download \
--csv-file systems.csv \
--csv-column "Auto-Discovery URL" \
--entry-point gbfs \
--output-directory denver_buf/gbfs \
--parallelism 8 \
--overwrite
This creates three files in denver_buf/gbfs/:
edges-gbfs-geofences-enumerated.txt.gz: WKT polygon geometries for each geofence zone.edges-gbfs-records.csv.gz: Zone attributes (system_id,ride_start_allowed,ride_through_allowed,ride_end_allowed,maximum_speed_kph, and time windows).edges-system-ids.txt.gz: Enumerated operatorsystem_idlist.
2. Configure bambam.toml for GBFS
To add a gbfs mode that rides over the bikeable road network (bike/edges-compass.csv.gz), update denver_buf/bambam.toml:
-
Add
"gbfs"to[label]:[label] type = "multimodal" max_trip_legs = 3 modes = ["walk", "bike", "drive", "gbfs"](Also add
"gbfs"toavailable_modesin each[[search]]block’smultimodaltraversal and constraint models.) -
Append the
gbfsedge list to[graph]and[mapping](reusing thebikenetwork topology and geometries):[graph] edge_list = [ { input_file = "walk/edges-compass.csv.gz" }, { input_file = "bike/edges-compass.csv.gz" }, { input_file = "drive/edges-compass.csv.gz" }, { input_file = "bike/edges-compass.csv.gz" }, ] vertex_list_input_file = "vertices-compass.csv.gz" [mapping] type = "edge" geometry = [ { type = "from_linestrings", geometry_input_file = "walk/edges-geometries-enumerated.txt.gz" }, { type = "from_linestrings", geometry_input_file = "bike/edges-geometries-enumerated.txt.gz" }, { type = "from_linestrings", geometry_input_file = "drive/edges-geometries-enumerated.txt.gz" }, { type = "from_linestrings", geometry_input_file = "bike/edges-geometries-enumerated.txt.gz" }, ] -
Add a
[[search]]block for thegbfsedge list:[[search]] traversal.type = "combined" traversal.models = [ { type = "distance", distance_unit = "miles" }, { type = "gbfs", zone_record_input_file = "gbfs/edges-gbfs-records.csv.gz", zone_geometry_input_file = "gbfs/edges-gbfs-geofences-enumerated.txt.gz", system_ids_input_file = "gbfs/edges-system-ids.txt.gz", default_speed = { speed = 16.0, speed_unit = "kph" } }, { type = "time", time_unit = "minutes" }, { type = "multimodal", this_mode = "gbfs", available_modes = ["walk", "bike", "drive", "gbfs"] }, ] constraint.type = "combined" constraint.models = [ { type = "gbfs", zone_record_input_file = "gbfs/edges-gbfs-records.csv.gz", zone_geometry_input_file = "gbfs/edges-gbfs-geofences-enumerated.txt.gz", system_ids_input_file = "gbfs/edges-system-ids.txt.gz" }, { type = "multimodal", this_mode = "gbfs", available_modes = ["walk", "bike", "drive", "gbfs"] }, ] -
Inject
start_timeand addgbfstotrip_modes:[[plugin.input_plugins]] type = "inject" format = "key_value" write_mode = "overwrite" key = "start_time" value = "2025-09-01T08:00:00Z" [plugin.input_plugins.modes.gbfs] multimodal_label = true max_trip_legs = 3 constraints = [ { type = "mode_time_limit", mode = "walk", max = 10.0, unit = "minutes" }, { type = "allowed_modes", values = ["walk", "gbfs"] }, ]
3. Run BAMBAM
cd denver_buf
../rust/target/release/bambam \
--config-file bambam.toml \
--query-file ../query/denver_extent.json
3. What Happens
- Spatial Geofence Indexing:
- On startup, BAMBAM builds a polygonal R-tree over
gbfs/edges-gbfs-geofences-enumerated.txt.gzlinked to the operator rules ingbfs/edges-gbfs-records.csv.gz.
- On startup, BAMBAM builds a polygonal R-tree over
- Boarding and Geofence Enforcement (
gbfsConstraint & Traversal):- A traveler can begin a trip by walking (
walk) and transition onto thegbfsnetwork only at a vertex that lies inside an active GBFS zone whereride_start_allowed = trueandride_through_allowed = true. - Upon boarding, BAMBAM records the operator’s
system_idin the search state so the rider stays on that operator’s fleet for the duration of the micromobility leg. - As the rider traverses links on the
gbfsnetwork, thegbfsconstraint model verifies that each vertex remains inside a validride_through_allowedzone for that operator. - The
gbfstraversal model sets the link travel speed todefault_speed(e.g., \(16\text{ km/h}\)), capping it atmaximum_speed_kphwhenever the rider passes through a slow-speed geofence zone. - If a zone has
ride_end_allowed = false(a no-parking zone), the rider can pass through it, but BAMBAM marks those vertices as invalid destinations for ending the micromobility leg.
- A traveler can begin a trip by walking (
- Output Aggregation:
- Valid destinations reached via
walk+gbfswithin 10, 20, 30, and 40 minutes are aggregated into isochrones and opportunity counts inresult.csvandresult.json.
- Valid destinations reached via