18 Creating a city block map

Street networkAreas enclosed by the streets form blocks

For some analyses, you might need data on blocks instead of street networks. This is needed for 9.1 and for other analysis you might explore, such as interface catchment analysis. If you’re lucky, you might have access to block data but in the event that you don’t, you can make something that is fairly accurate yourself.

This is fairly simple1. What you’re essentially doing is drawing polygons for the areas enclosed by the streets. Think of it like making cookies, you’re creating shapes by ‘cutting’ a flat layer with a cookie cutter (here, the roads).

First, open the gis_osm_roads layer in QGIS and then create a new shapefile layer called boundary by going to Layer > Create Layer > New Shapefile Layer. The default settings are good enough for this, save your layer to a new location and it will appear in your list of layers.

Go into edit mode and draw a rectangle that marks the extent of the area you want to analyze. Once saved, you should have two layers; the boundary on top of you gis_osm_roads layer like so:

Head over the Processing Toolbox and search for Buffer under Vector operations. In the dialog box, select your roads layer and set a Buffer value. All lines in the selected layer will be ‘widened’ by that much. I generally go with 5 meters, since most streets are likely to be a little less or more than.

This should ‘inflate’ the lines in your roads layer. Go to the Processing Toolbox again and search for Difference and open it.

Now, the base layer (extent) goes in the Input and the Buffered layer goes into Overlay.

An easy way to remember this is you’re cutting base using the buffered layer. Run it and you should get a new Difference layer which looks something like the map in Figure 18.1.

Figure 18.1:

There you have it! You’ve just created your own map of blocks in the study region.

One thing you’ll notice if you try querying individual features of this layer, the entire layer will be selected, making it impossible to select individual blocks. You can fix this by going to Processing Toolbox and searching for Multipart to Singlepart and running it the current layer. The new layer contains individually selectable blocks. That’s it!

Remember to save these layers, they’re temporary for now.