momepy.StreetProfile

class momepy.StreetProfile(left, right, heights=None, distance=10, tick_length=50, verbose=True)[source]

Calculates the street profile characters.

Returns a dictionary with widths, standard deviation of width, openness, heights, standard deviation of height and ratio height/width. Algorithm generates perpendicular lines to right dataframe features every distance and measures values on intersection with features of left. If no feature is reached within tick_length its value is set as width (being a theoretical maximum).

Derived from [AF19].

Parameters
leftGeoDataFrame

GeoDataFrame containing streets to analyse

rightGeoDataFrame

GeoDataFrame containing buildings along the streets (only Polygon geometry type is supported)

heights: str, list, np.array, pd.Series (default None)

the name of the buildings dataframe column, np.array, or pd.Series where is stored building height. If set to None, height and ratio height/width will not be calculated.

distanceint (default 10)

distance between perpendicular ticks

tick_lengthint (default 50)

length of ticks

verbosebool (default True)

if True, shows progress bars in loops and indication of steps

Examples

>>> street_profile = momepy.StreetProfile(streets_df, buildings_df, heights='height')
100%|██████████| 33/33 [00:02<00:00, 15.66it/s]
>>> streets_df['width'] = street_profile.w
>>> streets_df['deviations'] = street_profile.wd
Attributes
wSeries

Series containing street profile width values

wdSeries

Series containing street profile standard deviation values

oSeries

Series containing street profile openness values

hSeries

Series containing street profile heights values. Returned only when heights is set.

hdSeries

Series containing street profile heights standard deviation values. Returned only when heights is set.

pSeries

Series containing street profile height/width ratio values. Returned only when heights is set.

leftGeoDataFrame

original left GeoDataFrame

rightGeoDataFrame

original right GeoDataFrame

distanceint

distance between perpendicular ticks

tick_lengthint

length of ticks

heightsGeoDataFrame

Series containing used height values

__init__(left, right, heights=None, distance=10, tick_length=50, verbose=True)[source]

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

Methods

__init__(left, right[, heights, distance, …])

Initialize self.