An assessment of bike networks and their connectivity using Python GTECH 731 Final Project - Eric Svenson Cyclable cities An assessment of bike networks and their connectivity using Python
NYC: A “bike Friendly” City The Bloomberg and De Blasio administrations added over 400 miles of bike lanes between 2006 and 2015 Have recently made it on many lists for top “bike friendly” cities because of these additions “Sustainable Streets” – NYC’s 2009 transportation initiative - uses bike lane additions as the main determining factor for increased ridership Ridership doubled between 2007 and 2011
Lanes make a network The number of lanes in a network is not the best determinant of ridership Connectivity is a more important factor in the amount of use of a bike network (Schoner & Levinson 2014) Can people get to where they need to go safely?
Objectives Write a Python script that prepares bike network shapefiles in a standardized way so they can be read into networkx Use networkx to generate network information and connectivity statistics for the bike network Compare connectivity for different cities; cities with high connectivity serve as models for cities with lower connectivity Evaluate the script’s ability to achieve objectives
WHY Networkx? Network datasets in geodatabases could provide similar information, but... There is limited ability to quickly automate the creation of networks in a geodatabase No standardized way to create and maintain bike network datasets between cities Shapefile format is most common for bike lane data Networkx is fast, and has many algorithms and functions specific to networks
Data New York City bike routes shapefile (2015) Department of Transportation Data Feeds Polyline shape data – many small line segments, not useable as such in networkx Standardize: edges meeting only at intersections and ends Each segment contains street name, among other attributes Various other city government websites for other bike network shapefiles (San Francisco, Pasadena, Atlantic City)
Prepping Shapefiles: Arcpy Goals: Dissolve street polylines so that there are vertices only at intersections and ends/beginnings Make script easily useable for any user (no paths hard-coded in script) Do it quickly!
ArCPY
ArCPY (Cont.)
Arcpy result Edge shapefile where vertices are only at intersections and dangling ends (points shown for visualization only)
GDAl: The “ogr” under The Bridge Geospatial Data Abstraction Library: a raster/vector translator OGR Spatial Library – simple vector features Key function: “read_shp”, which reads shapefiles into a networkx digraph Installation not a simple process Install GDAL core for specific Python version/build Configure system path: for GDAL and your python.exe Install python bindings Work around other GDAL versions Make sure your python IDE also has other modules needed!
Help with gdal Installing GDAL for Windows: https://pythongisandstuff.wordpress.com/2011/07/07/installing- gdal-and-ogr-for-python-on-windows/
OGR at work
Networkx: take it and run Once in Networkx, must make the resulting directional graph an undirected graph (no to/from data) Can make use of any functions/algorithms that aren’t specifically used for digraphs Can use results of these in your own functions
NetworkX
New york
Pasadena, california
Atlantic City, New jersey
evaluation Gamma index produced more consistent and expected results, and showed fairly low connectivity. Run time fairly low: 30 seconds – 1 minute depending on shapefile size Alpha index (coefficient representing number of possible circuits in largest subgraph) shows very low number of circuits for all cities. Something lost (or gained) in conversion from digraph to graph? May need tweaking if no “street” field
Future research With more time: compare to cities with best-rated bike networks, test indices for accuracy Use more descriptive algorithms with Networkx to get a better picture (e.g. clustering of nodes) Determine a way to test how resulting indices would differ from random distribution How does layout of cities affect results? Historical comparison of bike lanes, change in connectivity NYC from 2006 to 2015 and beyond
sources Schoner, J., & Levinson, D. (2014). The missing link: bicycle infrastructure networks and ridership in 74 US cities. Transportation, 41(6), 1187-1204. doi:10.1007/s11116- 014-9538-1 Nyc.gov,. (2015). NYC DOT - Bicyclists - Network and Statistics. Retrieved 1 May 2015, from http://www.nyc.gov/html/dot/html/bicyclists/bikestats.shtml#network Nyc.gov,. (2015). NYC DOT - Data Feeds. Retrieved 13 May 2015, from http://www.nyc.gov/html/dot/html/about/datafeeds.shtml