momepy.Courtyards

class momepy.Courtyards(gdf, block_id, spatial_weights=None)[source]

Calculate the number of courtyards within the joined structure.

Parameters
gdfGeoDataFrame

GeoDataFrame containing objects to analyse

block_idstr, list, np.array, pd.Series

the name of the dataframe column, np.array, or pd.Series where is stored block ID

spatial_weightslibpysal.weights, optional

spatial weights matrix - If None, Queen contiguity matrix will be calculated based on objects. It is to denote adjacent buildings (note: based on index).

Examples

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

Series containing resulting values

gdfGeoDataFrame

original GeoDataFrame

block_idSeries

Series containing used block ID

swlibpysal.weights

spatial weights matrix

References
———
Schirmer PM and Axhausen KW (2015) A multiscale classification of urban morphology.
Journal of Transport and Land Use 9(1): 101–130.
__init__(self, gdf, block_id, spatial_weights=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, gdf, block_id[, spatial_weights])

Initialize self.