momepy.CircularCompactness#
- class momepy.CircularCompactness(gdf, areas=None)[source]#
Calculates the compactness index of each object in a given GeoDataFrame.
\[area \over \textit{area of enclosing circle}\]Adapted from [Dibble et al., 2017].
- Parameters:
- gdfGeoDataFrame
A GeoDataFrame containing objects.
- areasstr, list, np.array, pd.Series (default None)
The name of the dataframe column,
np.array
, orpd.Series
where area values stored. If set toNone
, this function will calculate areas during the process without saving them separately.
Examples
>>> buildings_df['comp'] = momepy.CircularCompactness(buildings_df, 'area').series >>> buildings_df['comp'][0] 0.572145421828038
- Attributes:
- seriesSeries
A Series containing resulting values.
- gdfGeoDataFrame
The original GeoDataFrame.
- areasSeries
A Series containing used area values.
Methods
__init__
(gdf[, areas])