momepy.FormFactor

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

Calculates form factor of each object in given GeoDataFrame.

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

Adapted from [BSN12].

Parameters
gdfGeoDataFrame

GeoDataFrame containing objects

volumesstr, list, np.array, pd.Series

the name of the dataframe column, np.array, or pd.Series where is stored volume value. (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 is stored area value. If set to None, function will calculate areas during the process without saving them separately.

Examples

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

Series containing resulting values

gdfGeoDataFrame

original GeoDataFrame

volumesSeries

Series containing used volume values

areasSeries

Series containing used area values

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

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

Methods

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

Initialize self.