Commit Graph

1444 Commits

Author SHA1 Message Date
Dustin Carlino
dc5a484c4c Clean up the old special case for editing just a single lane type. Now, 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.
2021-05-21 14:34:04 -07:00
Dustin Carlino
ef90721741 Fix missing study area polygons on the web. The refactor to Polygon::from_geojson_file introduced filesystem IO to the geom crate. Instead, we need to be explicit about how we do file IO.
Also fix some clippy errors
2021-05-20 14:33:04 -07:00
Dustin Carlino
70d6bf52d2 Fix the "growing intersection" bug that happens when repeatedly using
the new road editor, by "untrimming" the road center points. Fixes #655
2021-05-19 22:24:44 -07:00
Dustin Carlino
a38228d5da Codify some different strategies for merging short roads 2021-05-18 16:03:57 -07:00
Dustin Carlino
27da792df6 cargo fmt 2021-05-15 16:28:50 -07:00
Vinzent Steinberg
ac62dde925 Prefer turbofish over temporary binding when collecting 2021-05-15 14:24:08 -07:00
Vinzent Steinberg
9d17faa878 Prefer slices over reference to owned type 2021-05-15 14:24:08 -07:00
Vinzent Steinberg
446a21696d
Fix most clippy warnings (#646)
* More conventional spelling of acronym identifiers

* `new` -> `new_state`

* Remove redundant field name

* Remove needless `collect`

* `to_controls` -> `make_controls`

* Simplify long if statement

* Fix module inception

* Simplify chained if let

* Return directly instead of creating a binding

* Disable clippy warning about `borrow` method

Implementing the `Borrow` trait instead would result in excessive type
annotations.

* Fix most remaining clippy warnings

* Allow clippy::type_complexity

* Fix bad merge from web editor

* Run cargo fmt

* Suppress large_enum_variant warnings

* Rename FYI state to ShowMessage

* Fix upper_case_acronyms warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 17:31:32 -07:00
Dustin Carlino
29c881ffc3 Switch from cargo +nighty fmt to the stable cargo fmt. Whatever edge-case formatting was happening with stable has been fixed 2021-05-14 08:39:51 -07:00
Vinzent Steinberg
fd3b0e2a14
Fix compilation failures and most clippy warnings (#642)
* abstutil: Fix compilation failure

* map_gui: Fix compilation

* traffic_signal_data: Fix compilation failure

* map_model: Fix compilation failure

* abstutil: Fix doctests

* abstio: Fix most clippy warnings

* abstutil: Fix most clippy warnings

* collisions: Fix clippy warning

* convert_osm: Fix clippy warnings

* sim: Fix most clippy warnings

* geom: Fix clippy warnings

* kml: Fix clippy warnings

* map_model: Fix most clippy warnings

* fifteen_min: Fix clippy warnings

* game: Fix many clippy warnings

* Disable some noisy clippy warnings

* headless: Fix clippy warnings

* importer: Fix clippy warnings

* map_editor: Fix clippy warnings

* map_gui: Fix clippy warnings

* osm_viewer: Fix clippy warnings

* parking_mapper: Fix most clippy warnings

* popdat: Fix clippy warnings

* santa: Fix clippy warnings

* sumo: Fix clippy warnings

* traffic_seitan: Fix clippy warning

* updater: Fix clippy warnings

* widgetry: Fix clippy warnings

* tests: Fix some clippy warnings

* Fix compilation on stable Rust

* Simplify unwrapping

* Make use of `Entry` more readable

* Fix formatting

* Fix code that was broken in the refactoring

* Apply cargo +stable fmt

* Fix code that was broken in the refactoring, second try

* Remove `Default` impls that are equivalent to `new`

* Remove obsolete clippy wrapper

* Avoid turbofish

* Prefer `unwrap_or_else` over allowing `clippy::or_fun_call`

* Remove redundant `into_iter`

* Fix typo

* Prefer `&& false` over commenting code out

* Fix some clippy warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 08:32:56 -07:00
Dustin Carlino
1bcbe057f0 Use more realistic lane widths during importing. #597 2021-05-10 20:10:23 -07:00
Dustin Carlino
4d3234ea14 Plumb a flag through the importer to try to consolidate all intersections in a map 2021-05-08 11:34:16 -07:00
Dustin Carlino
8c09f33761 Also implement multi-source Dijkstra's for vehicles. Had to give up on petgraph. 2021-05-06 10:48:32 -07:00
Dustin Carlino
8d6a184a1f Speed up the 'find perfect home' tool by starting Dijkstra's floodfill with multiple sources. Only implemented for walking right now. 2021-05-06 10:48:32 -07:00
Dustin Carlino
b29a613b42 Use strum macro to implement AmenityType::all 2021-05-06 08:50:29 -07:00
Trevor Nederlof
4080d0d130
Add craft and office to import and add/reorg AmenityType (#638)
* Add craft and office to import and add/reorg AmenityType

* Remove bike rental/parking and rename BikeShop to Bike

* add in leisure and tourism tags, add more categories to AmenityType and remove lesser used tags

* add dependency on strum and strum_macros and removed some manual code for text display of Enum and Enum into string

* include lock file, fix color of buildings for amenity layer, fix formatting and use orders
2021-05-06 08:43:52 -07:00
Dustin Carlino
488c9ffe68 Start to import GMNS timing.csv just based on line-strings. #626 2021-05-04 10:34:34 -07:00
Dustin Carlino
f400663b01 Better choices for lane width. #597 [rebuild] [release] 2021-05-02 09:11:21 -07:00
Dustin Carlino
4826808b9b Use fast_paths from crates.io, now that a new release is out 2021-04-25 18:03:16 -07:00
Dustin Carlino
a09bbd37c2 Improve the geometry of some consolidated intersections by taking the
convex hull. In many cases, this removes interior "jaggedness".

Regenerate all data... [rebuild]
2021-04-24 12:58:05 -07:00
Dustin Carlino
8722c102b9 Fix bug moving lanes left/right where the width of different lanes
wasn't getting updated, due to the code-path handling the old case...
2021-04-22 10:22:06 -07:00
Dustin Carlino
2112736a1f Polish UI of new road editor 2021-04-22 07:57:23 -07:00
Dustin Carlino
4b5bea1f10 Fix dumb bug from 18589cb083 2021-04-22 07:57:23 -07:00
Dustin Carlino
acfe095a3f Handle editing just the width of one lane 2021-04-22 07:57:23 -07:00
Dustin Carlino
c73ceebd35 MVP of Yuwen's new road editor! 2021-04-22 07:57:23 -07:00
Dustin Carlino
bc2a21ca89 Refactor some methods in Traversable 2021-04-19 14:50:51 -07:00
Dustin Carlino
c62cf1c90c Refine the detection for when a car wants to over-take a bike, and expose it in the UI as a problem. #81, #600 2021-04-19 14:44:42 -07:00
Dustin Carlino
96d2f35779 Refactor handling of the fast_paths unused-last-node problem.
Now regenerating everything...
2021-04-16 20:14:16 -07:00
Dustin Carlino
c1d95a2cf4 Handle adding/deleting sidewalks. This needs more caution at the pathfinding layer. #597
Tested by adding a sidewalk to 28th and Madison in the Arboretum map.
Not regenerating maps yet.
2021-04-16 17:00:50 -07:00
Dustin Carlino
72c48cb1f9 Address misc PR feedback for #604 2021-04-13 15:13:36 -07:00
Dustin Carlino
9923c1270a Repair parking lot connections after road widening. #597 2021-04-13 15:13:36 -07:00
Dustin Carlino
b9a9e8e5c5 Redraw building paths when needed 2021-04-13 15:13:36 -07:00
Dustin Carlino
a649e0be77 Repair building connections after road widening. #597
Don't redraw the paths yet, or try to deal with failures to snap.
2021-04-13 15:13:36 -07:00
Dustin Carlino
c16f185019 The new intersection polygon usually changes the trimming of all connected road center lines. #597 2021-04-10 11:56:05 -07:00
Dustin Carlino
10255c2835 Recalculate intersection geometry when road width changes. #579
No effect on the road geometry yet, though...
2021-04-10 11:56:05 -07:00
Dustin Carlino
e8b7019ef7 Use LaneSpec in map edits, letting width of each lane be modified too. #597 2021-04-09 14:35:49 -07:00
Dustin Carlino
68661f0efd Actually, to keep all of the existing editing UIs from breaking, preserve LaneIDs when just editing lane types. #597 2021-04-09 14:35:49 -07:00
Dustin Carlino
3beb153bbf Support adding lanes. #597
And in fact, unify the cases of deleting lanes, adding lanes, or just
modifying them in place.
2021-04-09 14:35:49 -07:00
Dustin Carlino
14609ab157 Fix lane geometry after changing the number of lanes. #597 2021-04-09 14:35:49 -07:00
Dustin Carlino
584c1be9e0 A humble start to deleting lanes. #597 2021-04-09 14:35:49 -07:00
Dustin Carlino
c6906f6153 Change Vec<Lane> to BTreeMap<LaneID, Lane> to prepare for
adding/deleting lanes. #597

Not regenerating all maps yet. Haven't evaluated performance impact yet.
2021-04-09 14:35:49 -07:00
Dustin Carlino
b367fdcb27 Fix Road::get_half_polygon for left-hand driving. 2021-04-09 09:01:05 -07:00
Dustin Carlino
204d13177d Make the 15m tool respect access-restricted zones. 2021-04-08 10:28:52 -07:00
Dustin Carlino
3060f94989
Start a pathfinding v2 API. #555 (#596)
The v1 path that all callers need is available by transforming PathV2 to
v1. The plan is to now gradually change callers to natively use PathV2
instead.
2021-04-08 08:57:59 -07:00
Dustin Carlino
618fcdad62 Collapse some methods for creating walking paths. This is leftover from
before the zone pathfinding simplification. #555
2021-04-07 15:52:03 -07:00
Dustin Carlino
1b5d9d7108 Remove _broken_path_v2_to_v1 for now. #555 2021-04-07 15:06:47 -07:00
Dustin Carlino
defcbf1bb9 Just splitting the v1 PathStep, Path, PathRequest into a separate module, so the transition to pathfinding v2 is easier to understand. #555 2021-04-07 12:05:39 -07:00
Dustin Carlino
23132a16f8 Now that the old code to build and cost graphs for pathfindng v1 is deleted, rename the v2 methods. #555 2021-04-07 11:06:57 -07:00
Dustin Carlino
e471000395 Remove the old zone_cost method. #555 2021-04-07 11:04:42 -07:00
Dustin Carlino
da3272e2ee Convert the alternative path debugger to use directed roads, not lanes. #555
This lets us clean up some of the old pathfinding v1 code, removing some
duplicate code!

Also improve that debugger to show a different cost for each side of the
road. The cost to turn around and reach a building on the other side of
the road may be high, so this really makes the debugger more
understandable.
2021-04-07 10:58:48 -07:00