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 [SA15].

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 is stored area value.

right_areasstr, list, np.array, pd.Series

the name of the right dataframe column, np.array, or pd.Series where is stored area value 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 is stored shared unique ID

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

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

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__(self, left, right, left_areas, right_areas, unique_id=None, left_unique_id=None, right_unique_id=None)[source]

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

Methods

__init__(self, left, right, left_areas, …)

Initialize self.