Geoff Boeing recently released two blog posts showing off how the OSMnx library can be used to show in which directions a city's streets go most often.

Oh look, it's vienna

Since I was wondering how other cities might look like, I decided to generate further charts myself, focussing on European capitals and the largest German and Austrian cities. I wrote a short (well, it kinda grew) script based on the IPython notebook. If you want to play around with it, the setup instructions should be clear, and I added some example data in the data directory to help you figure out which format to use.

OSMnx uses the nominatim API for OpenStreetMap, and it often happens that the first way you choose to look up a city fails, by producing a point in the center of the city instead of an area. By trying the variations in the data file, you should be able to find the boundaries of any city though, provided the boundaries have been submitted to OpenStreetMap.

European capitals

Isn't it cool how you can see the radial streets that some cities feature, or an alignment to the course of a river that expanded to be visible throughout the city?

Budapest and Vienna for example are very similarly built (which isn't accidental, of course, due to the intertwined history of the cities and their countr(ies|y), but since the Danube cuts through them at a different angle, their street orientations are likewise rotated.

German and Austrian cities

Some German cities feature a strong grid, while others just extend their streets in every direction. Some of those do it due to necessity, like Stuttgart, where the terrain is too complex to manage a consistent grid. Others have grown into too many directions, like Berlin, which relies not only on radial streets (which would be visible here), but also on ring streets connecting the different parts of the cities.

If you want to see your own city or town or village like this, give my script a try! After dropping the city names and descriptions in a json file, you can call the tool with python street_orientation.py check path/to/file to make sure you have no incorrect data in there, and then either generate individual images with python street_orientation.py single path/to/file or compose a grid like the ones above with python street_orientation.py list path/to/file.

If you use the script, feel free to share the resulting images (or request some, if you can't get it to run) - I'm happy to hear from you on mastodon or twitter.