momepy.Rectangularity#
- class momepy.Rectangularity(gdf, areas=None)[source]#
Calculates rectangularity of each object in given GeoDataFrame.
\[{area \over \textit{minimum bounding rotated rectangle area}}\]Adapted from [Dibble et al., 2017].
- Parameters
- gdfGeoDataFrame
GeoDataFrame containing objects
- areasstr, list, np.array, pd.Series (default None)
the name of the dataframe column,
np.array
, orpd.Series
where is stored area value. If set toNone
, 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
Series containing resulting values
- gdfGeoDataFrame
original GeoDataFrame
- areasSeries
Series containing used area values
Methods
__init__
(gdf[, areas])