momepy.SharedWallsRatio#
- class momepy.SharedWallsRatio(gdf, perimeters=None)[source]#
Calculate shared walls ratio of adjacent elements (typically buildings).
\[\textit{length of shared walls} \over perimeter\]Note that data needs to be topologically correct. Overlapping polygons will lead to incorrect results.
Adapted from [Hamaina et al., 2012].
- Parameters:
- gdfGeoDataFrame
A GeoDataFrame containing objects to analyse.
- perimetersstr, list, np.array, pd.Series (default None, optional)
The name of the dataframe column,
np.array
, orpd.Series
where perimeter values are stored.
See also
Examples
>>> buildings_df['swr'] = momepy.SharedWallsRatio(buildings_df).series >>> buildings_df['swr'][10] 0.3424804411228673
- Attributes:
- seriesSeries
A Series containing resulting values.
- gdfGeoDataFrame
The original GeoDataFrame.
- perimetersGeoDataFrame
A Series containing used perimeters values.
Methods
__init__
(gdf[, perimeters])