Commit Graph

1619 Commits

Author SHA1 Message Date
Dustin Carlino
d365213948 Small refactor: {road, lane}.length() 2021-09-26 11:08:44 -07:00
Dustin Carlino
0e869b35c0 Detect some rat runs 2021-09-24 15:28:43 -07:00
easbar
0a7670d874 Update fast_paths to current master, faster preparation 2021-09-13 10:53:14 -07:00
Dustin Carlino
b7d010058c Store Movements per Intersection, instead of constantly calculating them! #746
Regenerating everything...
2021-09-06 14:53:37 -07:00
Dustin Carlino
6dcf417cd0 Fix some clippy warnings, and now regenerate everything...
Green Lake sim crashes, not investigating.

[rebuild] [release]
2021-09-05 19:53:10 -07:00
Dustin Carlino
9300470c6b Lane offset comes for free now 2021-09-05 19:53:10 -07:00
Dustin Carlino
442523ae6c Simplify some lane lookups that just needed to find the parent 2021-09-05 19:53:10 -07:00
Dustin Carlino
112bc38e0c Get rid of the now redundant lanes_ltr 2021-09-05 19:53:10 -07:00
Dustin Carlino
4c46510342 Cleaning up a few APIs, now that lanes belong to roads... 2021-09-05 19:53:10 -07:00
Dustin Carlino
0f4a31e915 Moving lanes from a BTreeMap to be stored inlined in their parent Roads. #746
Somewhat invasive API change internal to map_model, but not much impact
elsewhere.

Not regenerating anything yet.
2021-09-05 19:53:10 -07:00
Dustin Carlino
cea0ad2541 Change LaneID to encode (RoadID, offset), still in one u32. #746
Not regenerating yet.
2021-09-05 19:53:10 -07:00
Dustin Carlino
add42b6f19 When pathfinding with custom routing params (from the debug UI), only rebuild the one graph we need. #746 2021-09-05 17:04:54 -07:00
Dustin Carlino
8c2c0e2e65 Start some new RoutingParams for bikes to avoid steep hills and
stressful roads. Initially experiment in the route debugger UI. #743

This is a binary map format change, but temporarily working around
that...
2021-09-05 17:04:54 -07:00
Dustin Carlino
0ad76921fd Don't crash in map_editor when we encounter overlapping OSM ways; skip that intersection and print loudly. 2021-09-04 10:43:14 -07:00
Dustin Carlino
01877cb576 Remove the experimental sumo import crate from early this year. It causes very slight technical debt (some public Map stuff) and there are no plans to do anything with this. The Sumo XML parser is always here in version control if it becomes interesting again later. 2021-09-01 19:23:13 -07:00
Dustin Carlino
b8d0fd6499 We just need the bike graph. #746 2021-09-01 19:15:07 -07:00
Dustin Carlino
f83168184d Start a tool to compress Map files by removing information unnecessary to the bike network tool. #746
Just a modest start, switching from CHs to Dijkstra's for pathfinding. Not uploading the minified result yet.
2021-09-01 19:02:42 -07:00
Dustin Carlino
1c756befa8 Hover on route, to show elevation on line plot. #743
Some messiness, but step forward.
2021-09-01 18:20:48 -07:00
Dustin Carlino
ba6f9f4a14 When hovering on the elevation line plot, show the equivalent position
on the route. #743
2021-09-01 13:18:30 -07:00
Dustin Carlino
1c9aaac17f Show drop position on the map while dragging lane cards 2021-08-29 16:40:54 -07:00
Dustin Carlino
b14d2d2bbf Rebrand the tool, create new launch scripts for the binary release,
clippy.

[rebuild] [release]
(I'm not done just yet, but want to check the launch scripts)
2021-08-25 16:52:43 -07:00
Dustin Carlino
b2f30fa192 Add some more metrics for a route, related to safety 2021-08-23 19:02:44 -07:00
Dustin Carlino
7e3802a519 Add elevation details to routing results 2021-08-23 18:02:29 -07:00
Dustin Carlino
1d71e39480 Amp up the short service road trimmer -- Aurora's got lots of dangly things to trim.
While we're at it, opt into new fast_paths branch that should have about
a 2x import speedup.

Regenerating the world...
2021-08-21 21:23:35 -07:00
Dustin Carlino
816e125cbe Refactor some stuff related to unit tests for a road's lanes. #635 2021-08-21 15:17:57 -07:00
Dustin Carlino
70c6d47c13 Track locally which proposals have been uploaded, to avoid uploading copies of stuff uselessly. Not quite working, but big step forwards. 2021-08-18 10:23:20 -07:00
Dustin Carlino
90a1d2ff83 Initially launch with edits loaded remotely 2021-08-16 16:00:01 -07:00
Dustin Carlino
5287308f6f Fix broken web build.
- I accidentally enabled something to debug map serialization, which
  broke in wasm -- fast_paths not meant to be serialized there, only
  deserialized.
- makefile for interactive development copied directories slightly wrong

Also picking up a slight UI panel change to the bike network tool from
days ago.

Also probably time to [rebuild] [release]
2021-08-15 09:05:41 -07:00
Dustin Carlino
d392c67c00 Start unit tests for the quick bike sketch tool, to understand how lane transformations work
(And fix bucketize tests, which just haven't been run in a bit)
2021-08-12 09:47:40 -07:00
Dustin Carlino
9b4107f061 Track when a map is edited and update things better, in both the game's edit mode and the new tool. 2021-08-08 09:22:32 -07:00
Dustin Carlino
100b068086 Print map size breakdown more usefully. 2021-08-07 21:57:06 -07:00
Dustin Carlino
51367088df Adding a 'nearby houses and shops' feature to the bike network tool
Results have major issues, probably going to leave this out of v1.
2021-08-06 20:05:04 -07:00
Dustin Carlino
b080c70d83 Sinew is meant to stretch. 2021-08-05 14:06:11 -07:00
Dustin Carlino
c019304ee3 A skeleton emerges, from whatever sort of place skeletons lurk 2021-08-03 19:23:28 -07:00
Dustin Carlino
dcf84d3b10 Rewrite turn restrictions to handle collapsed roads. Lake Wash Blvd / Madison revealed this problem.
Regenerating everything now...
2021-08-03 00:07:49 -07:00
Dustin Carlino
e687dd0391 Automatically collapse more degenerate intersections. Manually tested
around the university bridge. Still far to go, but progress.

Not regenerating yet.
2021-08-02 12:06:47 -07:00
Dustin Carlino
c71c1b91dc Trying to fix corner curbs and failing, but made some maybe useful geom
API additions.

And not drawing curbs for footways. #715
2021-07-31 19:46:37 -07:00
Dustin Carlino
b02b00fe56 Handle more OSM separation tags, and copy over the values for snapping. #330
Not regenerating yet, but NE Campus Pkwy in the udistrict is my test
case.
2021-07-30 13:46:14 -07:00
Dustin Carlino
7592f9ca9e Fix crosswalks & sidewalk corners for consolidated intersections on left-handed maps. #654
Not regenerating yet. (There shouldn't be many junctions tagged on
non-US maps, at least not by me.)
2021-07-30 11:28:56 -07:00
Dustin Carlino
2ae6dea692 Upgrade to rust 1.54, fix new clippy warnings 2021-07-30 09:48:31 -07:00
Dustin Carlino
7fbd8ae022 Next steps on snapping cycleways / modelling separators. #330
- Only snap cycleways with explicitly tagged separators
- When collapsing intersections, preserve the OSM ID of the longer way
2021-07-29 11:24:38 -07:00
Dustin Carlino
1bda9333e2 For the snapping cycleways experiment, always perform the actual
snapping. Emit the KML debug file only when additionally flagged on. Add
more debug info there, to figure out why some paths are totally
disappearing... #330
2021-07-29 09:01:36 -07:00
Dustin Carlino
a4906a2953 More flag-guarded color scheme progress towards #715:
- choosing some building colors
- proper unzoomed road/intersection outlines
- adjusting curb color based on road rank (for arterials, it was the
  same grey!)
2021-07-28 12:12:01 -07:00
Dustin Carlino
d6936c5535 Refine the trimming rules -- insist on short roads, and leave borders alone.
Not regenerating everything yet, but spot-checked downtown where some
things broke previously.
2021-07-28 10:55:47 -07:00
Dustin Carlino
ffcf0a8d66 Fix a bug in transit snapping introduced by 163244ace9. Regenerating all maps, also bringing in a Tempe OSM fix...
The deadend trimming is too enthusiastic, getting rid of some unsnapped
cycleways and things connecting to the map border. Will iterate on it
this week; net benefit for now.
2021-07-27 16:56:11 -07:00
Dustin Carlino
9e68c22d67 Try to collapse degenerate intersections that happen near snapped cyclepaths. #330
The udistrict is shaping up...!
2021-07-27 12:39:44 -07:00
Dustin Carlino
1bde8c5345 Start turning cycle separation OSM tags (https://wiki.openstreetmap.org/wiki/Proposed_features/cycleway:separation) into buffer lanes. Only attempting for cycleways tagged on the road right now, since we're going to be snapping separated ways anyway... #330
And start experimenting with this in the snapper. Quick tests with the
Roosevelt PBL in the udistrict.
2021-07-27 12:12:10 -07:00
Dustin Carlino
4547395067 Move the cycleway snapping step to happen just before RawMap->Map, so we can play with it in the map_editor. #330 2021-07-27 11:20:57 -07:00
Dustin Carlino
163244ace9 Trim dead-end cycleway and service road stubs. Not regenerating yet, but
spot checked in Tempe and the UDistrict.
2021-07-27 11:13:47 -07:00
Dustin Carlino
3e26c6489a Run merging in the map editor, to reproduce the order that'll happen when importing. #654 2021-07-27 09:53:51 -07:00
Dustin Carlino
c5e769d276 Start a very basic binary classifier for high-stress cycling road, with a layer to check it. Use this to filter the mode shift dashboard -- effectively revealing PCT-esque gaps in the infrastructure. #448, #494 2021-07-26 10:48:00 -07:00
Dustin Carlino
06429d0d5f In the mode shift dashboard, show roads that might be highly used by converted trips... but that're missing bike infrastructure. #448 2021-07-26 10:41:51 -07:00
Dustin Carlino
1a8eecb2ac Remove old color scheme experiments. They're no longer interesting and just clutter the codebase, making big changes like #715 harder to manage 2021-07-23 19:20:36 -07:00
Dustin Carlino
b45f9e0134
Create new lane types to express different types of buffers for prote… (#704)
* Create new lane types to express different types of buffers for protected bike lanes. They're only created manually right now, to explore rendering.

* Update planter rendering

* Update planter - simplify

* fmt after merge

* Fixing up existing rendering

* Add curb buffer

* Adjust stripes

Co-authored-by: Robin Lovelace <rob00x@gmail.com>
2021-07-23 11:31:36 -07:00
Dustin Carlino
2538309c76 Automatically look for short roads near traffic signals and opt them into merging! #654
Manually invoked heuristic for the moment, and has some issues, but a
start.
2021-07-21 11:34:04 -07:00
Dustin Carlino
1f4124ee64 Handle clusters of merging short roads in the "interior" of a complex
intersection. This often happens with a group of 4 intersections (two
divided highways), and there may be many small segments embedded in the
middle for street car tracks and such.

Also bring in fresh OSM for Tempe, with one such intersection now
consolidated! #654, #672
2021-07-20 14:22:00 -07:00
Dustin Carlino
c5210e9887 Actually, keep the broken list of ways, to manually run with backtraces 2021-07-20 11:36:53 -07:00
Dustin Carlino
6f549e5747 Debug how roads are being ordered around an intersection, and restore map_editor's ability to preview one intersection with the debugging geometry. #654 2021-07-20 10:08:02 -07:00
Dustin Carlino
d10d8ceb33 Clean up code and regenerate everything with new the consolidation algorithm... #654
Phinney gridlocks again; 68daa6884a was
too ambitious. Otherwise all fine!
2021-07-19 15:07:10 -07:00
Dustin Carlino
c7b6c11e37 Fix the wacky endpoint order for Montlake/520 with a more careful definition of center. 2021-07-19 15:07:10 -07:00
Dustin Carlino
c28fef1752 By the power of my Mammal Hands, I will figure this out. #654 2021-07-19 15:07:10 -07:00
Dustin Carlino
e6f72449f4 Some fixes to get the Arboretum trails connected.
- Grab fresh Seattle OSM, picking up https://www.openstreetmap.org/changeset/108071529
- Treat highway=footway, bicycle=dismount as a cyclepath, for now
- Treat service=driveway, bicycle=designated as a cyclepath

Since this requires regenerating all maps anyway, also include some
stuff to improve Aurora near Green Lake:

- stop making highway lanes super wide by default; they just make
  divided highways overlap themselves
- filter out service roads with access=customers

But note the bridge from the Arboretum to Lynn is still disconnected,
because of detailed footway mapping that isn't tagged as
bike-accessible.
2021-07-18 20:52:41 -07:00
Dustin Carlino
db435cd56d Use the quick fix to https://github.com/easbar/fast_paths/issues/34 to
dramatically improve time to import and edit maps.

The fix helps all maps that use extremely high edge weights to prevent
people from cutting through private roads. There may be a more robust
fast_paths fix later, but I want to reap the benefits for tomorrow's
release.

The dramatic numbers:

- importing huge_seattle: 893s down to 108s
- editing huge_seattle: 102s down to 19s

Query speeds didn't appear to substantially change.
2021-07-17 22:33:01 -07:00
Dustin Carlino
4cfb06da97 Make the Map cloneable, by being careful with the thread-local pathfinder state.
I think this will help simplify calculate_unedited_map. But even if not,
this is bound to come in handy.
2021-07-15 18:34:42 -07:00
Dustin Carlino
062f38aca3 Speed up the previous by caching road_to_buildings in Map. 2021-07-15 18:12:15 -07:00
Dustin Carlino
b3ce53aa5f Draw building driveways per zoomed-in road, rather than as one map-wide batch. Otherwise, every single edit to road width needs to redraw all driveways. This doesn't scale with larger maps!
When zoomed in on just a building but not its road, this means the driveway won't show up until the road is in view. Acceptable trade-off.
2021-07-15 18:05:04 -07:00
Dustin Carlino
10fdaa8e92 estimate_duration already knows the mode, from the PathRequest 2021-07-14 12:38:19 -07:00
Dustin Carlino
03d21c4fe9 A first mode-shift experiment: create a table of trips showing expected
time to drive/bike, the elevation profile, and the distance. #448
2021-07-14 12:17:03 -07:00
Dustin Carlino
9237afb439 Revive cyclepath snapping. #330
Several ways to output the results:

1) just write OSM tags to debug stuff, but keep the ways
2) write a KML file to visualize the perpendicular line checks
3) delete the cycleway and make it an attribute of roads instead

Many problems with the snapping heuristics, but enough progress to
commit disabled!
2021-07-13 15:33:07 -07:00
Dustin Carlino
2224dccda9 Add a tool in the main UI to try to merge junctions. #654
It maintains a JSON file of ways to merge that the importer also uses.
For maps fast to import, this is the nicest workflow. Unlike map_editor,
turns and trimmed roads can also be checked.
2021-07-11 13:19:00 -07:00
Dustin Carlino
843dd38f7e Support multi starts/ends in the Dijkstra pathfinding engine. [rebuild] [release] 2021-07-11 10:11:50 -07:00
Dustin Carlino
7b98dd72e2 Backfill the implementation of all_costs_from. 2021-07-10 17:32:06 -07:00
Dustin Carlino
8be065c1b8 Finally regenerate all data. Trip times got slower, because now pedestrians can't zoom up one side of a steep hill.
Temporarily leaving all_costs_from as the only thing broken by the
refactor. Will fix it before the release tomorrow.
2021-07-10 17:14:10 -07:00
Dustin Carlino
6128ab5ed5 Fix an issue with init order and transit::make_stops_and_routes 2021-07-10 17:14:10 -07:00
Dustin Carlino
0edc0cb279 Fix the Dijkstra pathfinding, by using DiGraph, which is serializable 2021-07-10 17:14:10 -07:00
Dustin Carlino
2d16f5d878 Get the crazy pathfinding revamp to work
- initialization order
- reusing node ordering and applying edits

Importing, editing the map, and the basic scenario seem OK! --skip_ch
breaks, because of the lack of serialization
2021-07-10 17:14:10 -07:00
Dustin Carlino
c5369a10f4 Invert the structure of CH-vs-dijkstra pathfinding. Use a generic
"engine" that just operates on raw usize IDs. Embed that enum in each of
the particular pathfinders. This way, we don't have to keep duplicating
logic to delegate requests, handle one-step edge cases, etc. And it also
sets us up to more easily try out other CH implementations like osm_ch,
without having to move around tons of code.

Still use fast_path's InputGraph as the "universal" format, for now.

This is a huge change... got map_model compiling at least. Some stubbed
out stuff.
2021-07-10 17:14:10 -07:00
Dustin Carlino
74500a24dd Refactor pedestrian pathfinding, sharing input graphs between CH/dijkstra 2021-07-10 17:14:10 -07:00
Dustin Carlino
830c683009 Refactor vehicle pathfinding. Share input graphs between CH/dijkstra
impl.
2021-07-10 17:14:10 -07:00
Dustin Carlino
fe64501e6d Fix pedestrian speeds on inclines. Those walking contraflow on a
sidewalk were using the wrong incline!

Not regenerating data yet (need to regenerate all maps)
2021-07-10 17:14:10 -07:00
Dustin Carlino
da704b4546 Extend the parking thought bubbles to handle people climbing steep hills.
(And some clippy fixes)
2021-07-10 17:14:10 -07:00
Dustin Carlino
4aa971e34e Add a new importer mode to do Raw->Map in parallel. Occasionally useful
now that my faster machine works again.

Running importer jobs in parallel is actually super hard, because
there's async stuff thrown in there now to download files.
2021-07-06 16:21:42 -07:00
Dustin Carlino
964cc23df8 Improve 3-way signal timing by explicitly specifying crosswalks. This
fixes a very dramatic problem in the Green Lake map.

Regenerating everything...

Also added total trip time to the prebaked summary, to get a quick sense
if a change net helps or hurts and have a record in version control.
2021-07-06 14:37:50 -07:00
Dustin Carlino
f37e71236f Some fixups to the regenerated data from the past two commits:
- handle when the equiv_pos of a driveway gets too close to the edge of
  another lane
- make the updater workflow handle files from S3 that're a bit older
- remove pathfinding_avoiding_roads
- strip out old vehicle capping from map edit JSON, then fix up
  proposals
- delete old capping API example
- temporarily give up on phinney; it starts gridlocking
- add broadmoor proposal link in-game
2021-07-05 17:51:40 -07:00
Dustin Carlino
a0dcc255c3 Rip out all congestion capping code. #325
This collaboration is abandoned, the code slows down refactoring, and
if we started this idea again today, it'd be better to do it from
scratch anyway.

Regenerating everything.
2021-07-05 11:15:31 -07:00
Dustin Carlino
4d4cbdf525 Fix equiv_pos. Tested visually on curvy roads and by watching cars slide
into/out of parallel parking.

Not regenerating anything yet...
2021-07-05 11:02:27 -07:00
Dustin Carlino
6039063d28 Add a debug tool to dump JSON for different objects and open up with an external viewer. [rebuild] [release]
And fix some clippy problems
2021-07-04 15:32:49 -07:00
Dustin Carlino
382d890ac6 Switch to updated fast_paths 2021-07-04 14:34:20 -07:00
Dustin Carlino
0211094689 Create static blockages for off-side driveway exits. Verified correct
for all combinations of on/off-side exits and cutting across lanes by
using the static blockage visualizer.
2021-07-04 14:34:20 -07:00
Dustin Carlino
95ffa62218 Fix the unparking position. When we exit a driveway in EITHER direction,
we need to adjust the start position to account for the vehicle's
length.

Also add a very convenient debug tool to understand positions along
lanes.

This probably breaks static blockages; I'll check into that next.
2021-07-04 14:34:20 -07:00
Dustin Carlino
57feeada59 Allow vehicles to exit driveways onto the opposite side of the road. #555
- Adding an internal alt_start to PathRequest
- Using it for contraction hierarchy queries only (the Dijkstra
  implementation now diverges!)
- Figuring out which start position was used

TODO:

- Fix the unparking position
- Make sure the simulation inserts static blockages
- Carefully check the same start/end road case
- Evaluate impact on gridlock / cancelled trips
2021-07-04 14:34:20 -07:00
Dustin Carlino
efaf6085e4 Prepare for exiting driveways on the off-side by switching to
specialized PathRequest constructors
2021-06-30 12:35:22 -07:00
Dustin Carlino
137e9a0c2c Fix up some places affected by the f64 serialization:
- offstreet_parking_length in importer config
- backwards compatibility for map edits
- fixing up the baked-in proposals
- working around a few PolyLine bugs that happen with the new rounding
- Don't regenerate actdev scenarios yet -- the upstream JSON format is
  out of date, will have to fix separately.
2021-06-30 06:35:42 -07:00
Dustin Carlino
f57278e9cd Enable the new walking turn algorithm for consolidated intersections
only. It has much simpler logic and produces correct results for these
intersections, but it has degradations in some cases -- so limit where
we use it.

But in the meantime, this makes realistic crosswalks over Aurora,
fixing crazy walking detours there.

Not regenerating yet.
2021-06-24 12:41:38 -07:00
Dustin Carlino
190ee4b08f Fix the path v2->v1 and opportunistic lane-changing costs to heavily penalize cars from using bus lanes.
This doesn't avoid the aforementioned lane-changing crash, but by manual
inspection, it's keeping cars out of bus lanes.
2021-06-22 17:47:05 -07:00
Dustin Carlino
48076a4c5b Better stop sign placement -- degenerate roads shouldn't get them. Not
sure why this wasn't done before.

Regenerated all maps... but this happens to expose some lane-changing crashes.
2021-06-22 17:05:18 -07:00
Dustin Carlino
e08ddba241 Bring in fresh Seattle OSM data with the new cycletrack mapped around
Green Lake, and fix some missing support for bidi cycletracks.
2021-06-22 08:31:16 -07:00
Dustin Carlino
ae3d4e2363 Fix loading edits that change the number of lanes in a road. We need to compare the old version of the road in the edits with the basemap, NOT the edited version of the road. #597 2021-06-20 10:06:38 -07:00
Dustin Carlino
1e43d929e5 Implement dynamic lane-changing in a simple way:
- only triggered when a vehicle becomes Queued
- Only one adjacent lane, no contraflow (crossing the road's center
  line)
- Don't return to the original lane after passing
- Using a static blockage in the old lane (so other vehicles will wait
  too much)
- Only using the new lane to determine position (so visually a car will
  clip a bike as they pass)

Haven't regenerated prebaked data. #382
2021-06-19 12:35:19 -07:00
Dustin Carlino
0bcf01fd05 Avoid crashing in recalculate_intersection_polygon due to polylines not
containing some points. Happens at i524 in Arboretum and in the West
Seattle proposal.

I don't understand yet why this is possible in the first place, but
crashing is pretty bad in the meantime.
2021-06-19 11:29:01 -07:00