momepy.stroke_orthogonality#

momepy.stroke_orthogonality(stroke_graph)[source]#

Computes the stroke’s orthogonality. Orthogonality is defined as the average of the sine of the minimum angles between the stroke and the street segments it intersects:

\[O(s)=\frac{\sum_{i\in A}sin(\theta_i)}{C(s)}\]

Where \(\theta_i\) is the minimum angle between the street segment \(i\) and the stroke \(s\), and \(C(s)\) is the connectivity of the stroke \(s\).

Its value vary between 0 and 1, for low to right angles.

Adapted from [El Gouj et al., 2022].

Parameters:
stroke_graph: nx.Graph()

Stroke graph of a network, generated with momepy.coins_to_nx().

Returns:
stroke_graph: nx.Graph()

Returns stroke_graph where each node has acquired the additional attribute stroke_orthogonality; and the additional attribute stroke_connectivity (unless it has been present in the input graph).

Examples

>>> stroke_graph = stroke_orthogonality(stroke_graph)