momepy.
SharedWallsRatio
Calculate shared walls ratio of adjacent elements (typically buildings)
Note that data needs to be topologically correct. Overlapping polygons will lead to incorrect results.
Adapted from [HLM12].
GeoDataFrame containing gdf to analyse
the name of the dataframe column, np.array, or pd.Series where is stored perimeter value
np.array
pd.Series
Examples
>>> buildings_df['swr'] = momepy.SharedWallsRatio(buildings_df).series >>> buildings_df['swr'][10] 0.3424804411228673
Series containing resulting values
original GeoDataFrame
Series containing used perimeters values
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf[, unique_id, perimeters])
Initialize self.