momepy.Volume#

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

Calculates volume of each object in given GeoDataFrame based on its height and area.

\[area * height\]
Parameters
gdfGeoDataFrame

GeoDataFrame containing objects to analyse

heightsstr, list, np.array, pd.Series

the name of the dataframe column, np.array, or pd.Series where is stored height value

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['volume'] = momepy.Volume(buildings, heights='height_col').series
>>> buildings.volume[0]
7285.5749470443625
>>> buildings['volume'] = momepy.Volume(buildings, heights='height_col',
...                                     areas='area_col').series
>>> buildings.volume[0]
7285.5749470443625
Attributes
seriesSeries

Series containing resulting values

gdfGeoDataFrame

original GeoDataFrame

heightsSeries

Series containing used heights values

areasGeoDataFrame

Series containing used areas values

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

Methods

__init__(gdf, heights[, areas])