cityImage.compute_global_scores#

cityImage.compute_global_scores(buildings_gdf, global_indexes_weights, global_components_weights)[source]#

Computes the component and global scores for a buildings GeoDataFrame, rescaling values when necessary and assigning weights to the different properties measured.

Parameters:
  • buildings_gdf (Polygon GeoDataFrame) – The input GeoDataFrame containing buildings information.

  • global_indexes_weights (dict) – Dictionary with index names (string) as keys and weights as values.

  • global_components_weights (dict) – Dictionary with component names (string) as keys and weights as values.

Returns:

buildings_gdf – The updated buildings GeoDataFrame with computed scores.

Return type:

Polygon GeoDataFrame

Examples

# Example 1: Computing global scores for a buildings GeoDataFrame >>> import geopandas as gpd >>> buildings_gdf = gpd.GeoDataFrame(…) >>> global_indexes_weights = {“3dvis”: 0.50, “fac”: 0.30, “height”: 0.20, “area”: 0.30, “2dvis”: 0.30, “neigh”: 0.20, “road”: 0.20} >>> global_components_weights = {“vScore”: 0.50, “sScore”: 0.30, “cScore”: 0.20, “pScore”: 0.10} >>> buildings_gdf_scores = compute_global_scores(buildings_gdf, global_indexes_weights, global_components_weights) >>> print(buildings_gdf_scores)