momepy.centroid_corner_distance#

momepy.centroid_corner_distance(geometry, eps=10, include_interiors=False)[source]#

Calculates the centroid-corner distance of each object given its geometry.

As a corner is considered a point where the angle between two consecutive segments deviates from 180 degrees by more than eps.

Parameters:
geometryGeoDataFrame | GeoSeries

A GeoDataFrame or GeoSeries containing polygons to analyse.

epsfloat, optional

Deviation from 180 degrees to consider a corner, by default 10

include_interiorsbool, optional

If True, polygon interiors are included in the calculation. If False, only exterior is considered, by default False

Returns:
DataFrame

DataFrame with columns ‘mean’ and ‘std’

Examples

>>> path = momepy.datasets.get_path("bubenec")
>>> buildings = geopandas.read_file(path, layer="buildings")
>>> momepy.centroid_corner_distance(buildings).head()
       mean        std
0  15.961532   3.081063
1  58.763388  22.922368
2  14.988106   3.648731
3  15.000439   4.999226
4  14.965557   3.660826