momepy.
BlocksCount
Calculates the weighted number of blocks
Number of blocks within neighbours defined in spatial_weights.
spatial_weights
Adapted from [DPR+17].
GeoDataFrame containing morphological tessellation
the name of the objects dataframe column, np.array, or pd.Series where is stored block ID.
np.array
pd.Series
spatial weights matrix
name of the column with unique id used as spatial_weights index
return value weighted by the analysed area (True) or pure count (False)
True
False
if True, shows progress bars in loops and indication of steps
Examples
>>> sw4 = mm.sw_high(k=4, gdf='tessellation_df', ids='uID') >>> tessellation_df['blocks_within_4'] = mm.BlocksCount(tessellation_df, 'bID', sw4, 'uID').series
Series containing resulting values
original GeoDataFrame
Series containing used block ID
Series containing used unique ID
used weighted value
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf, block_id, spatial_weights, …)
Initialize self.