momepy.
SquareCompactness
Calculates compactness index of each object in given GeoDataFrame.
Adapted from [Fel18].
GeoDataFrame containing objects
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.
np.array
pd.Series
None
the name of the dataframe column, np.array, or pd.Series where is stored perimeter value. If set to None, function will calculate perimeters during the process without saving them separately.
Examples
>>> buildings_df['squ_comp'] = momepy.SquareCompactness(buildings_df).series >>> buildings_df['squ_comp'][0] 0.6193872538650996
Series containing resulting values
original GeoDataFrame
Series containing used area values
Series containing used perimeter values
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf[, areas, perimeters])
Initialize self.