The work in this section will be part of your final project blog post that will go on your website!
Setup
Find fire perimeters for the Eaton and Palisades fires that occurred in Los Angeles County on 2025. There are several datasets with this information online. You will need to independently select one from a reputable source (it may be more than one file). These are the same files you will use for assignment 4.
Add the fire perimeter datasets to the data directory in your eds-220-sections directory.
Download the 2024Environmental Justice Index data for California in the geodatabase data format. Add it to the data directory in your eds-220-sections directory.
1. Metadata exploration
Review the CSV with the metadata information for the EJI data.
Look at the variables and with your team select a few variables that, in your opinion, could influence a community’s response to a wildfire. You’ll be working with some of them in the following exercises.
2. Polygon intersection
Open the fire perimeters and the EJI data and do initial data exploration.
Spatially join the EJI data with the Palisades fire perimeter using geopandas.sjoin() to get a geopandas.GeoDataFrame that will have only have the census tracts intersecting the Palisades fire perimeter.
Create an exploratory map showing
the census tracts that intersect the Palisades fire perimeter and
the Palisades fire perimeter.
Discuss how big is the Palisades fire perimeter in relation to the census tracts.
Create the corresponding geopandas.GeoDataFrame and exploratory map for the Eaton fire.
Discuss how big is the Eaton fire perimeter in relation to the census tracts intersectig the Eaton fire perimeter.
3. Polygon clipping
Clip the census tracts to the Palisades fire perimeter using geopandas.clip().
Do the same for the Eaton fire perimeter.
Quickly visualize your data.
Discuss with your group the difference between a spatial join (step 2) and clipping (step 3). Make sure you understand the difference and what your goal is when transforming geospatial data!
4. Visualize fire perimeters with a basemap
To add a basemap to our plot we will be using the contextily library.
Import the contextily library at the top of your notebook as ctx. This library is already installed in the EDS 220 environment.
Use and update the code below to plot the fire perimeters adding a basemap:
fig, ax = plt.subplots(1, 1, figsize=(14, 12))# Add basemap using contextilyctx.add_basemap(ax, source=ctx.providers.OpenStreetMap.Mapnik)# ADD FIRE PERIMETERS: UPDATE FILL TRANSPARENCY AND COLOR# ADD LEGEND OR ANNOTATION TO IDENTIFY EACH FIRE# ADD TITLEax.axis('off')plt.tight_layout()plt.show()
5. Visualize EJI data
Use and update the code below to plot one of the variables you and your team explored in step 1 as being relevant to a community’s response to a wildfire.
Code
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(20, 10))# UPDATE WITH YOU EJI VARIABLE FROM STEP 1eji_variable =''# Find common min/max for legend rangevmin =min(census_within_palisades[eji_variable].min(), census_within_eaton[eji_variable].min())vmax =max(census_within_palisades[eji_variable].max(), census_within_eaton[eji_variable].max())# Plot census tracts within Palisades perimetercensus_within_palisades.plot( column= eji_variable, vmin=vmin, vmax=vmax, legend=False, ax=ax1,)ax1.set_title('UPDATE TITLE')ax1.axis('off')# Plot census tracts within Eaton perimetercensus_within_eaton.plot( column=eji_variable, vmin=vmin, vmax=vmax, legend=False, ax=ax2,)ax2.set_title('UPDATE TITLE')ax2.axis('off')# Add overall titlefig.suptitle('YOUR VARIABLE HERE - Fire Areas Comparison')# Add shared colorbar at the bottomsm = plt.cm.ScalarMappable( norm=plt.Normalize(vmin=vmin, vmax=vmax))cbar_ax = fig.add_axes([0.25, 0.08, 0.5, 0.02]) # [left, bottom, width, height]cbar = fig.colorbar(sm, cax=cbar_ax, orientation='horizontal')cbar.set_label('YOUR VARIABLE HERE (WITH UNITS)')plt.show()
With your team, write a short paragraph discussing how or whether this variable is distributed differently across the two fire perimeters. What kind of implications could this have in terms of wildifre relief?