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
leftGeoDataFrame

GeoDataFrame containing nodes of street network

rightGeoDataFrame

GeoDataFrame containing edges of street network

spatial_weightslibpysal.weights

spatial weights matrix capturing relationship between nodes within set topological distance

weightedbool (default False)

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

node_degreestr (optional)

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

node_startstr (default ‘node_start’)

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

node_endstr (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
seriesSeries

Series containing resulting values

leftGeoDataFrame

original left GeoDataFrame

rightGeoDataFrame

original right GeoDataFrame

node_startSeries

Series containing used ids of starting node

node_endSeries

Series containing used ids of ending node

swlibpysal.weights

spatial weights matrix

weightedbool

used weighted value

node_degreeSeries

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.