{"record":{"id":"ad026026dc6b7ce1","repo":"a-b-street/abstreet","slug":"couldn-t-find-a-lane-for-next-to-sidewalk","errorCode":null,"errorMessage":"Couldn't find a lane for {:?} next to sidewalk {}","messagePattern":"Couldn't find a lane for (.+?) next to sidewalk (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_model/src/make/transit.rs","lineNumber":88,"sourceCode":"                road,\n                idx: map.get_r(road).transit_stops.len(),\n            };\n            map.mut_road(road).transit_stops.insert(id);\n            map.transit_stops.insert(\n                id,\n                TransitStop {\n                    id,\n                    name: stop.name.clone(),\n                    gtfs_id: stop.gtfs_id.clone(),\n                    driving_pos,\n                    sidewalk_pos: *sidewalk_pos,\n                    is_train_stop: vehicle == PathConstraints::Train,\n                },\n            );\n            gtfs_to_stop_id.insert(stop.gtfs_id.clone(), id);\n            Ok(())\n        } else {\n            bail!(\n                \"Couldn't find a lane for {:?} next to sidewalk {}\",\n                vehicle,\n                sidewalk_lane\n            );\n        }\n    } else {\n        bail!(\"Stop position {} wasn't close to a sidewalk\", stop.position);\n    }\n}\n\nstruct BorderSnapper {\n    bus_incoming_borders: FindClosest<LaneID>,\n    bus_outgoing_borders: FindClosest<LaneID>,\n    train_incoming_borders: FindClosest<LaneID>,\n    train_outgoing_borders: FindClosest<LaneID>,\n}\n\nimpl BorderSnapper {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_model/src/make/transit.rs#L70-L106","documentation":"When creating a transit stop, the GTFS position was snapped to a sidewalk, but no driving (or train) lane adjacent to that sidewalk could accommodate the vehicle type. create_stop bails because the stop needs a drivable lane next to the sidewalk to place a driving_pos.","triggerScenarios":"finalize_transit -> create_stop where sidewalk_lane has no adjacent lane matching the vehicle's PathConstraints (e.g. a bus stop snapped to a sidewalk next to a footpath-only road, or a train stop with no adjacent rail lane).","commonSituations":"GTFS bus routes whose stop coordinates fall near sidewalks on pedestrian-only streets; bus stops on service roads with no driving lanes; train stops where the snapped sidewalk isn't next to rail lanes.","solutions":["Check the GTFS stop coordinates and adjust them to lie near a road with a driving lane.","Increase or adjust the sidewalk snap threshold / lane-search parameters in transit import so a valid lane is found.","Skip the problematic stop (edit GTFS input) or verify the map's lanes near that stop allow the vehicle type."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let ok = map.get_l(sidewalk_lane).road.get_lanes(map).iter().any(|l|\n    vehicle.can_use(l, map));\nif !ok { /* skip or relocate the stop before calling create_stop */ }","typeGuard":null,"tryCatchPattern":"match create_stop(map, stop, vehicle) {\n    Ok(id) => ..., \n    Err(e) if e.to_string().contains(\"Couldn't find a lane\") => {\n        warn!(\"skipping GTFS stop {:?}\", stop.gtfs_id);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Validate GTFS stop coordinates against roads with matching lane types before import","Ensure bus stops snap to sidewalks adjacent to driving lanes","Filter GTFS feeds to the imported map area"],"tags":["transit","gtfs","map-import"],"backgroundTag":"resource-not-found","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}