momepy.Courtyards#

momepy.Courtyards(gdf, spatial_weights=None, verbose=True)[source]#

Calculate the number of courtyards within the joined structure.

Adapted from [Schirmer and Axhausen, 2015].

Parameters:
gdfGeoDataFrame

A GeoDataFrame containing objects to analyse.

spatial_weightslibpysal.weights, optional

A spatial weights matrix. If None, Queen contiguity matrix will be calculated based on objects. It is to denote adjacent buildings and is based on integer index.

verbosebool (default True)

If True, shows progress bars in loops and indication of steps.

Attributes:
seriesSeries

A Series containing resulting values.

gdfGeoDataFrame

The original GeoDataFrame.

swlibpysal.weights

The spatial weights matrix.

Examples

>>> buildings_df['courtyards'] = mm.Courtyards(buildings_df).series
Calculating spatial weights...