pub fn changed_lanes(&self, map: &Map) -> (BTreeSet<LaneID>, BTreeSet<RoadID>) {
        let mut lanes = BTreeSet::new();
        let mut roads = BTreeSet::new();
        for r in &self.changed_roads {
            let r = map.get_r(*r);
            let orig = EditRoad::get_orig_from_osm(r, map.get_config());
            // What exactly changed?
            if r.speed_limit != orig.speed_limit
                || r.access_restrictions != orig.access_restrictions
            {
                roads.insert(r.id);
            } else {
                let lanes_ltr = r.lanes_ltr();
                if lanes_ltr.len() != orig.lanes_ltr.len() {
                    // If a lane was added or deleted, figuring out if any were modified is kind of
                    // unclear -- just mark the entire road.
                    roads.insert(r.id);
                } else {
                    for ((l, dir, lt), spec) in lanes_ltr.into_iter().zip(orig.lanes_ltr.iter()) {
                        if dir != spec.dir || lt != spec.lt || map.get_l(l).width != spec.width {
                            lanes.insert(l);
                        }
                    }
                }
            }
        }
        (lanes, roads)
    }
/// Pick apart changed_roads and figure out if an entire road was edited, or just a few lanes.
/// Doesn't return deleted lanes.
Pick apart changed_roads and figure out if an entire road was edited, or just a few lanes.
Doesn't return deleted lanes.
Pick apart changed_roads and figure out if an entire road was edited or just a few lanes . Doesn ' t return deleted lanes .
pub fn changed_lanes(&self, map: &Map) -> (BTreeSet<LaneID>, BTreeSet<RoadID>) {
        let mut lanes = BTreeSet::new();
        let mut roads = BTreeSet::new();
        for r in &self.changed_roads {
            let r = map.get_r(*r);
            let orig = EditRoad::get_orig_from_osm(r, map.get_config());
            // What exactly changed?
            if r.speed_limit != orig.speed_limit
                || r.access_restrictions != orig.access_restrictions
            {
                roads.insert(r.id);
            } else {
                let lanes_ltr = r.lanes_ltr();
                if lanes_ltr.len() != orig.lanes_ltr.len() {
                    // If a lane was added or deleted, figuring out if any were modified is kind of
                    // unclear -- just mark the entire road.
                    roads.insert(r.id);
                } else {
                    for ((l, dir, lt), spec) in lanes_ltr.into_iter().zip(orig.lanes_ltr.iter()) {
                        if dir != spec.dir || lt != spec.lt || map.get_l(l).width != spec.width {
                            lanes.insert(l);
                        }
                    }
                }
            }
        }
        (lanes, roads)
    }
pub fn changed_lanes ( & self , map : & Map ) -> ( BTreeSet < LaneID > , BTreeSet < RoadID > ) { let mut lanes = BTreeSet :: new ( ) ; let mut roads = BTreeSet :: new ( ) ; for r in & self . changed_roads { let r = map . get_r ( * r ) ; let orig = EditRoad :: get_orig_from_osm ( r , map . get_config ( ) ) ; // What exactly changed? if r . speed_limit != orig . speed_limit || r . access_restrictions != orig . access_restrictions { roads . insert ( r . id ) ; } else { let lanes_ltr = r . lanes_ltr ( ) ; if lanes_ltr . len ( ) != orig . lanes_ltr . len ( ) { // If a lane was added or deleted, figuring out if any were modified is kind of // unclear -- just mark the entire road. roads . insert ( r . id ) ; } else { for ( ( l , dir , lt ) , spec ) in lanes_ltr . into_iter ( ) . zip ( orig . lanes_ltr . iter ( ) ) { if dir != spec . dir || lt != spec . lt || map . get_l ( l ) . width != spec . width { lanes . insert ( l ) ; } } } } } ( lanes , roads ) }
Pick apart changed_roads and figure out if an entire road was edited, or just a few lanes.
Pick apart changed_roads and figure out if an entire road was edited or just a few lanes .
&self
map
&Map