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, or pd.Series where is stored area value. If set to None, function will calculate areas during the process without saving them separately.

Examples

>>> buildings_df['circ_comp'] = momepy.CircularCompactness(buildings_df, 'area').series
100%|██████████| 144/144 [00:00<00:00, 2498.75it/s]
>>> buildings_df['circ_comp'][0]
0.572145421828038
Attributes
seriesSeries

Series containing resulting values

gdfGeoDataFrame

original GeoDataFrame

areasSeries

Series containing used area values

__init__(self, gdf, areas=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, gdf[, areas])

Initialize self.