Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widening roads #597

Closed
dabreegster opened this issue Apr 8, 2021 · 3 comments
Closed

Widening roads #597

dabreegster opened this issue Apr 8, 2021 · 3 comments

Comments

@dabreegster
Copy link
Collaborator

Splitting out from #67 -- indeed the case of totally new roads is more complicated. First we'll just handle being able to change the total number of lanes in a road (often by converting one wide driving lane to two narrower cycle lanes, for example) and change individual lane widths.

All the notes in #67 still apply, but now that pathfinding is no longer a blocker, the next things I'm thinking about:

  • Adding a debug UI to edit all the lanes in a road by a string (like spd|dbs for [sidewalk, parking, driving, driving, bike, sidewalk]`). Yuwen is starting design work on a proper editing UI too.
  • The first steps to apply these edits... intersection geometry has to be recalculated, and that means recalculating draw_all_unzoomed_roads_and_intersections. We do that when we swap day/night colors, so I'm not as worried about it being slow.
  • Main uncertainty is about LaneIDs. Before, they're a fixed-size list. Now we can delete/add arbitrarily. Should we have Vec<Option<Lane>> and re-use old IDs when possible? This is a common problem in the Rust gaming world, and entity component systems all have a way of handling it. We're not going to pull in an entire ECS, but I'll look at how they internally manage these collections. I know slotmap is one common approach.
dabreegster added a commit that referenced this issue Apr 8, 2021
… road. #597

It crashes when actually trying to change the number of lanes, as
expected.
dabreegster added a commit that referenced this issue Apr 8, 2021
adding/deleting lanes. #597

Not regenerating all maps yet. Haven't evaluated performance impact yet.
dabreegster added a commit that referenced this issue Apr 9, 2021
… road. #597

It crashes when actually trying to change the number of lanes, as
expected.
dabreegster added a commit that referenced this issue Apr 9, 2021
adding/deleting lanes. #597

Not regenerating all maps yet. Haven't evaluated performance impact yet.
dabreegster added a commit that referenced this issue Apr 9, 2021
And in fact, unify the cases of deleting lanes, adding lanes, or just
modifying them in place.
dabreegster added a commit that referenced this issue Apr 9, 2021
dabreegster added a commit that referenced this issue Apr 9, 2021
… road. #597

It crashes when actually trying to change the number of lanes, as
expected.
dabreegster added a commit that referenced this issue Apr 9, 2021
adding/deleting lanes. #597

Not regenerating all maps yet. Haven't evaluated performance impact yet.
dabreegster added a commit that referenced this issue Apr 9, 2021
And in fact, unify the cases of deleting lanes, adding lanes, or just
modifying them in place.
dabreegster added a commit that referenced this issue Apr 9, 2021
dabreegster added a commit that referenced this issue Apr 9, 2021
dabreegster added a commit that referenced this issue Apr 10, 2021
dabreegster added a commit that referenced this issue Apr 12, 2021
Don't redraw the paths yet, or try to deal with failures to snap.
dabreegster added a commit that referenced this issue Apr 13, 2021
Don't redraw the paths yet, or try to deal with failures to snap.
dabreegster added a commit that referenced this issue Apr 13, 2021
Don't redraw the paths yet, or try to deal with failures to snap.
@dabreegster
Copy link
Collaborator Author

Just preserving some notes/ideas:

  • Even before we overhaul public transit, prevent edits near bus stops from crashing
  • Make Road store lanes_ltr: Vec<(LaneID, LaneSpec)> and refactor things like get_half_width
  • Prevent changing the number of lanes near borders? Think through what scenarios assume can be done there. (Or maybe some trips just start failing)
  • Consider a dramatic cleanup: just treat lanes as a view onto roads. LaneID becomes RoadID and an offset. The Lane struct all but goes away; instead map.get_l just returns something that has a reference to Road and the ability to shift center points over

dabreegster added a commit that referenced this issue Apr 17, 2021
…finding layer. #597

Tested by adding a sidewalk to 28th and Madison in the Arboretum map.
Not regenerating maps yet.
dabreegster added a commit that referenced this issue May 21, 2021
selector into debug mode. #597

Previously, it was used both to search/replace lane types and to
select roads, then dump them in various formats. Just preserve the
latter behavior.
dabreegster added a commit that referenced this issue May 21, 2021
The design in Figma treats it like a dropdown, but I think we still need
the dedicated UI to draw the bounds of the access-restricted zone.
dabreegster added a commit that referenced this issue May 21, 2021
dabreegster added a commit that referenced this issue May 21, 2021
…w, every modification to a road will touch LaneIDs. #597

This is safe to do, now that the two callers (the old lane editor, and
the old bulk lane type switcher) are gone.
dabreegster added a commit that referenced this issue May 21, 2021
for adding new lanes, but not changing existing lanes. #597
dabreegster added a commit that referenced this issue May 21, 2021
…s otherwise. #597

The enforcement is a bit more invasive, because there's a few ways of
getting into a bad state.
dabreegster added a commit that referenced this issue May 21, 2021
selector into debug mode. #597

Previously, it was used both to search/replace lane types and to
select roads, then dump them in various formats. Just preserve the
latter behavior.
dabreegster added a commit that referenced this issue May 21, 2021
The design in Figma treats it like a dropdown, but I think we still need
the dedicated UI to draw the bounds of the access-restricted zone.
dabreegster added a commit that referenced this issue May 21, 2021
dabreegster added a commit that referenced this issue May 21, 2021
…w, every modification to a road will touch LaneIDs. #597

This is safe to do, now that the two callers (the old lane editor, and
the old bulk lane type switcher) are gone.
dabreegster added a commit that referenced this issue May 21, 2021
for adding new lanes, but not changing existing lanes. #597
dabreegster added a commit that referenced this issue May 21, 2021
…s otherwise. #597

The enforcement is a bit more invasive, because there's a few ways of
getting into a bad state.
dabreegster added a commit that referenced this issue May 23, 2021
dabreegster added a commit that referenced this issue Jun 20, 2021
…crashes if the selected lane gets deleted or assigned a new ID. Fixes a crash trying to make the West Green Lake cycletrack. #597
dabreegster added a commit that referenced this issue Jun 20, 2021
…imit. The Aurora cycletrack edit stopped matching because the speed limit happens to change along Aurora. We can think through a better UX to handle both, but I suspect most use cases will focus on lane configuration. #597
dabreegster added a commit that referenced this issue Jun 20, 2021
…to compare the old version of the road in the edits with the basemap, NOT the edited version of the road. #597
dabreegster added a commit that referenced this issue Jul 16, 2021
Allow sidewalks, shoulders, and center turn lanes to be edited now.
Still don't touch service roads or light rail.
@dabreegster
Copy link
Collaborator Author

Screenshot from 2021-09-30 13-56-23
UX issue. When editing a road with only one or two lanes, the two lane cards stretch out quite a bit. They're still proportional to the lane width, but the cards just look odd being so stretched out.

@dabreegster
Copy link
Collaborator Author

New road editor has been live for ages, nothing actionable here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant