24.3. Impact on Housing and Community#

This notebook shows an analysis of the impact of the war on Gaza for housing and communities. This is done using the following indicators as of March 17th, 2024.

  • Percentage of Residential Buildings Damaged.

  • Percentage of Places of Worship Damaged.

  • Percentage of People in Neighbourhoods with Damaged Buildings.

  • Percentage of Places of Education Damaged.

  • Places of Public Amenities Damaged.

  • Percentage of Homes without (observed) Nighttime Lights.

sort_order = ["North Gaza", "Gaza", "Deir Al-Balah", "Khan Younis", "Rafah"]
def get_percentage_damaged(data, geog_level, variable, threshold, sort_order):
    left = (data[data[variable]>=threshold].groupby(geog_level).size()).to_frame('damaged')
    right = data.groupby(geog_level).size().to_frame('total')
    df = pd.merge(left, right, left_index = True, right_index = True, how = 'left')
    assert(not(df.isnull().values.any()))
    df["perc"] = 100 * df["damaged"] / df["total"]
    df = df.reindex(sort_order)
    return df
def hbarplot(data, suptitle, abs_value, perc_value, xlabel, ylabel, title, text):
    '''Create a horizontal bar plot'''
    fig, ax = plt.subplots(figsize=(12, 6))
    plt.suptitle(suptitle, y=0.99, fontsize=20, x=0.54)
    absolute_damage_numbers = data[abs_value].values
    ax = data[perc_value].plot(ax=ax, kind="barh", legend=False)
    ax.invert_yaxis()
    # Add labels and customization
    ax.set_xlabel(xlabel, fontsize=12)
    ax.set_ylabel(ylabel, fontsize=16)
    ax.spines["right"].set_visible(False)
    ax.spines["top"].set_visible(False)
    # Only show ticks on the left and bottom spines
    ax.yaxis.set_ticks_position("left")
    ax.xaxis.set_ticks_position("bottom")
    ax.xaxis.set_major_formatter(FuncFormatter(lambda y, _: "{:.0f}%".format(y)))
    
    ax.grid(axis="x", linestyle="--", linewidth=0.25, color="gray", alpha=0.5)
    ax.set_title(title, fontsize=14, loc="left")
    ax.text(0, -0.2, text, ha="left", va="center", transform=ax.transAxes, fontsize=10, color="black", weight="normal")

    if max(absolute_damage_numbers)>99999:
        flag_k = True
    else:
        flag_k = False
        
    for id, bar in enumerate(ax.patches):
        width = bar.get_width()  # Use width since the bars are horizontal
        if flag_k:
            ax.annotate(
                f"{absolute_damage_numbers[id] / 1_000:.0f}k",
                xy=(width, bar.get_y() + bar.get_height() / 2),
                xytext=(-20, 0),  # Shift the text to the left of the bar's end
                textcoords="offset points",
                color="white",
                ha="right",
                va="center",
                )

        else:
            ax.annotate(
                f"{int(np.round(absolute_damage_numbers[id],0))}",
                xy=(width, bar.get_y() + bar.get_height() / 2),
                xytext=(-20, 0),  # Shift the text to the left of the bar's end
                textcoords="offset points",
                color="white",
                ha="right",
                va="center",
                )

24.3.1. Percentage of Residential Buildings Damaged#

The damage assessment from [insert name of the class and link] was performed and produced a dataset in which for each OSM building, it has the probability of being damaged. That dataset is loaded, and each residential building with a probability equal or higher than 20% is considered damaged.

# Filter OSM buildings for getting residential buildings
residential = BUILDINGS_OSM[BUILDINGS_OSM["type"].isin(["house", "apartments", "residential", "yes;house"])]
residential.loc[:, "type"] = "residential"
residential = get_percentage_damaged(residential, 'ADM2_EN', '_upd10mean', 0.2, sort_order)
hbarplot(residential, 
         "Gaza: Percentage of Residential Buildings Damaged as of April 15th 2024", 
         'damaged', 
         'perc', 
         "% Residential Buildings Damaged", 
         "Governorate", 
         "Estimated percentage (and absolute number) of residential buildings damaged in each Governorate", 
         "On X: Percentage of residential buildings damaged. Inside Bar: Absolute number of residential buildings damaged On Y: Governorate from North to South. \nResidential buildings include all buildings tagged as 'residential', 'apartments' and 'houses' in the OpenStreetMap database\nSource: World Bank calculations derived from OpenStreetMap and Sentinel-1 data.")
../../_images/5c7862329e1d314b8f28b8b2f252b4665ff2c80ac7a8a86c53ec56833b1603b6.svg

24.3.1.1. Observations and Limitations#

  • More than 60% of residential buildings in Gaza, the second province from the north, can be considered damaged. However, in absolute numbers, Khan Younis has the most number of damaged residential buildings.

  • Residential buildings reported here include all the buildings tagged as ‘residential’, ‘apartments’ and ‘houses’ in OSM.

  • In the OpenStreetMap database, Deir Al-Balah has 717 reported residential buildings, Khan Younis has 1027, Gaza has 606, North Gaza has 491, and Rafah has 150.

  • Khan Younis was declared an evacuation zone by the Israeli Armed Forces, which could be a potential reason for the high number of damaged buildings.

24.3.2. Percentage of Places of Worship Damaged#

The same methodology from residential buildings is applied to places of workship.

places_of_worship = BUILDINGS_OSM[
    BUILDINGS_OSM["type"].isin(["religious", "mosque", "church"])
]
places_of_worship.loc[:, "type"] = "places_of_worship"
places_of_worship = get_percentage_damaged(places_of_worship, 'ADM2_EN', '_upd10mean', 0.2, sort_order)
hbarplot(places_of_worship, 
         "Gaza: Percentage of Places of Worship Damaged as of April 15th 2024", 
         'damaged', 
         'perc', 
         "% Places of Worship Damaged", 
         "Governorate", 
         "Estimated percentage (and absolute number) of places of worship damaged in each Governorate", 
         "On X: Percentage of places of worship damaged. Inside Bar: Absolute number of places of worship damaged On Y: Governorate from North to South. \nPlaces of worship include all points tagged as 'mosque', 'church' and 'religious'. 99% of the dataset is of mosques alone.\nSource: World Bank calculations derived from OpenStreetMap and Sentinel-1 data.")
../../_images/3fc50c0eb91c620ba1b2fe863e266126f57902ec5f50d23c1af6422d395cd44b.svg

24.3.2.1. Observations and Limitations#

  • Gaza had the biggest hit on places of worship, both in terms of percentage and absolute numbers.

  • There are a total of 58 reported places of worship in Gaza, North Gaza has 25, Deir Al-Balah has 20, Khan Younis has 34, and Rafah has 20.

  • There are no reported synagogues.

24.3.3. Percentage of People Living in Neighborhoods with Damaged Buildings#

The methodology for creating this indicator is as follows:

  1. Load the population data, which is at the point level.

  2. Change the population geometry from points to polygons to be able to overlay the population with OSM buildings.

  3. Calculate the mean damage by each population polygon.

  4. Filter the population polygons that got a mean damage higher than 0.2.

POPULATION.explore()
Make this Notebook Trusted to load map: File -> Trust Notebook
population_adm2 = POPULATION.groupby(['ADM2_EN'])[['Z']].sum()
mean_impact = population_impacted.groupby(['X', 'Y'])[['_upd10mean']].mean()
population_impacted_adm2 = POPULATION.set_index(['X', 'Y']).loc[mean_impact[mean_impact['_upd10mean']>.2].index].groupby('ADM2_EN')[['Z']].sum()
population_adm2.rename(columns = {'Z': 'total_population'}, inplace = True)
population_adm2['damaged'] = population_impacted_adm2['Z']
population_adm2['perc'] = (population_adm2['damaged']/population_adm2['total_population'])*100
population_adm2 = population_adm2.reindex(sort_order)
hbarplot(population_adm2, 
         "Gaza: Percentage of Places of Worship Damaged as of April 15th 2024", 
         'damaged', 
         'perc', 
         "% Places of Worship Damaged", 
         "Governorate", 
         "Estimated percentage (and absolute number) of places of worship damaged in each Governorate", 
         "On X: Percentage of places of worship damaged. Inside Bar: Absolute number of places of worship damaged On Y: Governorate from North to South. \nPlaces of worship include all points tagged as 'mosque', 'church' and 'religious'. 99% of the dataset is of mosques alone.\nSource: World Bank calculations derived from OpenStreetMap and Sentinel-1 data.")
../../_images/d77685f55af6e5e27e2b239f3eea7c7aae1b3a3eff42f33300bfbc272725d8d6.svg

24.3.3.1. Observations#

  • Both North Gaza (523k) and Gaza (869k) have higher populations than Khan Younis (476k). This is a potential reason why the damage is higher in Khan Younis, but the number of people impacted is greater in the other two administrative regions.

  • The population numbers are derived from WorldPop, which uses machine learning code to distribute population density top-down. This means that, sometimes, in areas where there are fewer people, the numbers reported in WorldPop could be higher, and vice versa. Therefore, the numbers reported here are the best approximation we can make with the data available.

24.3.4. Percentage of Schools and Public Amenities Damaged#

education = get_percentage_damaged(POI[POI["type"] == "Education"], 
                                 'ADM2_EN', '_upd10max', 0.5, sort_order)
public_amenities = get_percentage_damaged(POI[POI["type"] == "Public Amenities"], 
                                 'ADM2_EN', '_upd10max', 0.5, sort_order)
hbarplot(education,
        "Gaza: Percentage of Places of Education Damaged as of April 15th 2024",
        'damaged',
        'perc',
        "% Places of Education Damaged",
        "Governorate",
        "Estimated percentage (and absolute numbers) of places of education damaged in each Governorate",
        "On X: Percentage of places of education damaged. Inside Bar: Absolute number of places of education damaged On Y: Governorate from North to South. \nPlaces of education consist of buildings tagged 'schools', 'colleges', 'universities', 'kindergarten'\nSource: World Bank calculations derived from OpenStreetMap and Sentinel-1 data."
    )
../../_images/24ff42752e4554134f6b4a2eaf30a22ac0331597f72c9a73234a412453d5b41d.svg
hbarplot(public_amenities,
        "Gaza: Percentage of Public Amenities Damaged as of April 15th 2024",
        'damaged',
        'perc',
        "% Public Amenities Damaged",
        "Governorate",
        "Estimated percentage (and absolute numbers) of public amenities damaged in each Governorate",
        "On X: Percentage of public amenities damaged. Inside Bar: Absolute number of public amenities damaged On Y: Governorate from North to South. \nPublic amenities consist of 'public_building', 'police', 'courthouse', 'library', 'monument', 'post_office', 'memorial', 'community_centre', 'town_hall', 'museum', 'arts_centre', 'sports_centre', 'tourist_info', 'fire_station'\nSource: World Bank calculations derived from OpenStreetMap and Sentinel-1 data."
    )
../../_images/b042cfd8f25ac0bc93e03fd2b34e717ed52f5d3dcd89b6bd852696978f05d678.svg

24.3.5. Percentage of Residential Buildings without Observed Nighttime Lights#

Lower nighttime lights intensity, indicative of darker areas, may correspond to higher numbers of residential buildings without electricity. The chart below shows the percentage of residential buildings retrieved from OpenStreetMap for which the nighttime lights intensity has decreased as of December 2023 by at least 95%, compared to September 2023 for each governorate in Gaza.

Hide code cell source

fig, ax = plt.subplots(figsize=(12, 6))
plt.suptitle(
    "Gaza: Percentage of Residential Buildings without Observed Nighttime Lights",
    y=1.01,
    fontsize=20,
    x=0.45,
)

data = pd.read_csv(
    "../../../data/PSE_2-buildings_without_electricity.csv", index_col="name"
)[["% residential buildings without electricity"]].plot(
    ax=ax, kind="barh", color=TableauMedium_10.mpl_colors[1], legend=False
)

# Add labels and customization
ax.set_xlabel("% residential buildings without electricity ", fontsize=12)
ax.xaxis.set_major_formatter(FuncFormatter(lambda y, _: "{:.0f}%".format(y)))
ax.set_ylabel("Governorate", fontsize=16)
ax.spines["right"].set_visible(False)
ax.spines["top"].set_visible(False)

# Only show ticks on the left and bottom spines
ax.yaxis.set_ticks_position("left")
ax.xaxis.set_ticks_position("bottom")
ax.grid(which="both", linestyle="--", linewidth=0.25, color="gray", alpha=0.5)

# ax.set_title(
#     "Estimated percentage of buildings without electricity for each governorate",
#     fontsize=14,
# )
ax.text(
    0,
    -0.13,
    "Source: World Bank calculations derived from NASA Black Marble and OpenStreetMap data.",
    ha="left",
    va="center",
    transform=ax.transAxes,
    fontsize=10,
    color="black",
    weight="normal",
);
../../_images/baec821e859e840bf587c27eafbf79f0869fad8f6efc54787376f4b31fc66a1e.svg

24.3.6. Overall Impact on Housing and Community Place#

This final step summarizes all the above indicators by administrative level 2 boundaries in a single table to provide a wider picture of the situation.

summary_stats = pd.concat([
    residential,
    places_of_worship,
    population_adm2,
    education,
    public_amenities,
], axis = 1
)
sort_order = ["North Gaza", "Gaza", "Deir Al-Balah", "Khan Younis", "Rafah"]
summary_stats.reset_index(inplace=True)
summary_stats["ADM2_EN"] = pd.Categorical(
    summary_stats["ADM2_EN"], categories=sort_order, ordered=True
)
summary_stats.sort_values(by="ADM2_EN", inplace=True)
summary_stats.rename(columns={"ADM2_EN": "Governorate"}, inplace=True)
summary_stats.set_index("Governorate", inplace=True)
  % Residential Buildings Damaged % Population in Neighborhoods with Damaged Buildings % Places of Worship Damaged % Places of Education Damaged % Public Amenities Damaged
Governorate          
North Gaza 36% 47% 72% 82% 72%
Gaza 65% 87% 84% 79% 70%
Deir Al-Balah 39% 33% 65% 78% 56%
Khan Younis 47% 58% 62% 77% 63%
Rafah 15% 15% 40% 79% 72%

24.3.7. Observations#

  • The Governorate of Gaza took the greatest impact in almost every indicator being measured. The biggest, being the number of people potentially impacted (~720k).

  • The Governorate of North Gaza took impact on Points of Interest. However, this could also be because of the low number of reported buildings in the OpenStreetMap database.

  • Khan Younis, a southern Governorate, has more than half its population living in neighborhoods with damaged buildings and without observed nighttime lights.

summary_stats
Number of Residential Buildings Damaged residential_total % Residential Buildings Damaged Number of Places of Worship Damaged places_of_worship_total % Places of Worship Damaged total_population People in Neighborhoods with Damaged Buildings % Population in Neighborhoods with Damaged Buildings Number of Places of Education Damaged education_total % Places of Education Damaged Number of Public Amenities Damaged public_amenities_total % Public Amenities Damaged
Governorate
North Gaza 178 491 36.252546 18 25 72.000000 523248.454512 248144.936279 47.423921 46 56 82.142857 48 67 71.641791
Gaza 394 606 65.016502 49 58 84.482759 869397.672607 758657.895248 87.262471 80 101 79.207921 97 139 69.784173
Deir Al-Balah 282 717 39.330544 13 20 65.000000 369606.987427 121524.830139 32.879473 14 18 77.777778 18 32 56.250000
Khan Younis 484 1027 47.127556 21 34 61.764706 476073.810749 275585.374329 57.887111 24 31 77.419355 40 63 63.492063
Rafah 22 150 14.666667 8 20 40.000000 279377.634827 41877.277649 14.989488 27 34 79.411765 23 32 71.875000
summary_stats[
    [
        "Number of Residential Buildings Damaged",
        "People in Neighborhoods with Damaged Buildings",
        "Number of Places of Worship Damaged",
        "Number of Places of Education Damaged",
        "Number of Public Amenities Damaged",
    ]
].style.background_gradient(cmap="viridis", axis=0).format("{:.0f}")
  Number of Residential Buildings Damaged People in Neighborhoods with Damaged Buildings Number of Places of Worship Damaged Number of Places of Education Damaged Number of Public Amenities Damaged
Governorate          
North Gaza 178 248145 18 46 48
Gaza 394 758658 49 80 97
Deir Al-Balah 282 121525 13 14 18
Khan Younis 484 275585 21 24 40
Rafah 22 41877 8 27 23