momepy.CentroidCorners#

class momepy.CentroidCorners(gdf, verbose=True)[source]#

Calculates the mean distance centroid - corners and standard deviation. Returns np.nan for MultiPolygons.

\[\overline{x}=\frac{1}{n}\left(\sum_{i=1}^{n} dist_{i}\right); \space \mathrm{SD}=\sqrt{\frac{\sum|x-\overline{x}|^{2}}{n}}\]

Adapted from [Schirmer and Axhausen, 2015] and [Cimburova, 2017].

Parameters
gdfGeoDataFrame

A GeoDataFrame containing objects.

verbosebool (default True)

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

Examples

>>> ccd = momepy.CentroidCorners(buildings_df)
100%|██████████| 144/144 [00:00<00:00, 846.58it/s]
>>> buildings_df['ccd_means'] = ccd.means
>>> buildings_df['ccd_stdev'] = ccd.std
>>> buildings_df['ccd_means'][0]
15.961531913184833
>>> buildings_df['ccd_stdev'][0]
3.0810634305400177
Attributes
meanSeries

A Series containing mean distance values.

stdSeries

A Series containing standard deviation values.

gdfGeoDataFrame

The original GeoDataFrame.

__init__(gdf, verbose=True)[source]#

Methods

__init__(gdf[, verbose])