Cities are networks. Networks of people, networks of companies, networks of public transport, networks of water supply, networks of energy distribution… but also networks of streets. However, this later type of network has an added value: spatial information, including the Euclidean position of each node or link.

This feature allows us for calculating a huge amount of indicators to analyze its structure, connectedness, centrality and so on. In this example I have tried to guess how far is each building from all the others buildings in the city of Barcelona.

To do so, it is a good idea to look for centrality measures –how central is each link in the network- and more specifically how far is every building from all the other buildings. Specifically, it can be done by calculating a measure called “

This feature allows us for calculating a huge amount of indicators to analyze its structure, connectedness, centrality and so on. In this example I have tried to guess how far is each building from all the others buildings in the city of Barcelona.

To do so, it is a good idea to look for centrality measures –how central is each link in the network- and more specifically how far is every building from all the other buildings. Specifically, it can be done by calculating a measure called “

*Farness*”:*Formula 1: Farness centrality according to sDNA*

Where,

*Rx*is the set of polylines in the network radius from link*x**d*is the distance according to a metric*M*, between an origin*x*and a destination*y**W*is the weight of the polyline*y**P*is the proportion of the polyline*y*within the radius (in this case*n*)The results of the formula applied to Barcelona’s street network can be seen in the small map on the top-left corner in Figure 1 (click to enlarge). However, even more interesting than knowing how far is each street segments from the rest of segments in the network, is analyzing this information at the building level.

*Figure 1: Farness centrality in Barcelona at building level*

Thanks to Barcelona’s Open Data webpage we can access the building information of the city. After downloading it is just a matter of joining information by geolocation. To complicate a little bit more the results I have added a buffer information of 50m around each building and calculated the average

*Farness*. I did so to control for buildings with access to one major arteria but surrounded by streets with high values of Farness.**EXTRA BALL:**the calculation is using the angular distance metric. In opposition to the everyday notion of distance called Euclidean (How far is that place? X meters or Y kilometers), the angular metric measures distance in terms of angular change; i.e. corners on links and turns at junctions. Since our brain is not as powerful as we tend to think, using angular paths is less intense in terms of cognitive needs, thus we tend to choose this kind of path taking (except we already know the details of the area we are moving on).