momepy.AreaRatio#

class momepy.AreaRatio(left, right, left_areas, right_areas, unique_id=None, left_unique_id=None, right_unique_id=None)[source]#

Calculate covered area ratio or floor area ratio of objects.

Either unique_id or both left_unique_id and right_unique_id are required.

\[\textit{covering object area} \over \textit{covered object area}\]

Adapted from [Schirmer and Axhausen, 2015].

Parameters
leftGeoDataFrame

GeoDataFrame containing objects being covered (e.g. land unit)

rightGeoDataFrame

GeoDataFrame with covering objects (e.g. building)

left_areasstr, list, np.array, pd.Series

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

right_areasstr, list, np.array, pd.Series

the name of the right dataframe column, np.array, or pd.Series where area value is stored representing either projected or floor area.

unique_idstr (default None)

name of the column with unique id shared amongst left and right gdfs. If there is none, it could be generated by :py:func:’momepy.unique_id()’.

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

the name of the left dataframe column, np.array, or pd.Series where shared unique ID is stored

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

the name of the left dataframe column, np.array, or pd.Series where shared unique ID is stored

Examples

>>> tessellation_df['CAR'] = mm.AreaRatio(tessellation_df,
...                                       buildings_df,
...                                       'area',
...                                       'area',
...                                       'uID').series
Attributes
seriesSeries

Series containing resulting values

leftGeoDataFrame

original left GeoDataFrame

rightGeoDataFrame

original right GeoDataFrame

left_areasSeries

Series containing used left areas

right_areasSeries

Series containing used right areas

left_unique_idSeries

Series containing used left ID

right_unique_idSeries

Series containing used right ID

__init__(left, right, left_areas, right_areas, unique_id=None, left_unique_id=None, right_unique_id=None)[source]#

Methods

__init__(left, right, left_areas, right_areas)