momepy.Rectangularity#
- class momepy.Rectangularity(gdf, areas=None)[source]#
Calculates the rectangularity of each object in a given GeoDataFrame.
\[{area \over \textit{minimum bounding rotated rectangle area}}\]Adapted from [Dibble et al., 2017].
- Parameters:
- gdfGeoDataFrame
A GeoDataFrame containing objects.
- areasstr, list, np.array, pd.Series (default None)
The name of the dataframe column,
np.array
, orpd.Series
where area values stored. If set toNone
, this function will calculate areas during the process without saving them separately.
Examples
>>> buildings_df['rect'] = momepy.Rectangularity(buildings_df, 'area').series 100%|██████████| 144/144 [00:00<00:00, 866.62it/s] >>> buildings_df.rect[0] 0.6942676157646379
- Attributes:
- seriesSeries
A Series containing resulting values.
- gdfGeoDataFrame
The original GeoDataFrame.
- areasSeries
A Series containing used area values.
Methods
__init__
(gdf[, areas])