momepy.NodeDensity

class momepy.NodeDensity(left, right, spatial_weights, weighted=False, node_degree=None, node_start='node_start', node_end='node_end')[source]

Calculate the density of nodes neighbours on street network defined in spatial_weights.

Calculated as number of neighbouring nodes / cummulative length of street network withinn eighbours. node_start and node_end is standard output of momepy.nx_to_gdf() and is compulsory.

\[\]
Parameters:
left : GeoDataFrame

GeoDataFrame containing nodes of street network

right : GeoDataFrame

GeoDataFrame containing edges of street network

spatial_weights : libpysal.weights

spatial weights matrix capturing relationship between nodes within set topological distance

weighted : bool (default False)

if True density will take into account node degree as k-1

node_degree : str (optional)

name of the column of left gdf containing node degree. Used if weighted=True

node_start : str (default ‘node_start’)

name of the column of right gdf containing id of starting node

node_end : str (default ‘node_end’)

name of the column of right gdf containing id of ending node

Examples

>>> nodes['density'] = mm.NodeDensity(nodes, edges, sw).series
Attributes:
series : Series

Series containing resulting values

left : GeoDataFrame

original left GeoDataFrame

right : GeoDataFrame

original right GeoDataFrame

node_start : Series

Series containing used ids of starting node

node_end : Series

Series containing used ids of ending node

sw : libpysal.weights

spatial weights matrix

weighted : bool

used weighted value

node_degree : Series

Series containing used node degree values

References
———
Dibble J, Prelorendjos A, Romice O, et al. (2017) On the origin of spaces: Morphometric foundations of urban form evolution.
Environment and Planning B: Urban Analytics and City Science 46(4): 707–730.
__init__(self, left, right, spatial_weights, weighted=False, node_degree=None, node_start='node_start', node_end='node_end')[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, left, right, spatial_weights) Initialize self.