momepy.
WeightedCharacter
(gdf, values, spatial_weights, unique_id, areas=None)[source]¶Calculates the weighted character
Character weighted by the area of the objects within k topological steps defined in spatial_weights.
GeoDataFrame containing objects to analyse
the name of the gdf dataframe column, np.array, or pd.Series where is stored character to be weighted
spatial weights matrix - If None, Queen contiguity matrix of set order will be calculated based on left.
name of the column with unique id used as spatial_weights index.
the name of the left dataframe column, np.array, or pd.Series where is stored area value
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.
Examples
>>> sw = libpysal.weights.DistanceBand.from_dataframe(tessellation_df, threshold=100, silence_warnings=True)
>>> buildings_df['w_height_100'] = momepy.WeightedCharacter(buildings_df, values='height', spatial_weights=sw,
unique_id='uID').series
100%|██████████| 144/144 [00:00<00:00, 361.60it/s]
Series containing resulting values
original GeoDataFrame
Series containing used values
Series containing used areas
spatial weights matrix
Series containing used unique ID
__init__
(self, gdf, values, spatial_weights, unique_id, areas=None)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |