momepy.elongation#
- momepy.elongation(geometry)[source]#
Calculates the elongation of each object given its geometry.
The elongation is defined as the elongation of the minimum bounding rectangle.
\[{{p - \sqrt{p^2 - 16a}} \over {4}} \over {{{p} \over {2}} - {{p - \sqrt{p^2 - 16a}} \over {4}}}\]where a is the area of the object and p its perimeter.
Based on [Gil et al., 2012].
- 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.elongation(buildings) 0 0.908244 1 0.581318 2 0.726527 3 0.838840 4 0.727294 ... 139 0.608004 140 0.979998 141 0.747326 142 0.564060 143 0.987953 Name: elongation, Length: 144, dtype: float64