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 bothleft_unique_id
andright_unique_id
are required.\[\textit{covering object area} \over \textit{covered object area}\]Adapted from [Schirmer and Axhausen, 2015].
- Parameters:
- leftGeoDataFrame
A GeoDataFrame containing objects being covered (e.g. land unit).
- rightGeoDataFrame
A GeoDataFrame with covering objects (e.g. building).
- left_areasstr, list, np.array, pd.Series
The name of the left dataframe column,
np.array
, orpd.Series
where area values are stored.- right_areasstr, list, np.array, pd.Series
The name of the right dataframe column,
np.array
, orpd.Series
where area values are stored. representing either projected or floor area.- unique_idstr (default None)
The name of the unique ID column shared amongst
left
andright
gdfs. If there is none, it can be generated bymomepy.unique_id()
.- left_unique_idstr, list, np.array, pd.Series (default None)
The name of the
left
dataframe column,np.array
, orpd.Series
where the shared unique IDs are stored.- right_unique_idstr, list, np.array, pd.Series (default None)
The name of the
right
dataframe column,np.array
, orpd.Series
where the shared unique IDs are stored.
Examples
>>> tessellation_df['CAR'] = mm.AreaRatio(tessellation_df, ... buildings_df, ... 'area', ... 'area', ... 'uID').series
- Attributes:
- seriesSeries
A Series containing resulting values.
- leftGeoDataFrame
The original left GeoDataFrame.
- rightGeoDataFrame
The original right GeoDataFrame.
- left_areasSeries
A Series containing the used left areas.
- right_areasSeries
A Series containing the used right areas.
- left_unique_idSeries
A Series containing the used left ID.
- right_unique_idSeries
A 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)