cassiebuhler commited on
Commit
2b288ca
Β·
1 Parent(s): 6929c5e

updating fire labels

Browse files
Files changed (1) hide show
  1. app.py +35 -34
app.py CHANGED
@@ -426,17 +426,18 @@ with st.sidebar:
426
  show_manageable_carbon = st.toggle("Manageable Carbon")
427
 
428
  if show_irrecoverable_carbon:
429
- m.add_cog_layer(url_irr_carbon, palette="reds", name="Irrecoverable Carbon", opacity = a_climate, fit_bounds=False)
430
 
431
  if show_manageable_carbon:
432
- m.add_cog_layer(url_man_carbon, palette="purples", name="Manageable Carbon", opacity = a_climate, fit_bounds=False)
 
433
  # Fire Section
434
  with st.expander("πŸ”₯ Fire"):
435
  a_fire = st.slider("transparency", 0.0, 1.0, 0.3, key = "fire")
436
- show_fire_20 = st.toggle("Historical Fires (2003-2022)")
437
- show_fire_10 = st.toggle("Historical Fires (2013-2022)")
438
- show_fire_5 = st.toggle("Historical Fires (2018-2022)")
439
- show_fire_2 = st.toggle("Historical Fires (2022)")
440
 
441
  show_rx_20 = st.toggle("Prescribed Burns (2003-2022)")
442
  show_rx_10 = st.toggle("Prescribed Burns (2013-2022)")
@@ -444,28 +445,28 @@ with st.sidebar:
444
  show_rx_2 = st.toggle("Prescribed Burns (2022)")
445
 
446
  if show_fire_20:
447
- m.add_pmtiles(url_calfire, style=get_fire_style("layer1",a_fire), name="Fire Perimeters (2003-2022)", tooltip=False, zoom_to_layer = True)
448
 
449
  if show_fire_10:
450
- m.add_pmtiles(url_calfire, style=get_fire_style("layer2",a_fire), name="Fire Perimeters (2013-2022)", tooltip=False, zoom_to_layer = True)
451
 
452
  if show_fire_5:
453
- m.add_pmtiles(url_calfire, style=get_fire_style("layer3",a_fire), name="Fire Perimeters (2018-2022)", tooltip=False, zoom_to_layer = True)
454
 
455
  if show_fire_2:
456
- m.add_pmtiles(url_calfire, style=get_fire_style("layer4",a_fire), name="Fire Perimeters (2022)", tooltip=False, zoom_to_layer = True)
457
 
458
  if show_rx_20:
459
- m.add_pmtiles(url_rxburn, style=get_rx_style("layer1",a_fire), name="Prescribed Burns (2003-2022)", tooltip=False, zoom_to_layer = True)
460
 
461
  if show_rx_10:
462
- m.add_pmtiles(url_rxburn, style=get_rx_style("layer2",a_fire), name="Prescribed Burns (2013-2022)", tooltip=False, zoom_to_layer = True)
463
 
464
  if show_rx_5:
465
- m.add_pmtiles(url_rxburn, style=get_rx_style("layer3",a_fire), name="Prescribed Burns (2018-2022)", tooltip=False, zoom_to_layer = True)
466
 
467
  if show_rx_2:
468
- m.add_pmtiles(url_rxburn, style=get_rx_style("layer4",a_fire), name="Prescribed Burns (2022)", tooltip=False, zoom_to_layer = True)
469
 
470
 
471
 
@@ -488,31 +489,31 @@ with st.sidebar:
488
  show_sv_housing = st.toggle("Housing Type & Transportation")
489
 
490
  if show_sv:
491
- m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEMES",a_svi), tooltip=False, name = "SVI", zoom_to_layer = False)
492
 
493
  if show_sv_socio:
494
- m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME1",a_svi), tooltip=False, name = "Socioeconomic Status", zoom_to_layer = False)
495
 
496
  if show_sv_household:
497
- m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME2",a_svi), tooltip=False, name = "Household Characteristics", zoom_to_layer = False)
498
 
499
  if show_sv_minority:
500
- m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME3",a_svi), tooltip=False, name = "Racial & Ethnic Minority Status", zoom_to_layer = False)
501
 
502
  if show_sv_housing:
503
- m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME4",a_svi), tooltip=False, name = "Housing Type & Transportation", zoom_to_layer = False)
504
 
505
  # HI Section
506
  with st.expander("🚜 Human Impacts"):
507
  a_hi = st.slider("transparency", 0.0, 1.0, 0.5, key = "hi")
508
- show_carbon_lost = st.toggle("Carbon Lost (2002-2022)")
509
- show_human_impact = st.toggle("Human Impact")
510
 
511
  if show_carbon_lost:
512
- m.add_tile_layer(url_loss_carbon, name="Carbon Lost (2002-2022)",attribution = "Gassert et al. (2023)", opacity = a_hi)
513
 
514
  if show_human_impact:
515
- m.add_cog_layer(url_hi, name="Human Impact", opacity = a_hi, fit_bounds=False)
516
 
517
  st.divider()
518
 
@@ -627,35 +628,35 @@ with main:
627
  st.altair_chart(man_carbon_chart, use_container_width=True)
628
 
629
  if show_fire_20:
630
- "Historical Fires (20yrs)"
631
  st.altair_chart(fire_20_chart, use_container_width=True)
632
 
633
  if show_fire_10:
634
- "Historical Fires (10yrs)"
635
  st.altair_chart(fire_10_chart, use_container_width=True)
636
 
637
  if show_fire_5:
638
- "Historical Fires (5yrs)"
639
  st.altair_chart(fire_5_chart, use_container_width=True)
640
 
641
  if show_fire_2:
642
- "Historical Fires (2yrs)"
643
  st.altair_chart(fire_2_chart, use_container_width=True)
644
 
645
  if show_rx_20:
646
- "Prescribed Burns (20yrs)"
647
  st.altair_chart(rx_20_chart, use_container_width=True)
648
 
649
  if show_rx_10:
650
- "Prescribed Burns (10yrs)"
651
  st.altair_chart(rx_10_chart, use_container_width=True)
652
 
653
  if show_rx_5:
654
- "Prescribed Burns (5yrs)"
655
  st.altair_chart(rx_5_chart, use_container_width=True)
656
 
657
  if show_rx_2:
658
- "Prescribed Burns (2yrs)"
659
  st.altair_chart(rx_2_chart, use_container_width=True)
660
 
661
  if show_justice40:
@@ -683,11 +684,11 @@ with main:
683
  st.altair_chart(svi_transit_chart, use_container_width=True)
684
 
685
  if show_carbon_lost:
686
- "Carbon Lost ('02-'22)"
687
  st.altair_chart(carbon_loss_chart, use_container_width=True)
688
 
689
  if show_human_impact:
690
- "Human Impact"
691
  st.altair_chart(hi_chart, use_container_width=True)
692
 
693
 
@@ -713,7 +714,7 @@ Data: https://huggingface.co/datasets/boettiger-lab/ca-30x30
713
 
714
  - Irrecoverable Carbon from Conservation International, reprocessed to COG on https://beta.source.coop/cboettig/carbon, citation: https://doi.org/10.1038/s41893-021-00803-6, License: CC-BY-NC
715
 
716
- - Fire polygons by CAL FIRE, reprocessed to PMTiles on https://beta.source.coop/cboettig/fire/. License: Public Domain
717
 
718
  - Climate and Economic Justice Screening Tool, US Council on Environmental Quality, Justice40, data: https://beta.source.coop/repositories/cboettig/justice40/description/, License: Public Domain
719
 
 
426
  show_manageable_carbon = st.toggle("Manageable Carbon")
427
 
428
  if show_irrecoverable_carbon:
429
+ m.add_cog_layer(url_irr_carbon, palette="reds", name="Irrecoverable Carbon (2010-2018)", attribution = "Conservation International", opacity = a_climate, fit_bounds=False)
430
 
431
  if show_manageable_carbon:
432
+ m.add_cog_layer(url_man_carbon, palette="purples", name="Manageable Carbon (2010-2018)", attribution = "Conservation International", opacity = a_climate, fit_bounds=False)
433
+
434
  # Fire Section
435
  with st.expander("πŸ”₯ Fire"):
436
  a_fire = st.slider("transparency", 0.0, 1.0, 0.3, key = "fire")
437
+ show_fire_20 = st.toggle("Fires (2003-2022)")
438
+ show_fire_10 = st.toggle("Fires (2013-2022)")
439
+ show_fire_5 = st.toggle("Fires (2018-2022)")
440
+ show_fire_2 = st.toggle("Fires (2022)")
441
 
442
  show_rx_20 = st.toggle("Prescribed Burns (2003-2022)")
443
  show_rx_10 = st.toggle("Prescribed Burns (2013-2022)")
 
445
  show_rx_2 = st.toggle("Prescribed Burns (2022)")
446
 
447
  if show_fire_20:
448
+ m.add_pmtiles(url_calfire, style=get_fire_style("layer1",a_fire), name="CAL FIRE Fire Polygons (2003-2022)", tooltip=False, zoom_to_layer = True)
449
 
450
  if show_fire_10:
451
+ m.add_pmtiles(url_calfire, style=get_fire_style("layer2",a_fire), name="CAL FIRE Fire Polygons (2013-2022)", tooltip=False, zoom_to_layer = True)
452
 
453
  if show_fire_5:
454
+ m.add_pmtiles(url_calfire, style=get_fire_style("layer3",a_fire), name="CAL FIRE Fire Polygons (2018-2022)", tooltip=False, zoom_to_layer = True)
455
 
456
  if show_fire_2:
457
+ m.add_pmtiles(url_calfire, style=get_fire_style("layer4",a_fire), name="CAL FIRE Fire Polygons (2022)", tooltip=False, zoom_to_layer = True)
458
 
459
  if show_rx_20:
460
+ m.add_pmtiles(url_rxburn, style=get_rx_style("layer1",a_fire), name="CAL FIRE Prescribed Burns (2003-2022)", tooltip=False, zoom_to_layer = True)
461
 
462
  if show_rx_10:
463
+ m.add_pmtiles(url_rxburn, style=get_rx_style("layer2",a_fire), name="CAL FIRE Prescribed Burns (2013-2022)", tooltip=False, zoom_to_layer = True)
464
 
465
  if show_rx_5:
466
+ m.add_pmtiles(url_rxburn, style=get_rx_style("layer3",a_fire), name="CAL FIRE Prescribed Burns (2018-2022)", tooltip=False, zoom_to_layer = True)
467
 
468
  if show_rx_2:
469
+ m.add_pmtiles(url_rxburn, style=get_rx_style("layer4",a_fire), name="CAL FIRE Prescribed Burns (2022)", tooltip=False, zoom_to_layer = True)
470
 
471
 
472
 
 
489
  show_sv_housing = st.toggle("Housing Type & Transportation")
490
 
491
  if show_sv:
492
+ m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEMES",a_svi), tooltip=False, name = "SVI (2020)", zoom_to_layer = False)
493
 
494
  if show_sv_socio:
495
+ m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME1",a_svi), tooltip=False, name = "Socioeconomic Status - SVI (2020)", zoom_to_layer = False)
496
 
497
  if show_sv_household:
498
+ m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME2",a_svi), tooltip=False, name = "Household Characteristics - SVI (2020)", zoom_to_layer = False)
499
 
500
  if show_sv_minority:
501
+ m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME3",a_svi), tooltip=False, name = "Racial & Ethnic Minority Status - SVI (2020)", zoom_to_layer = False)
502
 
503
  if show_sv_housing:
504
+ m.add_pmtiles(url_svi, style = get_sv_style(url_svi, "RPL_THEME4",a_svi), tooltip=False, name = "Housing Type & Transportation - SVI (2020)", zoom_to_layer = False)
505
 
506
  # HI Section
507
  with st.expander("🚜 Human Impacts"):
508
  a_hi = st.slider("transparency", 0.0, 1.0, 0.5, key = "hi")
509
+ show_carbon_lost = st.toggle("Deforested Carbon (2002-2022)")
510
+ show_human_impact = st.toggle("Human Footprint (2017-2021)")
511
 
512
  if show_carbon_lost:
513
+ m.add_tile_layer(url_loss_carbon, name="Deforested Carbon (2002-2022)",attribution = "Gassert et al. (2023)", opacity = a_hi)
514
 
515
  if show_human_impact:
516
+ m.add_cog_layer(url_hi, name="Human Footprint (2017-2021)", attribution = "Gassert et al. (2023)", opacity = a_hi, fit_bounds=False)
517
 
518
  st.divider()
519
 
 
628
  st.altair_chart(man_carbon_chart, use_container_width=True)
629
 
630
  if show_fire_20:
631
+ "Fires (2003-2022)"
632
  st.altair_chart(fire_20_chart, use_container_width=True)
633
 
634
  if show_fire_10:
635
+ "Fires (2013-2022)"
636
  st.altair_chart(fire_10_chart, use_container_width=True)
637
 
638
  if show_fire_5:
639
+ "Fires (2018-2022)"
640
  st.altair_chart(fire_5_chart, use_container_width=True)
641
 
642
  if show_fire_2:
643
+ "Fires (2022)"
644
  st.altair_chart(fire_2_chart, use_container_width=True)
645
 
646
  if show_rx_20:
647
+ "Prescribed Burns (2003-2022)"
648
  st.altair_chart(rx_20_chart, use_container_width=True)
649
 
650
  if show_rx_10:
651
+ "Prescribed Burns (2013-2022)"
652
  st.altair_chart(rx_10_chart, use_container_width=True)
653
 
654
  if show_rx_5:
655
+ "Prescribed Burns (2018-2022)"
656
  st.altair_chart(rx_5_chart, use_container_width=True)
657
 
658
  if show_rx_2:
659
+ "Prescribed Burns (2022)"
660
  st.altair_chart(rx_2_chart, use_container_width=True)
661
 
662
  if show_justice40:
 
684
  st.altair_chart(svi_transit_chart, use_container_width=True)
685
 
686
  if show_carbon_lost:
687
+ "Deforested Carbon (2002-2022)"
688
  st.altair_chart(carbon_loss_chart, use_container_width=True)
689
 
690
  if show_human_impact:
691
+ "Human Footprint (2017-2021)"
692
  st.altair_chart(hi_chart, use_container_width=True)
693
 
694
 
 
714
 
715
  - Irrecoverable Carbon from Conservation International, reprocessed to COG on https://beta.source.coop/cboettig/carbon, citation: https://doi.org/10.1038/s41893-021-00803-6, License: CC-BY-NC
716
 
717
+ - Fire polygons by CAL FIRE (2022), reprocessed to PMTiles on https://beta.source.coop/cboettig/fire/. License: Public Domain
718
 
719
  - Climate and Economic Justice Screening Tool, US Council on Environmental Quality, Justice40, data: https://beta.source.coop/repositories/cboettig/justice40/description/, License: Public Domain
720