momepy.CourtyardIndex#
- class momepy.CourtyardIndex(gdf, courtyard_areas, areas=None)[source]#
Calculates the courtyard index of each object in a given GeoDataFrame.
\[\textit{area of courtyards} \over \textit{total area}\]Adapted from [Schirmer and Axhausen, 2015].
- Parameters:
- gdfGeoDataFrame
A GeoDataFrame containing objects.
- courtyard_areasstr, list, np.array, pd.Series
the name of the dataframe column,
np.array
, orpd.Series
where courtyard area values are stored. To calculate volume you can usemomepy.CourtyardArea
.- 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['courtyard_index'] = momepy.CourtyardIndex(buildings, ... 'courtyard_area', ... 'area').series >>> buildings_df.courtyard_index[80] 0.16605915738643523
- Attributes:
- seriesSeries
A Series containing resulting values.
- gdfGeoDataFrame
The original GeoDataFrame.
- courtyard_areasSeries
A Series containing used courtyard areas values.
- areasSeries
A Series containing used area values.
Methods
__init__
(gdf, courtyard_areas[, areas])