cityImage.number_neighbours#
- cityImage.number_neighbours(geometry, obstructions_gdf, obstructions_sindex, radius)[source]#
The function counts the number of neighbours, in a GeoDataFrame, around a given geometry, within a research radius.
- Parameters:
geometry (Shapely Geometry) – The geometry for which neighbors are counted.
obstructions_gdf (GeoDataFrame) – The GeoDataFrame containing the obstructions.
obstructions_sindex (Spatial Index) – The spatial index of the obstructions GeoDataFrame.
radius (float) – The research radius for neighboring buildings.
- Returns:
The number of neighbors.
- Return type:
int