momepy.Convexity

class momepy.Convexity(gdf, areas=None)[source]

Calculates Convexity index of each object in given GeoDataFrame.

\[area \over \textit{convex hull area}\]

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['convexity'] = momepy.Convexity(buildings_df).series
>>> buildings_df['convexity'][0]
0.8151964258521672
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.