momepy.EquivalentRectangularIndex
- momepy.EquivalentRectangularIndex(gdf, areas=None, perimeters=None)[source]
Calculates the equivalent rectangular index of each object in a given GeoDataFrame.
\[\sqrt{{area} \over \textit{area of bounding rectangle}} * {\textit{perimeter of bounding rectangle} \over {perimeter}}\]Based on [Basaraner and Cetinkaya, 2017].
- Parameters:
- gdfGeoDataFrame
A GeoDataFrame containing objects.
- areasstr, list, np.array, pd.Series (default None)
The name of the dataframe column,
np.array, orpd.Serieswhere area values are stored. If set toNone, this function will calculate areas during the process without saving them separately.- perimetersstr, list, np.array, pd.Series (default None)
The name of the dataframe column,
np.array, orpd.Serieswhere perimeter values are stored. If set toNone, the function will calculate perimeters during the process without saving them separately.
Examples
>>> buildings_df['eri'] = momepy.EquivalentRectangularIndex(buildings_df, ... 'area', ... 'peri').series >>> buildings_df['eri'][0] 0.7879229963118455
- Attributes:
- seriesSeries
A Series containing resulting values.
- gdfGeoDataFrame
The original GeoDataFrame.
- areasSeries
A Series containing used area values.
- perimetersSeries
A Series containing used perimeter values.