momepy.convexity#
- momepy.convexity(geometry)[source]#
Calculates the convexity of each object given its geometry.
\[\frac{\textit{area}}{\textit{area of convex hull}}\]Adapted from [Dibble et al., 2017].
- Parameters:
- geometryGeoDataFrame | GeoSeries
A GeoDataFrame or GeoSeries containing polygons to analyse.
- Returns:
- Series
Examples
>>> path = momepy.datasets.get_path("bubenec") >>> buildings = geopandas.read_file(path, layer="buildings") >>> momepy.convexity(buildings) 0 0.815196 1 0.703008 2 0.953398 3 0.890489 4 0.957323 ... 139 1.000000 140 0.904176 141 0.795774 142 1.000000 143 1.000000 Length: 144, dtype: float64