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['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

__init__(gdf, areas=None)[source]

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

Methods

__init__(gdf[, areas])

Initialize self.