solid yellow lines for oneways. dashed looks really strange with offside parking.

This commit is contained in:
Dustin Carlino 2019-10-18 15:08:30 -07:00
parent 96a38b98b1
commit b4b4e8fae8
5 changed files with 41 additions and 22 deletions

View File

@ -1,12 +1,12 @@
6a5f5047a0f61a78c36fcd7260a4a506 ../data/screenshots/pending_montlake/01x01_i53.png 6a5f5047a0f61a78c36fcd7260a4a506 ../data/screenshots/pending_montlake/01x01_i53.png
5f1e0f5fbbf4f21def99e7ad3a46abc9 ../data/screenshots/pending_montlake/02x01_i1.png d258d93c657eb3c11abee051ef83b12f ../data/screenshots/pending_montlake/02x01_i1.png
0193d5553b12e858c60e1137d180d0e2 ../data/screenshots/pending_montlake/03x01_i0.png d2c1635654022caf3e39bc9732f47a25 ../data/screenshots/pending_montlake/03x01_i0.png
0005646cbeeb6734658e88aad5e6ee8a ../data/screenshots/pending_montlake/01x02_i7.png b6e8837586f8658ec7154ac44aed92b5 ../data/screenshots/pending_montlake/01x02_i7.png
038c929b5f6c3f9f0abcd8303490a439 ../data/screenshots/pending_montlake/02x02_i126.png 4bd77b889539e91216c39917610091fe ../data/screenshots/pending_montlake/02x02_i126.png
e959cf875d432abac114c60f5bb81083 ../data/screenshots/pending_montlake/03x02_i31.png bc2ce9535f1a54828afa6478174bc197 ../data/screenshots/pending_montlake/03x02_i31.png
55e64d410ee8d71d2c25a991ad498793 ../data/screenshots/pending_montlake/01x03_i97.png 0290b6304e5a54b7fbef6ce73864ec6c ../data/screenshots/pending_montlake/01x03_i97.png
efea195b9f824508cd3a7fab797151a7 ../data/screenshots/pending_montlake/02x03_i5.png 062d30aed46ab62e45177ea95b928ea1 ../data/screenshots/pending_montlake/02x03_i5.png
9ac4e293a05010def2886a75d2d3eb87 ../data/screenshots/pending_montlake/03x03_i14.png 532736616cc95e3a9e1f31e8f975ae00 ../data/screenshots/pending_montlake/03x03_i14.png
9a2783cb96807499dc442e7420bd5a7a ../data/screenshots/pending_montlake/01x04_i3.png 9a2783cb96807499dc442e7420bd5a7a ../data/screenshots/pending_montlake/01x04_i3.png
1d8b15e910503a1b3a5a3f59f666e0da ../data/screenshots/pending_montlake/02x04_i27.png 1d8b15e910503a1b3a5a3f59f666e0da ../data/screenshots/pending_montlake/02x04_i27.png
6d02434823cb264aa25061bbc4dc11c8 ../data/screenshots/pending_montlake/03x04_i13.png 6d02434823cb264aa25061bbc4dc11c8 ../data/screenshots/pending_montlake/03x04_i13.png
@ -14,8 +14,8 @@ e151526f03a9ecf3d671c60255e21300 ../data/screenshots/pending_montlake/01x05_i42
e082dc174f2fb301828ce1fbab598c78 ../data/screenshots/pending_montlake/02x05_i41.png e082dc174f2fb301828ce1fbab598c78 ../data/screenshots/pending_montlake/02x05_i41.png
e49068d8e47a7766ff1ea574bb96fcee ../data/screenshots/pending_montlake/03x05_i21.png e49068d8e47a7766ff1ea574bb96fcee ../data/screenshots/pending_montlake/03x05_i21.png
15da92a39d014bfe581743cb3a5fc8e9 ../data/screenshots/pending_montlake/01x06_i11.png 15da92a39d014bfe581743cb3a5fc8e9 ../data/screenshots/pending_montlake/01x06_i11.png
b3d8fd887c78408d4820ebc77ab80008 ../data/screenshots/pending_montlake/02x06_i9.png effddd20a6327d669d59de06641c300b ../data/screenshots/pending_montlake/02x06_i9.png
828e3def1e4c41452b9717b4bac07343 ../data/screenshots/pending_montlake/03x06_i17.png 828e3def1e4c41452b9717b4bac07343 ../data/screenshots/pending_montlake/03x06_i17.png
981c0c3380efaa12d68a6c331baee989 ../data/screenshots/pending_montlake/01x07_i104.png bbebebbb12dfb2401a26ef3303b32b41 ../data/screenshots/pending_montlake/01x07_i104.png
3fe6024412700dfb7937b3ea771bbded ../data/screenshots/pending_montlake/02x07_i19.png 6fe3baed6c90dcd1a779d20d66cf6050 ../data/screenshots/pending_montlake/02x07_i19.png
c28f6208b4b08d00b77b8597666faeca ../data/screenshots/pending_montlake/03x07_i18.png c28f6208b4b08d00b77b8597666faeca ../data/screenshots/pending_montlake/03x07_i18.png

View File

@ -29,7 +29,9 @@ There are Seattleisms baked into the code.
- `import.sh` should be generalized. - `import.sh` should be generalized.
- The driving side of the road is hard-coded to the right. Look for "driving on - The driving side of the road is hard-coded to the right. Look for "driving on
the left" in `map_model/src/make/half_map.rs`. the left" in `map_model/src/make/half_map.rs`.
- On-street parking is inferred from a dataset specific to King County GIS. If - On-street parking is mostly not mapped in Seattle. Ideally you should fill out
your city has this information elsewhere, it should be easy to import. https://wiki.openstreetmap.org/wiki/Key:parking:lane for your city. I'm
inferring these tags for most roads based on a King County GIS-specific
dataset.
- Demand data to generate a realistic set of trips comes from an agency specific - Demand data to generate a realistic set of trips comes from an agency specific
to the Puget Sound, but again, importing this from other sources isn't hard. to the Puget Sound, but again, importing this from other sources isn't hard.

View File

@ -206,7 +206,12 @@ fn calculate_driving_lines(lane: &Lane, parent: &Road, timer: &mut Timer) -> Vec
.lane_center_pts .lane_center_pts
.shift_left(LANE_THICKNESS / 2.0) .shift_left(LANE_THICKNESS / 2.0)
.get(timer); .get(timer);
dashed_lines(&lane_edge_pts, Distance::meters(1.0), Distance::meters(1.5)) dashed_lines(
&lane_edge_pts,
Distance::meters(0.25),
Distance::meters(1.0),
Distance::meters(1.5),
)
} }
fn calculate_turn_markings(map: &Map, lane: &Lane, timer: &mut Timer) -> Vec<Polygon> { fn calculate_turn_markings(map: &Map, lane: &Lane, timer: &mut Timer) -> Vec<Polygon> {

View File

@ -76,9 +76,12 @@ pub fn draw_vehicle(
} }
} }
pub fn dashed_lines(pl: &PolyLine, dash_len: Distance, dash_separation: Distance) -> Vec<Polygon> { pub fn dashed_lines(
let width = Distance::meters(0.25); pl: &PolyLine,
width: Distance,
dash_len: Distance,
dash_separation: Distance,
) -> Vec<Polygon> {
if pl.length() < dash_separation * 2.0 + EPSILON_DIST { if pl.length() < dash_separation * 2.0 + EPSILON_DIST {
return vec![pl.make_polygons(width)]; return vec![pl.make_polygons(width)];
} }

View File

@ -2,7 +2,7 @@ use crate::helpers::{ColorScheme, ID};
use crate::render::{dashed_lines, DrawCtx, DrawOptions, Renderable, OUTLINE_THICKNESS}; use crate::render::{dashed_lines, DrawCtx, DrawOptions, Renderable, OUTLINE_THICKNESS};
use ezgui::{Color, Drawable, GeomBatch, GfxCtx, Line, Prerender, Text}; use ezgui::{Color, Drawable, GeomBatch, GfxCtx, Line, Prerender, Text};
use geom::{Distance, Polygon, Pt2D}; use geom::{Distance, Polygon, Pt2D};
use map_model::{Map, Road, RoadID, LANE_THICKNESS}; use map_model::{LaneType, Map, Road, RoadID, LANE_THICKNESS};
pub struct DrawRoad { pub struct DrawRoad {
pub id: RoadID, pub id: RoadID,
@ -26,10 +26,19 @@ impl DrawRoad {
.lane_center_pts .lane_center_pts
.shift_left(LANE_THICKNESS / 2.0) .shift_left(LANE_THICKNESS / 2.0)
.unwrap(); .unwrap();
draw.extend( let width = Distance::meters(0.25);
cs.get_def("road center line", Color::YELLOW), // If the road is a one-way (only parking and sidewalk on the off-side), draw a solid line
dashed_lines(&center, Distance::meters(2.0), Distance::meters(1.0)), if r.children_backwards
); .iter()
.all(|(_, lt)| *lt == LaneType::Parking || *lt == LaneType::Sidewalk)
{
draw.push(cs.get("road center line"), center.make_polygons(width));
} else {
draw.extend(
cs.get_def("road center line", Color::YELLOW),
dashed_lines(&center, width, Distance::meters(2.0), Distance::meters(1.0)),
);
}
let mut label = Text::new(); let mut label = Text::new();
label.add(Line(r.get_name()).size(50)); label.add(Line(r.get_name()).size(50));