Trim out unrealistic left and right turns. Find cases where multiple

lanes all lead to a single lane via left/right turn, and just keep the
left/rightmost lane.

Sanity checked at Rainier / S Massachusetts, and 23rd / S Massachusetts.
This commit is contained in:
Dustin Carlino 2020-09-29 19:27:46 -07:00
parent f6614f02a6
commit e8d6525c59
3 changed files with 117 additions and 39 deletions

View File

@ -1,5 +1,5 @@
data/input/berlin/EWR201812E_Matrix.csv,7966d3e37c45e7ffa4ee26bb6c8cec28,https://www.dropbox.com/s/38fl51jxp5iwuz3/EWR201812E_Matrix.csv.zip?dl=0
data/input/berlin/berlin_center_separate_cycleways.bin,a540b5489f1279f38fdbfb6c7bba55b8,https://www.dropbox.com/s/nas6r3pzesmrbdj/berlin_center_separate_cycleways.bin.zip?dl=0
data/input/berlin/berlin_center_separate_cycleways.bin,0d20c62be8cfd8d3ca6e64a52225e83d,https://www.dropbox.com/s/nas6r3pzesmrbdj/berlin_center_separate_cycleways.bin.zip?dl=0
data/input/berlin/berlin_center_snapped_cycleways.bin,2ff14b60c55ada6154bad1ce71f1ddb5,https://www.dropbox.com/s/n1kdzjv2iq4gewt/berlin_center_snapped_cycleways.bin.zip?dl=0
data/input/berlin/footways.bin,19d6608e9bc85800706e004e4530a81b,https://www.dropbox.com/s/c36724ayytwwpz8/footways.bin.zip?dl=0
data/input/berlin/osm/berlin-latest.osm.pbf,8e7f5ecf37631bb975f062593c5add99,https://www.dropbox.com/s/6lssl37uhbyo7gr/berlin-latest.osm.pbf.zip?dl=0
@ -8,7 +8,7 @@ data/input/berlin/planning_areas.bin,f1a3bd5118a0e4982b64c2307e01d82a,https://ww
data/input/berlin/planning_areas.kml,1bfc2044f1f5f40acdcdded1a644ad22,https://www.dropbox.com/s/9bvbshrtjw14tm7/planning_areas.kml.zip?dl=0
data/input/berlin/service_roads.bin,be06e4b4136771f8e03a2ba7a5f9b8cd,https://www.dropbox.com/s/g4km7xhshigwz8g/service_roads.bin.zip?dl=0
data/input/krakow/footways.bin,017e85fd6da69b67a1a7a790506f52ff,https://www.dropbox.com/s/xxwivqmxev2ecl6/footways.bin.zip?dl=0
data/input/krakow/krakow_center_separate_cycleways.bin,c03a06f166590a8e159740a4e7d6f161,https://www.dropbox.com/s/dqrc5w5jxpv9nfc/krakow_center_separate_cycleways.bin.zip?dl=0
data/input/krakow/krakow_center_separate_cycleways.bin,bc6850854e7c3c38d1d8f308ff08d92e,https://www.dropbox.com/s/dqrc5w5jxpv9nfc/krakow_center_separate_cycleways.bin.zip?dl=0
data/input/krakow/krakow_center_snapped_cycleways.bin,03c50c05dcb636229f827879ae2b983e,https://www.dropbox.com/s/03f9g4gubb9x3y3/krakow_center_snapped_cycleways.bin.zip?dl=0
data/input/krakow/osm/krakow_center.osm,b914bbcd42a7f769a40a90970cea35f2,https://www.dropbox.com/s/pf3avtszpw732jd/krakow_center.osm.zip?dl=0
data/input/krakow/osm/malopolskie-latest.osm.pbf,9505917bbacc478177e36605e89b6d77,https://www.dropbox.com/s/vehjfvwx25v1qnd/malopolskie-latest.osm.pbf.zip?dl=0
@ -17,7 +17,7 @@ data/input/london/footways.bin,95816ac4d77d857c561a61830d1998a0,https://www.drop
data/input/london/osm/greater-london-latest.osm.pbf,ef110d0831b482bb7336c82e36b115ed,https://www.dropbox.com/s/wzwjgcd3wsc4sx1/greater-london-latest.osm.pbf.zip?dl=0
data/input/london/osm/southbank.osm,b86babace41d69a9e5b8be2310a725ae,https://www.dropbox.com/s/qip39avqaijvxy6/southbank.osm.zip?dl=0
data/input/london/service_roads.bin,4f651a450d9d6b73618db015c34a03ad,https://www.dropbox.com/s/c477mruya21q9a0/service_roads.bin.zip?dl=0
data/input/london/southbank_separate_cycleways.bin,6182e8fc0fa16fa94c0a4f85437600b2,https://www.dropbox.com/s/pahf7kbiuh1j2yr/southbank_separate_cycleways.bin.zip?dl=0
data/input/london/southbank_separate_cycleways.bin,48664381ee26879139d0798b89c8294e,https://www.dropbox.com/s/pahf7kbiuh1j2yr/southbank_separate_cycleways.bin.zip?dl=0
data/input/london/southbank_snapped_cycleways.bin,6cbbe9d6c102a1d35c17ddd1acd7841a,https://www.dropbox.com/s/l4anoe33yuut4vs/southbank_snapped_cycleways.bin.zip?dl=0
data/input/raw_maps/ballard.bin,019b00bc239cd151bbde8ea76c8deb52,https://www.dropbox.com/s/v45tecyrcnhm4p2/ballard.bin.zip?dl=0
data/input/raw_maps/berlin_center.bin,bd6acbb9a316382d1a18187b6ce132f5,https://www.dropbox.com/s/p8irq9yu8jsqr9f/berlin_center.bin.zip?dl=0
@ -39,11 +39,11 @@ data/input/screenshots/montlake.zip,6edfa04bc3a276a55a821285cf9605ed,https://www
data/input/screenshots/southbank.zip,b7baf1d981b017cc59343db112789ed2,https://www.dropbox.com/s/2smj2sw9gq7ajwx/southbank.zip.zip?dl=0
data/input/screenshots/udistrict.zip,f86cae358af73bf3b04fb7304e62763d,https://www.dropbox.com/s/nlyxnfy11qszk50/udistrict.zip.zip?dl=0
data/input/seattle/N47W122.hgt,0db4e23e51f7680538b0bbbc72208e07,https://www.dropbox.com/s/mmb4mgutwotijdw/N47W122.hgt.zip?dl=0
data/input/seattle/ballard_separate_cycleways.bin,933425ed3ca075ba72ad79211824b64f,https://www.dropbox.com/s/zca4udhnk0491wf/ballard_separate_cycleways.bin.zip?dl=0
data/input/seattle/ballard_snapped_cycleways.bin,67d84e6e231b62e6e3bd0c80a5580775,https://www.dropbox.com/s/fwfez964qnmgpqi/ballard_snapped_cycleways.bin.zip?dl=0
data/input/seattle/ballard_separate_cycleways.bin,c4836ed0837a77fdf7952c73906a85e5,https://www.dropbox.com/s/zca4udhnk0491wf/ballard_separate_cycleways.bin.zip?dl=0
data/input/seattle/ballard_snapped_cycleways.bin,1f25c6dac0d0c8f01b187031c4bcf58c,https://www.dropbox.com/s/fwfez964qnmgpqi/ballard_snapped_cycleways.bin.zip?dl=0
data/input/seattle/blockface.bin,add872bab9040ae911366328a230f8b5,https://www.dropbox.com/s/rxd2care60tbe75/blockface.bin.zip?dl=0
data/input/seattle/blockface.kml,350bd9e59bf2af4e885a7c0741e6ee6b,https://www.dropbox.com/s/ukknmpjdvilncq9/blockface.kml.zip?dl=0
data/input/seattle/downtown_separate_cycleways.bin,d4ba348cfa8c02e76b9c909fa3d063d3,https://www.dropbox.com/s/4g4chqffvxl5wlu/downtown_separate_cycleways.bin.zip?dl=0
data/input/seattle/downtown_separate_cycleways.bin,bab354d14846b07d33b994ea3a3936c3,https://www.dropbox.com/s/f8yh6fkvqv5f6e9/downtown_separate_cycleways.bin.zip?dl=0
data/input/seattle/downtown_snapped_cycleways.bin,ece26188973856f10bcebe54b84b14da,https://www.dropbox.com/s/04udsnariucippl/downtown_snapped_cycleways.bin.zip?dl=0
data/input/seattle/footways.bin,9914bda6407ecdc9cf9cac5fe18fa3ed,https://www.dropbox.com/s/8m55quuf5b6pvy7/footways.bin.zip?dl=0
data/input/seattle/google_transit/agency.txt,75f564fcc06b1950b7b33acf9d61f696,https://www.dropbox.com/s/z0idqw556c8ouu0/agency.txt.zip?dl=0
@ -58,11 +58,11 @@ data/input/seattle/google_transit/shapes.txt,aebada05d6d05c78551adb634b748e22,ht
data/input/seattle/google_transit/stop_times.txt,1f1d148b266142b72ab24816d76a9cee,https://www.dropbox.com/s/zvg6o7olxagd3rt/stop_times.txt.zip?dl=0
data/input/seattle/google_transit/stops.txt,da1ff7000efdf2166d861479a69d80a4,https://www.dropbox.com/s/w4g0leglckiv4es/stops.txt.zip?dl=0
data/input/seattle/google_transit/trips.txt,e8efe1d2e130e248942188284d88ab09,https://www.dropbox.com/s/lw0hhnqttns2h8z/trips.txt.zip?dl=0
data/input/seattle/huge_seattle_separate_cycleways.bin,1604a1f25d808b9c3fe14a5c893982b4,https://www.dropbox.com/s/yxwng9e4o23g4u4/huge_seattle_separate_cycleways.bin.zip?dl=0
data/input/seattle/huge_seattle_snapped_cycleways.bin,2f46f0eb2f55656d9868ee9623620a87,https://www.dropbox.com/s/n613496yq3f4kcq/huge_seattle_snapped_cycleways.bin.zip?dl=0
data/input/seattle/lakeslice_separate_cycleways.bin,6170b2f36bb797106a23c5cdaa06acae,https://www.dropbox.com/s/km6auma0v2a85g0/lakeslice_separate_cycleways.bin.zip?dl=0
data/input/seattle/huge_seattle_separate_cycleways.bin,d98935028b8264e628c8f8f6e40a0199,https://www.dropbox.com/s/un6iu1jxkdiwpgn/huge_seattle_separate_cycleways.bin.zip?dl=0
data/input/seattle/huge_seattle_snapped_cycleways.bin,8018085c8c1f8b4336eb6cd9ae6e13ac,https://www.dropbox.com/s/n613496yq3f4kcq/huge_seattle_snapped_cycleways.bin.zip?dl=0
data/input/seattle/lakeslice_separate_cycleways.bin,53621be49877f8a6e5f75448f37a2e00,https://www.dropbox.com/s/1clkxah39qpzjug/lakeslice_separate_cycleways.bin.zip?dl=0
data/input/seattle/lakeslice_snapped_cycleways.bin,30916279d151f97fd7ff6653eaef8719,https://www.dropbox.com/s/5uf52oy8qubzzcl/lakeslice_snapped_cycleways.bin.zip?dl=0
data/input/seattle/montlake_separate_cycleways.bin,172b866b136efc72923ad2aec03f200a,https://www.dropbox.com/s/0pe5mcfl6qa86gk/montlake_separate_cycleways.bin.zip?dl=0
data/input/seattle/montlake_separate_cycleways.bin,becf805c9a4a09600686b16ef6b40d68,https://www.dropbox.com/s/3ouc6q6zwtnz3f2/montlake_separate_cycleways.bin.zip?dl=0
data/input/seattle/montlake_snapped_cycleways.bin,bad5e9c0a0ca11b8e73d79e47ab903a2,https://www.dropbox.com/s/yqv2zvt66ceyaij/montlake_snapped_cycleways.bin.zip?dl=0
data/input/seattle/offstreet_parking.bin,a33c05e8962dfe10a7a14b9eb6413803,https://www.dropbox.com/s/7j2gwb18685kd5u/offstreet_parking.bin.zip?dl=0
data/input/seattle/offstreet_parking.kml,e24d1c308ca739df73621846c7b7847c,https://www.dropbox.com/s/dkkkpywob7cdo57/offstreet_parking.kml.zip?dl=0
@ -79,44 +79,44 @@ data/input/seattle/parcels.bin,dd1164448cdad013449174f913a2ffe0,https://www.drop
data/input/seattle/parcels_urbansim.txt,db63d7d606e8702d12f9399e87e6a00f,https://www.dropbox.com/s/6g8rbsf200dssj3/parcels_urbansim.txt.zip?dl=0
data/input/seattle/popdat.bin,df343c597aea0fa3625072bcbb14dddb,https://www.dropbox.com/s/kp8qpi9rxwt0yc1/popdat.bin.zip?dl=0
data/input/seattle/service_roads.bin,9a621840d4900d05694a3542e65f06f4,https://www.dropbox.com/s/ilb2s4grisn39ec/service_roads.bin.zip?dl=0
data/input/seattle/south_seattle_separate_cycleways.bin,14aced87f4ed75414c6d8b67c07f5856,https://www.dropbox.com/s/y2l6txv14yaui9g/south_seattle_separate_cycleways.bin.zip?dl=0
data/input/seattle/south_seattle_separate_cycleways.bin,7949275036859c8d4167387e3a22faa0,https://www.dropbox.com/s/phmdr7pg6rjovzk/south_seattle_separate_cycleways.bin.zip?dl=0
data/input/seattle/south_seattle_snapped_cycleways.bin,92bb9e7d7b8d89e63ecb4d9fe54e3b7f,https://www.dropbox.com/s/lcu1u73kubxty9k/south_seattle_snapped_cycleways.bin.zip?dl=0
data/input/seattle/trips_2014.csv,d4a8e733045b28c0385fb81359d6df03,https://www.dropbox.com/s/5ppravwmk6bf20d/trips_2014.csv.zip?dl=0
data/input/seattle/udistrict_separate_cycleways.bin,e47f3a0adc75aad5527a890bc2a15697,https://www.dropbox.com/s/yz1r97ywziwlobd/udistrict_separate_cycleways.bin.zip?dl=0
data/input/seattle/udistrict_snapped_cycleways.bin,add6c8fb19a420a5d291df26e4c7d6cb,https://www.dropbox.com/s/zpznqax43fxl7xp/udistrict_snapped_cycleways.bin.zip?dl=0
data/input/seattle/west_seattle_separate_cycleways.bin,c8e53fab535f1ba810a9d28ae3446ce1,https://www.dropbox.com/s/teb51kihqeg983f/west_seattle_separate_cycleways.bin.zip?dl=0
data/input/seattle/udistrict_separate_cycleways.bin,8bafa396eb67c43b700e5df6bcd86801,https://www.dropbox.com/s/1jv6q79x324jgga/udistrict_separate_cycleways.bin.zip?dl=0
data/input/seattle/udistrict_snapped_cycleways.bin,875dc34561c5c6020f35ab2feeba6a79,https://www.dropbox.com/s/zpznqax43fxl7xp/udistrict_snapped_cycleways.bin.zip?dl=0
data/input/seattle/west_seattle_separate_cycleways.bin,803fc1ca6080dbb507f2b3d696946c7b,https://www.dropbox.com/s/jp9zxlvqczan9by/west_seattle_separate_cycleways.bin.zip?dl=0
data/input/seattle/west_seattle_snapped_cycleways.bin,4a8e438b0795360aa7fec1ebacd64233,https://www.dropbox.com/s/f7dz2e4o6k4c2ix/west_seattle_snapped_cycleways.bin.zip?dl=0
data/input/tel_aviv/footways.bin,4fb70e32d0cc3ddeaa8924c240bc9d5b,https://www.dropbox.com/s/ka38f1kwjgm0fpo/footways.bin.zip?dl=0
data/input/tel_aviv/osm/israel-and-palestine-latest.osm.pbf,d5b0d6a26bfdedd32cc5c9c26e6fd426,https://www.dropbox.com/s/ehwhbhp03zuy1qn/israel-and-palestine-latest.osm.pbf.zip?dl=0
data/input/tel_aviv/osm/tel_aviv.osm,eeb7f3813a33f754eceed13766a3c236,https://www.dropbox.com/s/kqvn0iifhmmcjve/tel_aviv.osm.zip?dl=0
data/input/tel_aviv/service_roads.bin,216407d6f112683e81973fbb11af6403,https://www.dropbox.com/s/7rscshpat7dyzxv/service_roads.bin.zip?dl=0
data/input/tel_aviv/tel_aviv_separate_cycleways.bin,2f62cf6775b93da20fe05877fe46453b,https://www.dropbox.com/s/p62d1gum2e04rp9/tel_aviv_separate_cycleways.bin.zip?dl=0
data/input/tel_aviv/tel_aviv_snapped_cycleways.bin,a02d82cd59ca04d6cc13f58916a9f886,https://www.dropbox.com/s/wq2oco1u22gzwou/tel_aviv_snapped_cycleways.bin.zip?dl=0
data/input/tel_aviv/tel_aviv_separate_cycleways.bin,35d8503878aa4a37e1862e23e074215f,https://www.dropbox.com/s/p62d1gum2e04rp9/tel_aviv_separate_cycleways.bin.zip?dl=0
data/input/tel_aviv/tel_aviv_snapped_cycleways.bin,e846cdffc84dc1c3f09abb0e4b7d8b85,https://www.dropbox.com/s/wq2oco1u22gzwou/tel_aviv_snapped_cycleways.bin.zip?dl=0
data/input/xian/footways.bin,425becbab867631415fe49edcf8f9694,https://www.dropbox.com/s/6hf4t4ovk1m1wi3/footways.bin.zip?dl=0
data/input/xian/osm/china-latest.osm.pbf,0108807f1dc321d5de5579622ac3f4cf,https://www.dropbox.com/s/qewwxtioocbv3ld/china-latest.osm.pbf.zip?dl=0
data/input/xian/osm/xian.osm,4084c665ad947bb40173a43cb33fdec8,https://www.dropbox.com/s/j5qwt33bs077sd2/xian.osm.zip?dl=0
data/input/xian/service_roads.bin,c9a1a296817cfbd6c64dbe0d3389c40a,https://www.dropbox.com/s/wm4ga2kay4v4ija/service_roads.bin.zip?dl=0
data/system/cities/seattle.bin,104e558649d9b4fb1021ba9d7c6d35db,https://www.dropbox.com/s/we87vhlkvzowhis/seattle.bin.zip?dl=0
data/system/maps/ballard.bin,c4674c00c6f989540b0b7341dedfa760,https://www.dropbox.com/s/7a6e4mjxjppukg3/ballard.bin.zip?dl=0
data/system/maps/berlin_center.bin,8812649b0ec44c6e61637eb5e6b343e5,https://www.dropbox.com/s/t75aawvsyiefq29/berlin_center.bin.zip?dl=0
data/system/maps/downtown.bin,664ea5fcbc382e6ccbb4f026e908d8db,https://www.dropbox.com/s/o6op7jnqibcc5q2/downtown.bin.zip?dl=0
data/system/maps/huge_seattle.bin,0132f0de7d164efc94579e12ee5eb3d8,https://www.dropbox.com/s/xnf9p54wc9muehn/huge_seattle.bin.zip?dl=0
data/system/maps/krakow_center.bin,2292a5e714c59942fb8850e51c38674a,https://www.dropbox.com/s/3jpw8kl0o6n8zg3/krakow_center.bin.zip?dl=0
data/system/maps/lakeslice.bin,b7e5ab58b3cd135e04efb3a8a9589fa6,https://www.dropbox.com/s/ety0cr2jpoi43gh/lakeslice.bin.zip?dl=0
data/system/maps/montlake.bin,5c134997358c74bc644eb0163b36102b,https://www.dropbox.com/s/24xupe5p02n3k9q/montlake.bin.zip?dl=0
data/system/maps/south_seattle.bin,2c8ceea40aefd6a44d88afa5501893e3,https://www.dropbox.com/s/kv5y3oez6a9zkjd/south_seattle.bin.zip?dl=0
data/system/maps/southbank.bin,4f5dba97373d83168bd94ce552f99b70,https://www.dropbox.com/s/z06c7ddb0yh4zm9/southbank.bin.zip?dl=0
data/system/maps/tel_aviv.bin,38168e6152d12e5c9a6b9fe1b350ebac,https://www.dropbox.com/s/wefvd4glqoydgdk/tel_aviv.bin.zip?dl=0
data/system/maps/udistrict.bin,2950b9afd0a3d10f40566559eca17413,https://www.dropbox.com/s/xtf93tkwfesltho/udistrict.bin.zip?dl=0
data/system/maps/west_seattle.bin,141acdb453f4af3f0714e64bacac5cb8,https://www.dropbox.com/s/vhymom72137s1tn/west_seattle.bin.zip?dl=0
data/system/maps/xian.bin,0a5a2354c1033599d53821ab8a431379,https://www.dropbox.com/s/sr0138dya91d6w4/xian.bin.zip?dl=0
data/system/maps/ballard.bin,6edba604033302cbfc5fff17ced5c39b,https://www.dropbox.com/s/t0ebhqkeutdpmw9/ballard.bin.zip?dl=0
data/system/maps/berlin_center.bin,47ff46d7c6e4f68bd549d592804d7e0a,https://www.dropbox.com/s/tmdrewfqd2usk8r/berlin_center.bin.zip?dl=0
data/system/maps/downtown.bin,dd3fedae45ffdc90c2d13de824737ab4,https://www.dropbox.com/s/6h89zy2m8cut94a/downtown.bin.zip?dl=0
data/system/maps/huge_seattle.bin,c4e1497d90af2eeab1eeecb45dce859e,https://www.dropbox.com/s/tluhideab4hxtj7/huge_seattle.bin.zip?dl=0
data/system/maps/krakow_center.bin,950d602d1f02467d5d676cefe026ab31,https://www.dropbox.com/s/33jhskqceqw96qy/krakow_center.bin.zip?dl=0
data/system/maps/lakeslice.bin,7b18366791fecf669f9f35606a23f817,https://www.dropbox.com/s/f4ifj0o0ue84fp6/lakeslice.bin.zip?dl=0
data/system/maps/montlake.bin,45138dbbb2bb36ced999bb3fc65e97f2,https://www.dropbox.com/s/qjs6hd48m8leiot/montlake.bin.zip?dl=0
data/system/maps/south_seattle.bin,8ba4a5cd67f0e28c5446f7fd9d44a3c5,https://www.dropbox.com/s/yd08sszn4o7g1m4/south_seattle.bin.zip?dl=0
data/system/maps/southbank.bin,bf76074045a61b9542cd6724871c4865,https://www.dropbox.com/s/9wrz7u4tp5zijhy/southbank.bin.zip?dl=0
data/system/maps/tel_aviv.bin,3e06ccd82eb53157dd97d9310a3590e2,https://www.dropbox.com/s/2ljqnkvhowwj7lp/tel_aviv.bin.zip?dl=0
data/system/maps/udistrict.bin,068572e5763099f8a99428ef2fb57457,https://www.dropbox.com/s/8v01rmik8l5c40u/udistrict.bin.zip?dl=0
data/system/maps/west_seattle.bin,f1c287184145ca8be93f6094a0fadc8b,https://www.dropbox.com/s/ffnaiqj1zvfg89g/west_seattle.bin.zip?dl=0
data/system/maps/xian.bin,58b48ea8f5dbfa367b671639ae2c3762,https://www.dropbox.com/s/g80x7d26ce3htw3/xian.bin.zip?dl=0
data/system/prebaked_results/montlake/car vs bike contention.bin,4be92c76d13cc688eb2c88e583926943,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
data/system/prebaked_results/montlake/weekday.bin,01bbb2b126a19ceb6a59b93681cdeadd,https://www.dropbox.com/s/ic30cpe76so9mu0/weekday.bin.zip?dl=0
data/system/scenarios/ballard/weekday.bin,154baf444087ab4b1457e77aa15e0319,https://www.dropbox.com/s/73y673dyc7aapk7/weekday.bin.zip?dl=0
data/system/scenarios/downtown/weekday.bin,1b19490831983167a5d13713fcba945a,https://www.dropbox.com/s/xy6ykf9ayc4pvo1/weekday.bin.zip?dl=0
data/system/prebaked_results/montlake/weekday.bin,a34234d26deb53004022ff7e504688a8,https://www.dropbox.com/s/t7n0nt29xfg80w8/weekday.bin.zip?dl=0
data/system/scenarios/ballard/weekday.bin,e384738bc70938775b131e08da5fcde2,https://www.dropbox.com/s/s8vtx3i4taq7vz2/weekday.bin.zip?dl=0
data/system/scenarios/downtown/weekday.bin,cb35765294b36c113f87eb9e6c692a02,https://www.dropbox.com/s/mk8n0vf5g8nzhyr/weekday.bin.zip?dl=0
data/system/scenarios/huge_seattle/weekday.bin,f4e4f50d0a6b97320324abd60da71f57,https://www.dropbox.com/s/qx465vf9xe56cuf/weekday.bin.zip?dl=0
data/system/scenarios/lakeslice/weekday.bin,9f7acfed3cf4edc00864057a355d9082,https://www.dropbox.com/s/q1gohkmhaiaiaw5/weekday.bin.zip?dl=0
data/system/scenarios/montlake/weekday.bin,6e7f80a14157359d300b4ddd28cdd53c,https://www.dropbox.com/s/2ibi22dibm5bx6x/weekday.bin.zip?dl=0
data/system/scenarios/south_seattle/weekday.bin,c9ffd52c60b9bb5a9ed5d0804522ab34,https://www.dropbox.com/s/8qoeuwz9nszr1g9/weekday.bin.zip?dl=0
data/system/scenarios/udistrict/weekday.bin,419fc0359cf73f6f6bbc935dc571c883,https://www.dropbox.com/s/rqlx4mhs05yrcpk/weekday.bin.zip?dl=0
data/system/scenarios/west_seattle/weekday.bin,278a152fd8c1e1bf55d281a45e3a6a91,https://www.dropbox.com/s/4ls3xcclfpcr894/weekday.bin.zip?dl=0
data/system/scenarios/lakeslice/weekday.bin,27b1ceec194bfcc4ddaf8252db48122f,https://www.dropbox.com/s/v9luxof66853vwn/weekday.bin.zip?dl=0
data/system/scenarios/montlake/weekday.bin,f03104e45fd67373a6e67217b6defad8,https://www.dropbox.com/s/6zvp4fw6tgo0dvg/weekday.bin.zip?dl=0
data/system/scenarios/south_seattle/weekday.bin,574dcef0d7ce93b9ffdffb3e646adc6e,https://www.dropbox.com/s/dyf2cfi6cfx9lsr/weekday.bin.zip?dl=0
data/system/scenarios/udistrict/weekday.bin,4499c368b48a640cf4289be40c0e5449,https://www.dropbox.com/s/zz9mzho9mgjsp59/weekday.bin.zip?dl=0
data/system/scenarios/west_seattle/weekday.bin,32ddb02f086af105ec24212b907bb2c6,https://www.dropbox.com/s/69cg9aboj0okl92/weekday.bin.zip?dl=0

View File

@ -1,9 +1,9 @@
use crate::raw::RestrictionType;
use crate::{Intersection, Lane, LaneID, Map, Turn, TurnID, TurnType};
use crate::{Intersection, Lane, LaneID, Map, RoadID, Turn, TurnID, TurnType};
use abstutil::Timer;
use geom::{Distance, PolyLine, Pt2D};
use nbez::{Bez3o, BezCurve, Point2d};
use std::collections::{BTreeSet, HashMap, HashSet};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
// Generate all driving and walking turns at an intersection, accounting for OSM turn restrictions.
pub fn make_all_turns(map: &Map, i: &Intersection, timer: &mut Timer) -> Vec<Turn> {
@ -89,6 +89,9 @@ pub fn make_all_turns(map: &Map, i: &Intersection, timer: &mut Timer) -> Vec<Tur
}
}
final_turns = remove_merging_turns(map, final_turns, TurnType::Right);
final_turns = remove_merging_turns(map, final_turns, TurnType::Left);
let mut outgoing_missing: HashSet<LaneID> = HashSet::new();
for l in &i.outgoing_lanes {
if map.get_l(*l).lane_type.supports_any_movement() {
@ -294,3 +297,67 @@ fn lc_penalty(t: &Turn, map: &Map) -> isize {
((from_idx as isize) - (to_idx as isize)).abs()
}
fn remove_merging_turns(map: &Map, input: Vec<Turn>, turn_type: TurnType) -> Vec<Turn> {
let mut turns = Vec::new();
// Group turns of the specified type by (from, to) road
let mut pairs: BTreeMap<(RoadID, RoadID), Vec<Turn>> = BTreeMap::new();
for t in input {
// Only do this for driving lanes
if !map.get_l(t.id.src).is_driving() || !map.get_l(t.id.dst).is_driving() {
turns.push(t);
continue;
}
if t.turn_type == turn_type {
pairs
.entry((map.get_l(t.id.src).parent, map.get_l(t.id.dst).parent))
.or_insert_with(Vec::new)
.push(t);
} else {
turns.push(t);
}
}
for (_, group) in pairs {
if group.len() == 1 {
turns.extend(group);
continue;
}
// From one to many is fine
if group.iter().map(|t| t.id.src).collect::<HashSet<_>>().len() == 1 {
turns.extend(group);
continue;
}
// TODO Handle >1 left/right turn lane.
if group.iter().map(|t| t.id.dst).collect::<HashSet<_>>().len() > 1 {
turns.extend(group);
continue;
}
// We have multiple lanes all with a turn to the same destination lane. Most likely, only
// the rightmost or leftmost can actually make the turn.
let road = map.get_parent(group[0].id.src);
if turn_type == TurnType::Right {
turns.push(
group
.into_iter()
.max_by_key(|t| road.dir_and_offset(t.id.src).1)
.unwrap(),
);
} else if turn_type == TurnType::Left {
turns.push(
group
.into_iter()
.min_by_key(|t| road.dir_and_offset(t.id.src).1)
.unwrap(),
);
} else {
unreachable!()
}
}
turns
}

View File

@ -407,6 +407,17 @@ impl Road {
result
}
// lane must belong to this road. Offset 0 is the centermost lane on each side of a road, then
// it counts up from there.
pub(crate) fn dir_and_offset(&self, lane: LaneID) -> (Direction, usize) {
for &dir in [Direction::Fwd, Direction::Back].iter() {
if let Some(idx) = self.children(dir).iter().position(|pair| pair.0 == lane) {
return (dir, idx);
}
}
panic!("{} doesn't contain {}", self.id, lane);
}
// TODO Deprecated
pub(crate) fn children(&self, dir: Direction) -> Vec<(LaneID, LaneType)> {
if dir == Direction::Fwd {