Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Adding fixed script and figures
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartlynn committed Jun 14, 2021
1 parent 3b2ba11 commit 501ab4f
Show file tree
Hide file tree
Showing 108 changed files with 7,249 additions and 2 deletions.
6,891 changes: 6,891 additions & 0 deletions data/processed/nearest/all_walking_distances.csv

Large diffs are not rendered by default.

356 changes: 356 additions & 0 deletions data/processed/nearest/nearest_stations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,356 @@
destination,walking_dist
116th St - Columbia University,968.061
Junction Blvd,569.848
Rockaway Blvd,533.07
Woodhaven Blvd,686.104
Central Park North (110th St),833.246
104th St,554.653
Central Park North (110th St),399.128
103rd St,968.061
Jamaica - Van Wyck,988.156
116th St,758.0859999999999
125th St,818.9450000000002
145th St,815.8380000000001
3rd Ave - 138th St,449.62500000000006
137th St - City College,815.8380000000001
138th St - Grand Concourse,738.161
6th Ave,366.068
Harlem - 148 St,956.895
163rd St - Amsterdam Av,679.136
7th Ave,749.3799999999999
167th St,1057.7689999999998
157th St,679.136
170th St,1013.3439999999999
163rd St - Amsterdam Av,728.1889999999999
Parsons Blvd,863.4630000000003
Mt Eden Ave,658.444
West Farms Sq - E Tremont Av,732.484
176th St,606.203
81st St,571.2159999999999
Mt Eden Ave,542.851
81st St,564.0500000000001
183rd St,539.098
182nd-183rd Sts,539.098
Ave I,436.201
14th St,411.847
81st St,834.076
181st St,771.505
3rd Ave,610.191
Inwood - 207th St,455.82
Ave N,1150.387
Inwood - 207th St,450.4959999999999
225th St,509.96700000000004
Vernon Blvd - Jackson Ave,361.406
Queensboro Plz,652.616
219th St,509.96700000000004
Marble Hill - 225th St,663.023
Nereid Ave (238 St),619.9869999999999
Van Cortlandt Park - 242nd St,635.8539999999999
33rd St,730.1569999999999
Bay Pky,715.7600000000001
4th Av - 9th St,1413.313
33rd St,761.954
39th Ave,0.0
23rd St,730.1569999999999
34th St - Penn Station,1176.2559999999999
Herald Sq - 34th St,370.447
36th St,726.211
36th Ave,726.211
30th Ave,0.0
Union Sq - 14th St,480.173
138th St - Grand Concourse,449.62500000000006
149th St - Grand Concourse,855.548
52nd St,1032.083
5th Ave - Bryant Pk,246.019
42nd St - Bryant Pk,631.075
53rd St,733.6070000000001
Northern Blvd,719.2519999999998
49th St,431.62600000000003
50th St,218.07600000000002
Smith - 9th Sts,629.5519999999999
49th St,218.07600000000002
Lexington Ave - 53rd St,472.32
Woodside - 61st St,789.5289999999999
59th St,678.4320000000001
62nd St,539.8330000000001
5th Ave - 53rd St,549.231
53rd St,678.4320000000001
66th St - Lincoln Ctr,593.653
57th St,549.231
57th St,549.4230000000001
42nd St - Bryant Pk,246.019
New Utrecht Ave,238.388
67th Ave,997.076
69th St,448.1929999999999
59th St - Columbus Circle,593.653
Forest Hills - 71st Av,888.587
Lexington Ave - 63rd St,397.805
74th St - Broadway,416.41600000000005
14th St,366.068
New Utrecht Ave,696.621
66th St - Lincoln Ctr,750.1890000000001
Jackson Hts - Roosevelt Av,52.958000000000006
Kew Gardens - Union Tpke,804.261
Cypress Hills,482.531
68th St - Hunter College,734.3779999999999
86th St,598.6639999999998
15th St - Prospect Park,749.3799999999999
88th St,604.4830000000001
181st St,564.0500000000001
90th St - Elmhurst Av,634.1510000000001
75th St - Eldert Ln,543.886
79th St,598.6639999999998
80th St,604.4830000000001
59th St,1308.2009999999998
Astor Pl,155.477
Junction Blvd,599.997
110th St,1173.8999999999999
Church Ave,1635.7330000000002
Liberty Ave,465.29
Burke Ave,667.4000000000001
Aqueduct Racetrack,0.0
Aqueduct - North Conduit Av,0.0
8th St - NYU,155.477
Astoria Blvd,754.584
39th Ave,495.83899999999994
Bergen St,422.489
Alabama Ave,571.4689999999999
Ave J,798.9250000000001
18th Ave,436.201
Ave H,798.9250000000001
Ave J,1427.714
Ave P,690.999
Kings Hwy,634.647
Gravesend - 86th St,896.7840000000001
Gravesend - 86th St,496.913
Gravesend - 86th St,782.816
25th Ave,715.7600000000001
Bay Ridge Ave,2086.0580000000004
59th St,932.616
Eastchester - Dyre Ave,1935.4439999999995
Beach 98th St,781.4899999999999
Beach 36th St,834.7099999999999
Beach 44th St,737.657
Beach 36th St,737.657
Beach 67th St,723.8639999999999
Beach 60th St,723.8639999999999
Beach 98th St,978.4169999999999
Beach 105th St,781.4899999999999
Classon Ave,578.635
Metropolitan Ave,786.2320000000001
Mosholu Pkwy,747.692
Bedford Park Blvd,772.0150000000001
Atlantic Av - Barclay's Center,422.489
Cortelyou Rd,478.207
Broadway - Lafayette St,169.228
Court St,392.127
Eastern Pkwy - Bklyn Museum,433.13300000000004
Lower East Side - 2nd Ave,606.5559999999999
Whitehall St,255.443
Jamaica - Van Wyck,1032.2569999999998
Ocean Pkwy,618.9090000000001
Beach 90th St,3153.0619999999994
Rector St,210.033
Hewes St,295.546
Bleecker St,169.228
Bushwick - Aberdeen,430.469
Pelham Pkwy,930.0910000000001
Cypress Ave,455.774
City Hall,333.309
Ave H,1543.9090000000003
Middletown Rd,466.829
Allerton Ave,667.4000000000001
183rd St,584.0070000000001
Broadway Junction,430.469
Canal St - Holland Tunnel,504.73699999999997
Franklin St,268.401
E 105th St,1087.5679999999998
Smith - 9th Sts,863.4250000000001
Zerega Ave,454.236
Central Park North (110th St),667.445
Knickerbocker Ave,658.02
116th St,399.128
City Hall,219.18
Bushwick - Aberdeen,587.261
W 4th St - Washington Sq (Upper),244.21499999999997
Ditmas Ave,969.2439999999999
Chambers St,219.18
Court St,482.27099999999996
Bedford - Nostrand Aves,578.635
Van Siclen Ave,629.669
Fulton St,747.7270000000001
Neptune Ave,1143.806
Beverly Rd,478.207
World Trade Center,296.13199999999995
Court Sq - 23rd St,85.596
Court Sq,85.596
Borough Hall,392.127
Norwood Ave,550.554
Kingston Ave,702.1659999999999
Brook Ave,455.774
75th St - Eldert Ln,482.531
Nevins St,306.154
Bowery,616.9599999999999
18th Ave,637.7090000000001
190th St,1171.011
Canarsie - Rockaway Pkwy,1087.5679999999998
E 149th St,455.875
E 143rd St - St Mary's St,455.875
West Farms Sq - E Tremont Av,698.567
Delancey St - Essex St,632.0889999999999
Baychester Ave,1935.4439999999995
Botanic Garden,433.13300000000004
Morrison Av - Soundview,415.76
Grand Ave - Newtown,766.167
Grant Ave,678.4020000000002
Beach 25th St,845.6300000000001
Mets - Willets Point,1435.185
Broadway,592.18
182nd-183rd Sts,631.637
Seneca Ave,579.25
67th Ave,888.587
Botanic Garden,562.182
Nostrand Ave,492.615
Canal St - Holland Tunnel,268.401
Simpson St,713.717
Forest Ave,1017.672
Church Ave,1305.847
Lafayette Ave,140.85399999999998
Halsey St,575.186
Lorimer St,423.041
Bergen St,709.4789999999998
Elmhurst Ave,766.167
5th Ave - Bryant Pk,503.69399999999996
Montrose Ave,475.83700000000005
Euclid Ave,678.4020000000002
Ave X,496.913
Nassau Ave,884.903
Burke Ave,725.494
Gates Ave,575.186
155th St,956.895
34th St - Penn Station,370.447
Broadway,295.546
Clark St,488.662
Spring St,410.31500000000005
Aqueduct Racetrack,1713.501
DeKalb Ave,519.6990000000001
Jay St - MetroTech,299.46200000000005
21st St,395.875
Simpson St,668.1859999999999
Simpson St,399.96000000000004
215th St,450.4959999999999
Prospect Ave,831.953
74th St - Broadway,52.958000000000006
169th St,907.855
Sutphin Blvd,769.9749999999999
Sutphin Blvd - Archer Av,605.8969999999999
Hoyt St,299.46200000000005
Myrtle - Wyckoff Aves,1189.4050000000002
103rd St - Corona Plaza,569.848
Livonia Ave,170.551
75th Ave,804.261
Ave P,634.647
Fordham Rd,722.594
Nostrand Ave,843.437
Crown Hts - Utica Ave,702.1659999999999
Central Ave,658.02
Gates Ave,693.4599999999999
Fulton St,140.85399999999998
51st St,472.32
Lexington Ave - 63rd St,625.543
68th St - Hunter College,397.805
Alabama Ave,465.29
Junius St,170.551
Court Sq - 23rd St,265.79900000000004
Prospect Ave,581.863
Metropolitan Ave,272.73
Broadway - Lafayette St,540.6160000000001
231st St,663.023
Hewes St,418.028
Lorimer St,272.73
Flushing - Main St,1435.185
Fresh Pond Rd,2081.1130000000007
Buhre Ave,466.829
Grand St,475.83700000000005
Montrose Ave,743.64
Pelham Pkwy,996.414
Elder Ave,415.76
Bedford Park Blvd,747.692
176th St,542.851
Seneca Ave,536.512
Central Ave,1015.3080000000002
Flushing Ave,670.384
Greenpoint Ave,884.903
Sheepshead Bay,918.733
Ave X,954.6099999999999
233rd St,619.9869999999999
DeKalb Ave,306.154
Pennsylvania Ave,944.564
62nd St,238.388
Cortelyou Rd,743.127
46th St,719.2519999999998
Mosholu Pkwy,883.512
Crescent St,550.554
Franklin Ave - Fulton St,492.615
Brighton Beach,618.9090000000001
111th St,567.807
Franklin Ave,930.5319999999999
St Lawrence Ave,678.6770000000001
Prospect Park,873.273
Sutphin Blvd,659.5860000000001
Buhre Ave,785.165
Bronx Park East,930.0910000000001
Livonia Ave,612.416
Franklin Ave,839.66
Broadway - Lafayette St,222.71999999999997
Intervale Ave,499.2130000000001
Parkside Ave,873.273
Queensboro Plz,351.43499999999995
Queens Plz,351.43499999999995
Rockaway Ave,860.499
Wall St,176.812
Chauncey St,657.9330000000001
104th St,533.07
Beach 105th St,880.3280000000002
21st St - Queensbridge,2515.542
Sutter Ave - Rutland Road,744.9649999999999
Myrtle - Wyckoff Aves,536.512
Neck Rd,918.733
Euclid Ave,764.0380000000001
Intervale Ave,399.96000000000004
4th Av - 9th St,629.5519999999999
Whitehall St,178.18800000000002
Houston St,410.31500000000005
Morrison Av - Soundview,635.9700000000001
46th St,849.0609999999999
President St,996.228
Parsons Blvd,659.5860000000001
Jamaica Ctr - Parsons / Archer,605.8969999999999
Livonia Ave,665.294
Saratoga Ave,744.9649999999999
42nd St - Bryant Pk,281.563
Burnside Ave,675.829
3rd Ave,480.173
Atlantic Av - Barclay's Center,948.0550000000001
Ralph Ave,864.545
238th St,635.8539999999999
Cleveland St,629.669
21st St,361.406
W 4th St - Washington Sq (Upper),0.0
W 4th St - Washington Sq (Lower),0.0
Ocean Pkwy,654.468
Nereid Ave (238 St),644.961
Rector St,176.812
E 180th St,698.567
Zerega Ave,537.389
South Ferry,178.18800000000002
Hunts Point Ave,686.923
Chauncey St,1073.716
Parkside Ave,1192.144
104th-102nd Sts,686.104
Grand Ave - Newtown,937.205
Mosholu Pkwy,1087.3210000000001
69th St,599.379
Chambers St,236.199
High St,493.606
Castle Hill Ave,454.236
Binary file added data/processed/nearest/nyc_streets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/processed/nearest/plots/14th St-6th Ave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/processed/nearest/plots/18th Ave-Ave I.png
Binary file added data/processed/nearest/plots/18th St-14th St.png
Binary file added data/processed/nearest/plots/1st Ave-3rd Ave.png
Binary file added data/processed/nearest/plots/20th Ave-Ave N.png
Binary file added data/processed/nearest/plots/23rd St-33rd St.png
Binary file added data/processed/nearest/plots/28th St-33rd St.png
Binary file added data/processed/nearest/plots/33rd St-23rd St.png
Binary file added data/processed/nearest/plots/40th St-52nd St.png
Binary file added data/processed/nearest/plots/45th St-53rd St.png
Binary file added data/processed/nearest/plots/49th St-50th St.png
Binary file added data/processed/nearest/plots/50th St-49th St.png
Binary file added data/processed/nearest/plots/53rd St-59th St.png
Binary file added data/processed/nearest/plots/55th St-62nd St.png
Binary file added data/processed/nearest/plots/59th St-53rd St.png
Binary file added data/processed/nearest/plots/65th St-69th St.png
Binary file added data/processed/nearest/plots/6th Ave-14th St.png
Binary file added data/processed/nearest/plots/79th St-86th St.png
Binary file added data/processed/nearest/plots/80th St-88th St.png
4 changes: 2 additions & 2 deletions src/data/closest_stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def calculate_walking_distances(nodes,graph, eculid_distances, no_candidates=30)
for dest_station in list(nearest_candidates):
if (dest_station, origin_station) not in distances.keys():
dest_node = nodes[dest_station]
distance = nx.shortest_path_length(graph, origin_node, dest_node)
distance = nx.shortest_path_length(graph, origin_node, dest_node, weight='length')
distances[(origin_station,dest_station)] = distance
done+=1
if(done%100==0):
Expand All @@ -74,7 +74,7 @@ def plot_route(graph, origin, destination):
west = min(o['x'],d['x'])
padding = 0.01
local_graph = ox.truncate.truncate_graph_bbox(graph, north+padding,south -padding, east+padding,west-padding)
return ox.plot.plot_graph_route(local_graph, nx.shortest_path(graph,origin,destination),show=False)
return ox.plot.plot_graph_route(local_graph, nx.shortest_path(graph,origin,destination, weight='length'),show=False)

def plot_all_routes(graph,nodes,routes):
path = PROCESSED_DATA_PATH / "plots"
Expand Down

0 comments on commit 501ab4f

Please sign in to comment.