Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Interactive maps to compare crown fire probability and potential impacts of fire on old-growth or mature forests and threatened and endangered species richness.

# pip install leafmap
# import dependencies
import leafmap.foliumap as leafmap

# Add raster datasets
crown = "tifs/zonal_clip.tif"
della = "tifs/della_clip.tif"
species = "tifs/spp_clip.tif"

# Initialize map and zoom to NV county
m = leafmap.Map(center=[39.12153746, -120.70667611], zoom=10)
m.add_basemap("CartoDB.Positron")

# Add layers to map
m.add_raster(della, colormap="viridis", layer_name="Old Growth", nodata=0)
m.add_raster(crown, colormap="rdylgn_r", layer_name="Crown Fire Probability", nodata=0)
# Define palettes
crown_colors = ["#1A9641", "#A6D96A", "#FFFFBF", "#FDAE61", "#D7191C"]
crown_vmin = 0
crown_vmax = 1

della_colors = ["#440154", "#31688E", "#35B779", "#FDE724"]
della_vmin = 3
della_vmax = 12

# Add colorbar and map. Click wrench and layers icon to toggle layers
m.add_colorbar(
    colors=della_colors, 
    vmin=della_vmin, 
    vmax=della_vmax, 
    caption="Old-Growth", 
    position="bottomright")
m.add_colorbar(
    colors=crown_colors, 
    vmin=crown_vmin, 
    vmax=crown_vmax,
    position="bottomright", 
    caption="Crown Fire Probability")
m

Old-growthΒΆ

In the map above, click on the layers icon in the upper right and click crown fire probablity on and off to compare layers.[1]

# Compare to listed species
# Create second map
m2 = leafmap.Map(center=[39.12153746, -120.70667611], zoom=10)
m2.add_basemap("CartoDB.Positron")
# Add layers to m2
m2.add_raster(species, colormap="reds", layer_name="Listed Species Richness", nodata=0)
m2.add_raster(crown, colormap="rdylgn_r", layer_name="Crown Fire Probability", nodata=0, show=False)

# Define palettes for m2
crown_colors = ["#1A9641", "#A6D96A", "#FFFFBF", "#FDAE61", "#D7191C"]
crown_vmin = 0
crown_vmax = 1

# Continuous reds for species
species_colors = ["#FFF5F0", "#FEE0D2", "#FCBBA1", "#FC9272", "#FB6A4A", "#EF3B2C", "#CB181D", "#A50F15", "#67000D"]
species_vmin = 0
species_vmax = 9

# Add colorbars to m2
m2.add_colorbar(
    colors=species_colors, 
    vmin=species_vmin, 
    vmax=species_vmax, 
    caption="Listed Species Richness")
m2.add_colorbar(
    colors=crown_colors, 
    vmin=crown_vmin, 
    vmax=crown_vmax, caption="Crown Fire Probability")
m2

Species RichnessΒΆ

In the map above, click on the layers icon in the upper right and click crown fire probablity on and off to compare layers.

FootnotesΒΆ
  1. Preliminary maps. I’m working on a swipe map and moving the colorbars to bottom right to make the visualization easier to interpret.