pub fn collapse(raw: &mut RawMap) {
    let mut merge: Vec<NodeID> = Vec::new();
    for id in raw.intersections.keys() {
        let roads = raw.roads_per_intersection(*id);
        if roads.len() == 2 && roads.iter().all(|r| is_cycleway(&raw.roads[r], raw)) {
            merge.push(*id);
        }
    }

    for i in merge {
        collapse_intersection(raw, i);
    }

    // It's possible we need to do this in a fixed-point until there are no changes, but meh.
    // Results look good so far.
}
/// Collapse degenerate intersections between two cycleways.
Collapse degenerate intersections between two cycleways.
Collapse degenerate intersections between two cycleways .
pub fn collapse(raw: &mut RawMap) {
    let mut merge: Vec<NodeID> = Vec::new();
    for id in raw.intersections.keys() {
        let roads = raw.roads_per_intersection(*id);
        if roads.len() == 2 && roads.iter().all(|r| is_cycleway(&raw.roads[r], raw)) {
            merge.push(*id);
        }
    }
    for i in merge {
        collapse_intersection(raw, i);
    }
    // It's possible we need to do this in a fixed-point until there are no changes, but meh.
    // Results look good so far.
}
pub fn collapse ( raw : & mut RawMap ) { let mut merge : Vec < NodeID > = Vec :: new ( ) ; for id in raw . intersections . keys ( ) { let roads = raw . roads_per_intersection ( * id ) ; if roads . len ( ) == 2 && roads . iter ( ) . all ( | r | is_cycleway ( & raw . roads [ r ] , raw ) ) { merge . push ( * id ) ; } } for i in merge { collapse_intersection ( raw , i ) ; } // It's possible we need to do this in a fixed-point until there are no changes, but meh. // Results look good so far. }
Collapse degenerate intersections between two cycleways.
Collapse degenerate intersections between two cycleways .
raw
&mut RawMap