momepy.CourtyardIndex#
- class momepy.CourtyardIndex(gdf, courtyard_areas, areas=None)[source]#
Calculates courtyard index of each object in given GeoDataFrame.
\[\textit{area of courtyards} \over \textit{total area}\]Adapted from [Schirmer and Axhausen, 2015].
- Parameters
- gdfGeoDataFrame
GeoDataFrame containing objects
- courtyard_areasstr, list, np.array, pd.Series
the name of the dataframe column,
np.array
, orpd.Series
where is stored area value (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 is stored area value. If set toNone
, 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
Series containing resulting values
- gdfGeoDataFrame
original GeoDataFrame
- courtyard_areasSeries
Series containing used courtyard areas values
- areasSeries
Series containing used area values
Methods
__init__
(gdf, courtyard_areas[, areas])