handle some rendering failures, getting new orleans to load
@@ -200,20 +200,26 @@ pub fn calculate_corners(i: &Intersection, map: &Map) -> Vec<Polygon> {
let l1 = map.get_l(turn.id.src);
let l2 = map.get_l(turn.id.dst);
+ if let Some(poly) = (|| {
let mut pts = map
- .must_left_shift(turn.geom.clone(), width / 2.0)
+ .left_shift(turn.geom.clone(), width / 2.0)
+ .ok()?
.into_points();
pts.push(map.left_shift_line(l2.first_line(), width / 2.0).pt1());
pts.push(map.right_shift_line(l2.first_line(), width / 2.0).pt1());
pts.extend(
- map.must_right_shift(turn.geom.clone(), width / 2.0)
+ map.right_shift(turn.geom.clone(), width / 2.0)
+ .ok()?
.reversed()
.into_points(),
);
pts.push(map.right_shift_line(l1.last_line(), width / 2.0).pt2());
pts.push(map.left_shift_line(l1.last_line(), width / 2.0).pt2());
pts.push(pts[0]);
- corners.push(Polygon::buggy_new(pts));
+ Some(Polygon::buggy_new(pts))
+ })() {
+ corners.push(poly);
+ }
}
}
