Screenshot 1: Showing how some streets are not being counted. There should be a yellow section of road between the two existing yellow road sections.
A friend recently asked me how many blocks of road are in his ward. He wanted to know so that he could measure how many blocks of streets would have an older style of street lighting after X number of blocks receive the new style of street lighting. For this project, I used two datasets from Chicago’s open data portal: street center lines and wards. The output data is not very accurate as there may be some overlap and some uncounted street segments; this is likely due to a shortcoming in my process. I will show you how to find the number of blocks per ward using QGIS (download Quantum GIS, a free program for all OSes).
Here’s how I did it
- Load in the two datasets. Wards and street center lines (zipped shapefiles). They are projected in EPSG:3435.
- Exclude several road classifications in the street center lines by querying only for
"CLASS" > '1' AND "CLASS" < '5'. The data dictionary for the road classifications is at the end. We don’t want the river, sidewalks, expressways, and any ramps to be included in the blocks per ward analysis.
- Intersect. In QGIS, select Vector>Geoprocessing Tools>Intersect. The input vector layer is “Transportation” (the name of the street center lines dataset) and the intersect layer is “Wards”. Save the resulting shapefile as “streets intersect wards”. Click OK. This will take a while.
- Add the “streets intersect wards” shapefile to the table of contents.
- You’ll notice some of the issues with the resulting shapefile: missing street segments (see screenshot 1). What should QGIS do if a street is a ward boundary?
- Obtain street length information, part 1. Remove all the columns in the “streets intersect wards” shapefile that have something to do with geometry. These are now outdated and will confuse you when you add a geometry column generated by QGIS.
- Obtain street length information, part 2. With the “streets intersect wards” shapefile selected in the table of contents, select Vector>Geometry Tools>Export/Add geometry columns. Select “streets intersect wards” shapefile as your input layer, leave CRS as “Layer CRS” and save as new shapefile “streets intersect wards geom”.
- Add the “streets intersect wards geom” shapefile to the table of contents.
- You will see a new column at the end of the attribute table called LENGTH. Since the data is projected in EPSG:3435 (Illinois StatePlane NAD83 East Feet), the unit is feet.
- Simply export “streets intersect wards geom” to a CSV file and open the CSV file in a spreadsheet application. From there you can group the data by Ward number and add the street lengths together. (I thought it would be faster to do this in a database so I imported it into a localhost MySQL database and ran a simple query,
SELECT wardNum, sum(`chistreets_classes234`.`LENGTH`) as sum FROM chistreets_classes234 WHERE ward > 0 group by wardNum. I then exported this to a spreadsheet to convert feet to miles.)
Because of the errors described in step 5, you shouldn’t use this analysis for any application where accuracy is important. There are road lengths missing in the output dataset (table with street lengths summed by ward) and I cannot tell if the inaccuracy is equally distributed.
percentage of total
Wards 19 (south side) and 41 (Norwood Park, including O’Hare airport) have the highest portion of street length in the city.
Screenshot 2: Ward 41 is seen.
Street data dictionary
Column is “CLASS”. The value is a string. This dataset lacks alleys. Adapted from the City’s data dictionary.
2. Arterials (1 mile grid, no diagonals)
3. Collectors (includes diagonals)
4. Other streets (side streets, neighborhood streets)
5. Named alleys (mostly downtown, like Couch Place and Garland Place)
7. Tiered (lower level streets, including LaSalle, Michigan, Columbus, and Wacker)
9. Ramps (goes along with expressway)
E. Extent (not sure how to describe these; includes riverwalk and lake walk segments, and Navy Pier, also includes some streets, like Mies van der Rohe Way)
About Steven Can Plan
I started this blog in 2007 as the writing assignment for an introductory urban planning class at UIC. It's about cities (mainly Chicago), GIS oftentimes, and transportation (mainly bicycling). Learn more about me, Steven Vance. I also write for Streetsblog Chicago.
Steven Can Plan is hosted on Dreamhost.
Chicago Bike Map App
The Chicago Bike Map app is a bike and street map stored entirely in your iOS device – no data connection required. The map is designed to look much like the City of Chicago's official printed and online bike map. The app works on iPhone, iPod touch, and iPad.
Highly Recommended Bike Products
So far my longest trip was 40 miles on this saddle. It molds to your butt like Birkenstock sandals mold to your feet. The springs make the bike ride a little more comfortable and more fun (weird, because you bounce up and down on them). It also looks gorgeous. Comes in 3 colors - I got black.
The best value taillight. It has three red LEDs that alternate and provide extreme brightness. I have two of these.
Sustainable Transportation Planning: Tools for Creating Vibrant, Healthy, and Resilient Communities (Wiley Series in Sustainable Design) by Jeffrey Tumlin
I was sent a review copy. I'm really excited to open it up and start reading because I've been disappointed with textbooks in the past that don't focus on bicycle and pedestrian planning.
Making Maps: A Visual Guide to Map Design for GIS by John Krygier PhD, Denis Wood PhD
If you are going to make a map, whether it be hand drawn or digital, you should really give this book a read. Then read it every time you make a map. It will help make sure your maps are laid out sensibly, in a way that others can easily read, and that it doesn't include fluff or unnecessary data.
Instant City: Life and Death in Karachi by Steve Inskeep
I reviewed this book that the publisher sent to me.