{"record":{"id":"49de8f8c212ffc60","repo":"a-b-street/abstreet","slug":"snapped-to-sidewalk-but-no-driving-connection","errorCode":null,"errorMessage":"snapped to sidewalk {}, but no driving connection","messagePattern":"snapped to sidewalk (.+?), but no driving connection","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"map_model/src/make/parking_lots.rs","lineNumber":172,"sourceCode":"    if let Some(driving_pos) = map\n        .get_parent(sidewalk_lane)\n        .find_closest_lane(sidewalk_lane, |l| PathConstraints::Car.can_use(l, map))\n        .and_then(|l| {\n            sidewalk_pos\n                .equiv_pos(l, map)\n                .buffer_dist(driveway_buffer, map)\n        })\n    {\n        if let Ok(pl) = PolyLine::new(vec![\n            sidewalk_line.pt1(),\n            sidewalk_line.pt2(),\n            driving_pos.pt(map),\n        ]) {\n            driveway = Some((pl, driving_pos));\n        }\n    }\n    let (driveway_line, driving_pos) = driveway.ok_or_else(|| {\n        anyhow!(\n            \"snapped to sidewalk {}, but no driving connection\",\n            sidewalk_pos.lane()\n        )\n    })?;\n    Ok((driveway_line, driving_pos, sidewalk_line, *sidewalk_pos))\n}\n\nfn infer_spots(lot_polygon: &Polygon, aisles: &[Vec<Pt2D>]) -> Vec<(Pt2D, Angle)> {\n    let mut spots = Vec::new();\n    let mut finalized_lines = Vec::new();\n\n    for aisle in aisles {\n        let aisle_thickness = NORMAL_LANE_THICKNESS / 2.0;\n        let pl = PolyLine::unchecked_new(aisle.clone());\n\n        for rotate in [90.0, -90.0] {\n            // Blindly generate all of the lines\n            let lines = {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_model/src/make/parking_lots.rs#L154-L190","documentation":"After snapping the parking lot center to a sidewalk point, snap_driveway tries to build a drivable polyline from the lot to a road/driving position. If every candidate path fails to map to a driving connection, the Ok value is None and this error is thrown naming the sidewalk lane. The sidewalk snap succeeded, but a car-accessible driveway could not be routed.","triggerScenarios":"Calling make_all_parking_lots or fix_parking_lot_driveways where the trim_path / path-to-driving-lane construction returns None for all candidates — e.g. the snapped sidewalk's nearest driving lane is unreachable or geometry construction (PolyLine::new) fails.","commonSituations":"Lots whose snapped sidewalk is on a road with no driving lanes (pedestrian-only streets); disconnected road graphs after import; one-way or service-road configurations that leave the snapped lane without a drivable link.","solutions":["Check that the sidewalk's adjacent road has driving lanes in the imported map","Relax or retry with alternative candidate driving positions instead of requiring one polyline","Skip the lot with a warning instead of erroring the whole import","Re-import the map verifying the road network around the lot is connected"],"exampleFix":"// before\nlet (driveway_line, driving_pos) = driveway.ok_or_else(|| anyhow!(\"snapped to sidewalk {}, but no driving connection\", sidewalk_pos.lane()))?;\n// after\nlet (driveway_line, driving_pos) = match driveway {\n    Some(v) => v,\n    None => {\n        warn!(\"lot snapped to {} but no driving connection; skipping\", sidewalk_pos.lane());\n        return Ok(None);\n    }\n};","handlingStrategy":"fallback","validationCode":"// confirm the snapped sidewalk's road has driving lanes\nlet road = map.get_parent(sidewalk_pos.lane());\nif !road.lanes.iter().any(|l| l.lt == LaneType::Driving) {\n    warn!(\"sidewalk lane {} has no driving lanes\", sidewalk_pos.lane());\n}","typeGuard":null,"tryCatchPattern":"match snap_driveway(...) { Err(e) if e.to_string().starts_with(\"snapped to sidewalk\") => { warn!(\"no driveway: {}\", e); Ok(None) }, r => r }","preventionTips":["Check the road graph around lots is connected before import","Handle pedestrian-only fronting roads explicitly","Collect and report all failing lots instead of failing the batch","Rebuild the map after road-network edits before re-importing lots"],"tags":["gis","map-import","routing","driveway"],"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"}