momepy.elongation

momepy.elongation(geometry)[source]

Calculates the elongation of each object given its geometry.

Elongation is measured as the ratio of the shorter to the longer side of the minimum rotated rectangle:

\[\frac{\min(d_1, d_2)}{\max(d_1, d_2)}\]

where \(d_1\) and \(d_2\) are the side lengths of the minimum rotated rectangle of the polygon.

Based on [Gil et al., 2012], who refer to sides as width and length.

Parameters:
geometry : GeoDataFrame | GeoSeries

A GeoDataFrame or GeoSeries containing polygons to analyse.

Return type:

Series

Examples

>>> path = momepy.datasets.get_path("bubenec")
>>> buildings = geopandas.read_file(path, layer="buildings")
>>> momepy.elongation(buildings)
0      0.908244
1      0.581318
2      0.726529
3      0.838840
4      0.727277
         ...
139    0.607990
140    0.979998
141    0.747320
142    0.564060
143    0.987953
Name: elongation, Length: 144, dtype: float64