momepy.courtyard_area#
- momepy.courtyard_area(geometry)[source]#
Calculates area of holes within geometry - area of courtyards.
- Parameters:
- geometryGeoDataFrame | GeoSeries
A GeoDataFrame or GeoSeries containing polygons to analyse.
- Returns:
- Series
Examples
>>> path = momepy.datasets.get_path("bubenec") >>> buildings = geopandas.read_file(path, layer="buildings") >>> ca = momepy.courtyard_area(buildings) >>> ca 0 0.0 1 0.0 2 0.0 3 0.0 4 0.0 ... 139 0.0 140 0.0 141 0.0 142 0.0 143 0.0 Name: courtyard_area, Length: 144, dtype: float64
Verify that at least some buildings have courtyards:
>>> ca.sum() np.float64(353.33274206543274)