69
69
" - Loading a network from disk\n " ,
70
70
" - Visualizing the network\n " ,
71
71
" - Adding average headways to network travel time\n " ,
72
- " - Using a UrbanAccess network with Pandana"
72
+ " - Using an UrbanAccess network with Pandana"
73
73
]
74
74
},
75
75
{
82
82
" matplotlib.use('agg') # allows notebook to be tested in Travis\n " ,
83
83
" \n " ,
84
84
" import pandas as pd\n " ,
85
+ " import cartopy.crs as ccrs\n " ,
86
+ " import cartopy\n " ,
87
+ " import matplotlib.pyplot as plt\n " ,
85
88
" import pandana as pdna\n " ,
86
89
" import time\n " ,
87
90
" \n " ,
95
98
" %matplotlib inline"
96
99
]
97
100
},
98
- {
99
- "cell_type" : " code" ,
100
- "execution_count" : null ,
101
- "metadata" : {
102
- "collapsed" : true
103
- },
104
- "outputs" : [],
105
- "source" : [
106
- " # Pandana currently uses depreciated parameters in matplotlib, this hides the warning until its fixed\n " ,
107
- " import warnings\n " ,
108
- " import matplotlib.cbook\n " ,
109
- " warnings.filterwarnings(\" ignore\" ,category=matplotlib.cbook.mplDeprecation)"
110
- ]
111
- },
112
101
{
113
102
"cell_type" : " markdown" ,
114
103
"metadata" : {
146
135
{
147
136
"cell_type" : " code" ,
148
137
"execution_count" : null ,
149
- "metadata" : {
150
- "collapsed" : true
151
- },
138
+ "metadata" : {},
152
139
"outputs" : [],
153
140
"source" : [
154
141
" settings.log_console = True"
166
153
{
167
154
"cell_type" : " code" ,
168
155
"execution_count" : null ,
169
- "metadata" : {
170
- "collapsed" : true
171
- },
156
+ "metadata" : {},
172
157
"outputs" : [],
173
158
"source" : [
174
159
" settings.log_console = False"
506
491
{
507
492
"cell_type" : " code" ,
508
493
"execution_count" : null ,
509
- "metadata" : {
510
- "collapsed" : true
511
- },
494
+ "metadata" : {},
512
495
"outputs" : [],
513
496
"source" : [
514
497
" urbanaccess_net = ua.network.ua_network"
1218
1201
{
1219
1202
"cell_type" : " code" ,
1220
1203
"execution_count" : null ,
1221
- "metadata" : {
1222
- "collapsed" : true
1223
- },
1204
+ "metadata" : {},
1224
1205
"outputs" : [],
1225
1206
"source" : [
1226
1207
" blocks_subset['node_id'] = transit_ped_net.get_node_ids(blocks_subset['x'], blocks_subset['y'])"
1250
1231
{
1251
1232
"cell_type" : " code" ,
1252
1233
"execution_count" : null ,
1253
- "metadata" : {
1254
- "collapsed" : true
1255
- },
1234
+ "metadata" : {},
1256
1235
"outputs" : [],
1257
1236
"source" : [
1258
1237
" transit_ped_net.set(blocks_subset.node_id, variable = blocks_subset.jobs, name='jobs')"
1320
1299
{
1321
1300
"cell_type" : " code" ,
1322
1301
"execution_count" : null ,
1323
- "metadata" : {
1324
- "scrolled" : true
1325
- },
1302
+ "metadata" : {},
1326
1303
"outputs" : [],
1327
1304
"source" : [
1328
- " # s_time = time.time()\n " ,
1329
- " # transit_ped_net.plot(jobs_15, \n " ,
1330
- " # plot_type='scatter',\n " ,
1331
- " # fig_kwargs={'figsize':[20,20]},\n " ,
1332
- " # bmap_kwargs={'epsg':'26943','resolution':'h'},\n " ,
1333
- " # plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n " ,
1334
- " # print('Took {:,.2f} seconds'.format(time.time() - s_time))"
1305
+ " s_time = time.time()\n " ,
1306
+ " \n " ,
1307
+ " fig = plt.subplots(figsize=(20,20))\n " ,
1308
+ " \n " ,
1309
+ " data_crs = ccrs.PlateCarree()\n " ,
1310
+ " ax = plt.axes(projection=ccrs.epsg(26943))\n " ,
1311
+ " ax.add_feature(cartopy.feature.GSHHSFeature(scale='full'), edgecolor='grey')\n " ,
1312
+ " \n " ,
1313
+ " plt.scatter(transit_ped_net.nodes_df.x, transit_ped_net.nodes_df.y, \n " ,
1314
+ " c=jobs_15, s=4, cmap='gist_heat_r', edgecolor='none', transform=data_crs)\n " ,
1315
+ " cb = plt.colorbar()\n " ,
1316
+ " \n " ,
1317
+ " print('Took {:,.2f} seconds'.format(time.time() - s_time))"
1335
1318
]
1336
1319
},
1337
1320
{
1338
1321
"cell_type" : " markdown" ,
1339
- "metadata" : {},
1322
+ "metadata" : {
1323
+ "pycharm" : {
1324
+ "name" : " #%% md\n "
1325
+ }
1326
+ },
1340
1327
"source" : [
1341
1328
" ### Jobs accessible within 30 minutes"
1342
1329
]
1347
1334
"metadata" : {},
1348
1335
"outputs" : [],
1349
1336
"source" : [
1350
- " # s_time = time.time()\n " ,
1351
- " # transit_ped_net.plot(jobs_30, \n " ,
1352
- " # plot_type='scatter',\n " ,
1353
- " # fig_kwargs={'figsize':[20,20]},\n " ,
1354
- " # bmap_kwargs={'epsg':'26943','resolution':'h'},\n " ,
1355
- " # plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n " ,
1356
- " # print('Took {:,.2f} seconds'.format(time.time() - s_time))"
1337
+ " s_time = time.time()\n " ,
1338
+ " \n " ,
1339
+ " fig = plt.subplots(figsize=(20,20))\n " ,
1340
+ " \n " ,
1341
+ " data_crs = ccrs.PlateCarree()\n " ,
1342
+ " ax = plt.axes(projection=ccrs.epsg(26943))\n " ,
1343
+ " ax.add_feature(cartopy.feature.GSHHSFeature(scale='full'), edgecolor='grey')\n " ,
1344
+ " \n " ,
1345
+ " plt.scatter(transit_ped_net.nodes_df.x, transit_ped_net.nodes_df.y, \n " ,
1346
+ " c=jobs_30, s=4, cmap='gist_heat_r', edgecolor='none', transform=data_crs)\n " ,
1347
+ " cb = plt.colorbar()\n " ,
1348
+ " \n " ,
1349
+ " print('Took {:,.2f} seconds'.format(time.time() - s_time))"
1357
1350
]
1358
1351
},
1359
1352
{
1369
1362
"metadata" : {},
1370
1363
"outputs" : [],
1371
1364
"source" : [
1372
- " # s_time = time.time()\n " ,
1373
- " # transit_ped_net.plot(jobs_45, \n " ,
1374
- " # plot_type='scatter',\n " ,
1375
- " # fig_kwargs={'figsize':[20,20]},\n " ,
1376
- " # bmap_kwargs={'epsg':'26943','resolution':'h'},\n " ,
1377
- " # plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n " ,
1378
- " # print('Took {:,.2f} seconds'.format(time.time() - s_time))"
1365
+ " s_time = time.time()\n " ,
1366
+ " \n " ,
1367
+ " fig = plt.subplots(figsize=(20,20))\n " ,
1368
+ " \n " ,
1369
+ " data_crs = ccrs.PlateCarree()\n " ,
1370
+ " ax = plt.axes(projection=ccrs.epsg(26943))\n " ,
1371
+ " ax.add_feature(cartopy.feature.GSHHSFeature(scale='full'), edgecolor='grey')\n " ,
1372
+ " \n " ,
1373
+ " plt.scatter(transit_ped_net.nodes_df.x, transit_ped_net.nodes_df.y, \n " ,
1374
+ " c=jobs_45, s=4, cmap='gist_heat_r', edgecolor='none', transform=data_crs)\n " ,
1375
+ " cb = plt.colorbar()\n " ,
1376
+ " \n " ,
1377
+ " print('Took {:,.2f} seconds'.format(time.time() - s_time))"
1379
1378
]
1380
- },
1381
- {
1382
- "cell_type" : " code" ,
1383
- "execution_count" : null ,
1384
- "metadata" : {
1385
- "collapsed" : true
1386
- },
1387
- "outputs" : [],
1388
- "source" : []
1389
- },
1390
- {
1391
- "cell_type" : " code" ,
1392
- "execution_count" : null ,
1393
- "metadata" : {
1394
- "collapsed" : true
1395
- },
1396
- "outputs" : [],
1397
- "source" : []
1398
- },
1399
- {
1400
- "cell_type" : " code" ,
1401
- "execution_count" : null ,
1402
- "metadata" : {
1403
- "collapsed" : true
1404
- },
1405
- "outputs" : [],
1406
- "source" : []
1407
- },
1408
- {
1409
- "cell_type" : " code" ,
1410
- "execution_count" : null ,
1411
- "metadata" : {
1412
- "collapsed" : true
1413
- },
1414
- "outputs" : [],
1415
- "source" : []
1416
1379
}
1417
1380
],
1418
1381
"metadata" : {
1436
1399
},
1437
1400
"nbformat" : 4 ,
1438
1401
"nbformat_minor" : 1
1439
- }
1402
+ }
0 commit comments