momepy.
Reached
(left, right, left_id, right_id, spatial_weights=None, mode='count', values=None)[source]¶Calculates the number of objects reached within neighbours on street network
Number of elements within neighbourhood defined in spatial_weights. If
spatial_weights are None, it will assume topological distance 0 (element itself).
If mode=’area’, returns sum of areas of reached elements. Requires unique_id
of network assigned beforehand (e.g. using momepy.get_network_id()
).
GeoDataFrame containing streets (either segments or nodes)
GeoDataFrame containing elements to be counted
the name of the left dataframe column, np.array, or pd.Series where is stored ID of streets (segments or nodes).
the name of the right dataframe column, np.array, or pd.Series where is stored ID of streets (segments or nodes).
spatial weights matrix
mode of calculation. If 'count'
function will return the count of reached elements.
If 'sum'
, it will return sum of 'values'
. If 'mean'
it will return mean value
of ‘`values’`. If ‘std’ it will return standard deviation
of 'values'
. If 'values'
not set it will use of areas
of reached elements.
the name of the objects dataframe column with values used for calculations
Examples
>>> streets_df['reached_buildings'] = mm.Reached(streets_df, buildings_df, 'uID').series
Series containing resulting values
original left GeoDataFrame
original right GeoDataFrame
Series containing used left ID
Series containing used right ID
mode of calculation
spatial weights matrix (if set)
__init__
(self, left, right, left_id, right_id, spatial_weights=None, mode='count', values=None)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |