momepy.rectangularity#

momepy.rectangularity(geometry)[source]#

Calculates the rectangularity of each object given its geometry.

\[\frac{\textit{area}}{\textit{area of minimum bounding rectangle}}\]

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.rectangularity(buildings)
0      0.694268
1      0.702242
2      0.901582
3      0.821797
4      0.912858
         ...
139    0.996876
140    0.820865
141    0.659281
142    0.971600
143    0.999400
Length: 144, dtype: float64