momepy.CircularCompactness¶
-
class
momepy.
CircularCompactness
(gdf, areas=None)[source]¶ Calculates compactness index of each object in given GeoDataFrame.
\[area \over \textit{area of enclosing circle}\]Adapted from [DPR+17].
- Parameters
- gdfGeoDataFrame
GeoDataFrame containing objects
- areasstr, list, np.array, pd.Series (default None)
the name of the dataframe column,
np.array
, orpd.Series
where is stored area value. If set toNone
, 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
Series containing resulting values
- gdfGeoDataFrame
original GeoDataFrame
- areasSeries
Series containing used area values
Methods
__init__
(gdf[, areas])Initialize self.