Commit Graph

1339 Commits

Author SHA1 Message Date
Dustin Carlino
68e406d26b Swap left/right turns when generating traffic signal policies in the UK.
Verified by trying the "four-stage" template at some intersections. Now
regenerating data.
2021-02-08 17:06:32 -08:00
Dustin Carlino
6f0751111e Derp, crosswalks on left-handed driving maps were always just outside the intersections. This made for some crazy traffic signals, since the crosswalk never conflicted with any turn.
Don't regenerate yet, because I have one more of these...
2021-02-08 16:50:17 -08:00
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
ba2500c131 Create the path cost tuner. #237, #494
This lets you live-tune routing parameters, then see how it affects the
total number of routes that cross every road, relative to the baseline
of the original parameters. We can also use it in the future to do the
same thing, comparing before/after some map edits.
2021-02-03 11:34:15 -08:00
Dustin Carlino
a2b4dcb64f Store RoutingParams in the Map. Add a method for the debug UI to override the defaults, rebuilding the CHs. This is in preparation for #237, and part of #494 2021-02-03 10:59:02 -08:00
Dustin Carlino
32bcfbe738 Plumb in the tuned routing params. When they're not the defaults, automatically fallback from CH to Dijkstra's. #494 2021-02-02 15:20:06 -08:00
Dustin Carlino
3e40686a6b Fix a bunch of links after the repository renaming. 2021-01-31 15:50:48 -08:00
Dustin Carlino
341ce834e3 Based on startup params, display an extra 'study area' on the map. cyipt/actdev#44 2021-01-27 13:00:48 -08:00
Bruce
cf5ce637f3
Skip all-walk if no demand (#442)
* Skip all-walk if no demand

If you create an all-walk stage and make it adaptive, if there is no demand it will be skipped. Fixed crosswalks are never skipped, as they may be necessary for queue management.
2021-01-27 11:13:19 -08:00
Dustin Carlino
37a25c0fcb Improve turn type classification. Really sharp turns get classified as
u-turns, but recently, they're forced to left turns if the road names
don't match. Now be more specific and revert either a left or right
turn.

This fixes up https://www.openstreetmap.org/node/53089011, which now
acts like a 4-way intersection for signal heuristics!

Not regenerating everything yet.
2021-01-27 09:28:12 -08:00
Dustin Carlino
92b1f92d54 Define a second ranking for roads, beyond the 3 tiers. Just use for the NACTO max cycle length heuristic. #446 2021-01-26 14:39:17 -08:00
Dustin Carlino
cad336d493 Tighten up the definition of u-turns, requiring the from/to road names
to match.

Originally these were introduced to deal with merging intersections
between dual carriageways. But inadvertently, lots of left turns got
reclassified as u-turns. That's caused various headaches, most recently
the lakeslice gridlock. That's fixed again!
2021-01-25 17:19:48 -08:00
Dustin Carlino
fa70816bfa Attempt some transformation of sidewalk:{left,right} tags for #449.
Fix a bug with the previous commit (lanes=1 on a two-way). Now regenerate.

... Unfortunately lakeslice now gridlocks due to a turn generation bug.
Temporarily removing the prebaked results there so I can push these last
few changes through. Will resolve this before the next release.
2021-01-25 15:31:01 -08:00
Dustin Carlino
a8f6ea2462 More carefully handle an odd number of lanes in OSM
Still not regenerating
2021-01-25 14:19:10 -08:00
Dustin Carlino
08a1a75127 Fix bug with cycleway:right and left-hand driving. #330
Not regenerating yet
2021-01-25 14:12:58 -08:00
Dustin Carlino
f69335edf0 Let individual maps override the street parking length. #457
Now regenerate all map data, because the schema changed. Also had to
revert part of the last commit to unbreak transit route snapping in
Berlin.
2021-01-25 12:36:49 -08:00
Dustin Carlino
c9c6f240ae Remove timer.{note, warn, error} in favor of the log crate. #262
Originally, the intention of the deleted calls was to not interrupt
Timer progress bars with warnings. But the output of things like the
importer is impossible to read anyway. Strongly considering explicitly
sending logs and timing info to separate places and using something like
multitail for live progress.

Unplumb timer from LOADS of places that just needed it for logging.
2021-01-21 19:22:02 -08:00
Dustin Carlino
af07de5d8e Fix deserializing a map in JSON. #392 2021-01-19 11:27:56 -08:00
Dustin Carlino
4c6d7af76d Bring in linear pedestrian highways as cycleways+shoulders. #458
Also give living_streets in Krakow shoulders, so foot routing works
better there.

Now regenerate everything. Actually messes up routing for Trumpington;
71 cancelled trips up to 101. And have to intervene to keep lakeslice
not gridlocking, as usual.
2021-01-16 17:03:13 -08:00
Dustin Carlino
ec8c37ab05 Import pedestrian plaza areas, just for rendering. #458
Not regenerating everything yet.
2021-01-16 15:16:14 -08:00
Dustin Carlino
322fb81a9d Add more (still disabled) heuristics for automatically merging short roads. Look for roads between dual carriageways. #457 2021-01-16 10:24:03 -08:00
Dustin Carlino
df16c30b77 Add shoulders for foot traffic on separate cycleways. #330
For the moment, this is the simplest way to allow foot traffic. This
breaks down in places like
https://www.openstreetmap.org/way/49207928, where the road gets an
inferred sidewalk and the separate cycleway on each side is
bidirectional with shoulders on each side.

Down to 71 cancelled trips in the baseline for cyipt/actdev#32.
2021-01-16 09:30:22 -08:00
Dustin Carlino
3cdbe74948 Use a queue to merge short roads, instead of a potentially quadratic scan. #114 2021-01-15 20:52:11 -08:00
Dustin Carlino
8ec1e5a807 Automatically merge roads based on the inferred length. For now, the
threshold is hardcoded to 0 to disable this, but it can be more easily
changed when experimenting locally.

I tried this out in a few maps manually and saw that it helps sometimes,
but breaks strangely other times. My plan is to work through the bugs
that result and eventually enable this for all imports. #114
2021-01-15 16:53:12 -08:00
Dustin Carlino
48a60c965b For extremely short roads (under 2 meters after calculating intersection
geometry), don't generate crosswalks or stop signs. In reality, these
usually represent the middle of a complicatd intersection. Ideally these
cases would be merged into a single intersection, but before that's
feasible, at least improve some of the inferred things nearby. #457
2021-01-15 15:32:01 -08:00
Dustin Carlino
3fc349844b Introduce traffic signal plans that change at defined points in time. Make the changes at the permanent JSON level only. #447 2021-01-15 10:02:13 -08:00
Dustin Carlino
a7f3e998b7 Start to generate two simple scenario from actdev desire lines. https://github.com/cyipt/actdev/issues/32 2021-01-14 10:31:21 -08:00
Dustin Carlino
7ffb2d108f Treat cyclepaths as lower priority at intersections with regular roads,
to more realistically guess stop signs. #330, #450
2021-01-13 16:56:55 -08:00
Dustin Carlino
a1988f269c Based on importer config, try using separate cyclepaths directly. #330
Small adjustments to unzoomed rendering and stop sign placement.

Regenerate all maps because of the format change, but only Cambridge
changes. Since we're doing this anyway, also pull in leisure=garden.
2021-01-12 11:13:45 -08:00
Dustin Carlino
243a4b3410 Fix cycleway:left with left-hand driving. #449 2021-01-12 09:41:51 -08:00
Dustin Carlino
ddc49e14b4 Add a signal editor tool to adjust the timing to some approximation of https://nacto.org/publication/urban-street-design-guide/intersection-design-elements/traffic-signals/signal-cycle-lengths/ for #446 2021-01-11 17:16:01 -08:00
Dustin Carlino
a34a776b2d Allow manually specified signals to become out-of-date when dealing with edits. b487678ee0 was too strict -- we only want to detect out-of-date config when importing the map, not when editing! 2021-01-11 13:43:38 -08:00
Dustin Carlino
084a8941ab Woops, the include_dir change yesterday broke manually specified traffic
signals. Also they weren't being fully validated, so added that paranoia
check.
2021-01-10 18:19:12 -08:00
Dustin Carlino
b487678ee0 Delete all out-of-date manual overrides for traffic signals, and make it
a hard error when they become out-of-date going forward.

Better heuristics make some of these unnecessary. And now the the JSON
files are in this repo, updating files manually when pulling down new
OSM data becomes less tedious.
2021-01-07 12:24:07 -08:00
Dustin Carlino
6346302338 Remove the adaptive traffic signal experiment, now that Bruce's variable signals work. The adaptive case was added as a proof-of-concept, and its behavior is subsumed by the variable ones. Fixes #124 2021-01-05 13:06:44 -08:00
Dustin Carlino
6f5f001406 Address SUMO PR comments and also rebase. Mainly:
- use an enum for vehicle types
- distinguish lane and internal lane IDs
2021-01-05 12:44:38 -08:00
Dustin Carlino
8436b5358e Transform SUMO's connections and internal edges into ABST's turns 2021-01-05 12:44:38 -08:00
Dustin Carlino
802e020520 Import a SUMO network, transform it into an ABST map. So far, this gets
lanes and intersections displaying, but with lots of problems.
2021-01-05 12:44:38 -08:00
Dustin Carlino
e99def9124 Switch all error handling to anyhow. Nothing consumes our code as a
library yet, so this is a step forward from string errors. Manually
tested how errors show up (including the nice with_context bit).
2021-01-05 11:35:03 -08:00
Dustin Carlino
bc3c3dfd6c Rename phase -> stage in the JSON traffic signal format. Meant to do this a long time ago. #295
Make this schema change backwards compatible for player edits.
2021-01-04 11:18:17 -08:00
Dustin Carlino
d529ae2e5c Upgrade usvg and rand 2021-01-04 09:19:54 -08:00
Dustin Carlino
965d999199 Upgrade misc other dependencies 2021-01-03 20:01:27 -08:00
Dustin Carlino
2945913fb3 Upgrade rand 2021-01-03 19:48:03 -08:00
Javed Nissar
c0c7e22c40
Add dist from sidewalk to cost to improve illustration of distance (#443) 2021-01-03 17:59:39 -08:00
Dustin Carlino
5c04923dff Split abstio crate out from abstutil. #253
widgetry, geom, and abstutil may wind up on crates.io in some form to
let other projects use widgetry. abstio has A/B Street-specific tricks
for reading data on native/web. Note widgetry still depends on abstio,
will figure out how to clean that up next.
2021-01-02 10:28:00 -08:00
Dustin Carlino
312a721e63 Fold the separate seattle_traffic_signals git repo back into this one.
Originally it was split out to organize a separate volunteer mapping
effort, but that never took off, and it's unlikely to happen. When we
have to occasionally update the prebaked signal data for some
intersections, it's unnecessary friction to update the other repo.
2020-12-31 11:01:48 -08:00
Dustin Carlino
9c63d9a181 Make a quick way of marking roads in the UI, dumping to a list, then
later overriding a .osm file with tags for these roads. This is a way to
test the effects of making simple OSM changes locally before
upstreaming.

Also handle repeated merging collapsing one of the roads. Not 100% what
happens here, but skipping the collapsed road works fine. The scary
Montlake intersections now look great with all the merging done, so
upstreaming the change! #114
2020-12-30 18:31:39 -08:00
Dustin Carlino
629ee92a7e I got the turn restriction preservation direction wrong earlier. Now
everything along Aurora looks fine, but maybe I wrote the other way when
testing in Montlake earlier. Guess I'll find out soon. #114

Not regenerating all maps yet, since more churn is on the way.
2020-12-30 17:30:05 -08:00
Dustin Carlino
60e7c91d03 Handle one-way roads more uniformly in the traffic signal heuristics. #8
Previously, dual carriageways (pairs of one-way roads in opposite
directions) mostly didn't get any signal templates successfully applied.
This change ignores outbound-only roads when applying the templates. In
one fell swoop, lots of previously broken signals along places like
Aurora Ave suddenly work reasonably.
2020-12-30 15:28:17 -08:00
Dustin Carlino
9bc761f98e Explicitly model U-turns. Sometimes they're legal, often they get
generated incorrectly, but regardless, calling them TurnType::Left is
just confusing.

For the moment, always filter out U-turns from merged intersections.
When connections across merged one-ways are handled properly, we won't
need this, but in the meantime, it moves forward. #114

Not regenerating just yet, but will bundle it with the next commit.
2020-12-30 11:11:20 -08:00