momepy.FormFactor#

class momepy.FormFactor(gdf, volumes, areas=None, heights=None)[source]#

Calculates the form factor of each object in a given GeoDataFrame.

\[surface \over {volume^{2 \over 3}}\]

where

\[surface = (perimeter * height) + area\]

Adapted from [Bourdic et al., 2012].

Parameters:
gdfGeoDataFrame

A GeoDataFrame containing objects.

volumesstr, list, np.array, pd.Series

The name of the dataframe column, np.array, or pd.Series where volume values are stored. To calculate volume you can use momepy.volume().

areasstr, list, np.array, pd.Series (default None)

The name of the dataframe column, np.array, or pd.Series where area values stored. If set to None, this function will calculate areas during the process without saving them separately.

heightsstr, list, np.array, pd.Series (default None)

The name of the dataframe column, np.array, or pd.Series where height values are stored. Note that it cannot be None.

Examples

>>> buildings_df['formfactor'] = momepy.FormFactor(buildings_df, 'volume').series
>>> buildings_df.formfactor[0]
1.9385988170288635
>>> volume = momepy.Volume(buildings_df, 'height').series
>>> buildings_df['formfactor'] = momepy.FormFactor(buildings_df, volume).series
>>> buildings_df.formfactor[0]
1.9385988170288635
Attributes:
seriesSeries

A Series containing resulting values.

gdfGeoDataFrame

The original GeoDataFrame.

volumesSeries

A Series containing used volume values.

areasSeries

A Series containing used area values.

__init__(gdf, volumes, areas=None, heights=None)[source]#

Methods

__init__(gdf, volumes[, areas, heights])