momepy.CoveredArea#
- momepy.CoveredArea(gdf, spatial_weights, unique_id, verbose=True)[source]#
Calculates the area covered by neighbours, which is total area covered by neighbours defined in
spatial_weights
and the element itself.- Parameters:
- gdfGeoDataFrame
A GeoDataFrame containing Polygon geometries.
- spatial_weightslibpysal.weights
A spatial weights matrix.
- unique_idstr
The name of the column with unique ID used as
spatial_weights
index.- verbosebool (default True)
If
True
, shows progress bars in loops and indication of steps.
- Attributes:
- seriesSeries
A Series containing resulting values.
- gdfGeoDataFrame
The original GeoDataFrame.
- swlibpysal.weights
The spatial weights matrix.
- idSeries
A Series containing used unique ID.
Examples
>>> sw = momepy.sw_high(k=3, gdf=tessellation_df, ids='uID') >>> tessellation_df['covered'] = mm.CoveredArea(tessellation_df, sw, 'uID').series 100%|██████████| 144/144 [00:00<00:00, 549.15it/s]