momepy.StreetProfile#
- momepy.StreetProfile(left, right, heights=None, distance=10, tick_length=50)[source]#
Calculates the street profile characters. This functions returns a dictionary with widths, standard deviation of width, openness, heights, standard deviation of height and ratio height/width. The algorithm generates perpendicular lines to the
right
dataframe features everydistance
and measures values on intersections with features ofleft
. If no feature is reached withintick_length
its value is set as width (being a theoretical maximum).Derived from [Araldi and Fusco, 2019].
- Parameters:
- leftGeoDataFrame
A GeoDataFrame containing streets to analyse.
- rightGeoDataFrame
A GeoDataFrame containing buildings along the streets. Only Polygon geometries are currently supported.
- heights: str, list, np.array, pd.Series (default None)
The name of the buildings dataframe column,
np.array
, orpd.Series
where building height are stored. If set toNone
, height and ratio height/width will not be calculated.- distanceint (default 10)
The distance between perpendicular ticks.
- tick_lengthint (default 50)
The length of ticks.
- Attributes:
- wSeries
A Series containing street profile width values.
- wdSeries
A Series containing street profile standard deviation values.
- oSeries
A Series containing street profile openness values.
- hSeries
A Series containing street profile heights values that is returned only when
heights
is set.- hdSeries
A Series containing street profile heights standard deviation values that is returned only when
heights
is set.- pSeries
A Series containing street profile height/width ratio values that is returned only when
heights
is set.- leftGeoDataFrame
The original left GeoDataFrame.
- rightGeoDataFrame
The original right GeoDataFrame.
- distanceint
The distance between perpendicular ticks.
- tick_lengthint
The length of ticks.
- heightsGeoDataFrame
A Series containing used height values.
Examples
>>> street_prof = momepy.StreetProfile(streets_df, buildings_df, heights='height') 100%|██████████| 33/33 [00:02<00:00, 15.66it/s] >>> streets_df['width'] = street_prof.w >>> streets_df['deviations'] = street_prof.wd