Git Product home page Git Product logo

indigowizard / wildfire-burn-severity Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 3.63 MB

Geospatials project meant to help generate burn severity maps & assess surface area affected by wildfires.

Home Page: https://indigowizard.github.io/wildfire-burn-severity/

License: GNU General Public License v3.0

Python 70.20% HTML 24.33% CSS 5.46%
burn-severity earth-engine environment geospatial-analysis nbr-index hacktoberfest folium geemap geospatial maps python css html javascript hacktoberfest2023

wildfire-burn-severity's Introduction

wildfire-burn-severity

Web App link: Wlidfire Burn Severity project

Open for contribution! Consider ⭐ starring the project

IMPORTANT NOTE: ⚠️

The Earth Engine token expires after few days, so after this the Earth Engine layers won't be rendered; The app still works, I just need to update the token from my personal google earth engine account, which I dont do often so unless you need a live demo I wont update it, otherwise check the preview section.

Project description:

A GEE project that aims to generate a burn severity map to assess surface areas affected by wildfires. The project relies on Normalized Burn Ratio (NBR) to highlight the affected areas and estimate burn severity levels.

The project uses Google Earth Engine Python API, combined with Folium and geemap to render the map, calculate the index ratio and compute raster data results.

Use-case:

The wildfire that erupted in Mount Chenoua, Tipaza, Algeria on August 14th-16th 2022 is used as main use-case. For more details on this wildfire, read the related medium article: Mt Chenoua Forest Fires Analysis with Remote Sensing.

Preview

wildfire burn severity analysis

User guide

End users can navigate to the web page and access the results easily: Burn Severity Analysis

If you want to fork and work on the project, you need the following:

  1. To use this script, you must first sign up for a Google Earth Engine account.
  2. Install gcloud CLI for the Google Earth Engine account authentication.
  3. Install the rest of project dependencies from requirement.txt file, just run:

conda install --file requirements.txt

use python 3.9 and up.

Change Satellite Imagery Data

You'll need two imagery data entries, one for a pre-fire and one for post-fire period, it's better to use images with less than 10% cloud coverage.
Get the image ID from Earth Engine Data Catalog or from SciHub (I'm using Sentinel-2 L2A imagery for better results, you can find other datasets from other sources.)

#Sentinel-2 L2A: August 12th 2022 - Pre-fire
pre_fire = ee.Image('COPERNICUS/S2_SR/20220812T103031_20220812T103132_T31SDA')

#Sentinel-2 L2A: August 20th 2022 - Post-fire
post_fire = ee.Image('COPERNICUS/S2_SR/20220820T103629_20220820T104927_T31SDA')

Change Area of Interest (AOS)

You can use GeoJson.io to draw your polygon than copy/past only the coordinates into the code, not the full GeoJSON (Google Earth Engine at this current time don't take GeoJSON files as a geometry input, so you can't link/access/read a local GeoJSON file).

To change the area of interest (AOS) go to aos.py file and put the coordinates of your area of interest, e.g;

import ee
ee.Initialize()
aos = ee.Geometry.Polygon([
  # X/Y Decimal Degrees coordinates
  [2.40, 36.60],
  [],
  []...
])

Your Area Of Study (AOS) must be a polygon geometry, not a polyline or a single point as you are studying a specific surface area affected by wildfires. Avoid water surfaces for more accurate results.

Credit

Project created using: Google Earth Engine (GEE), geemap, Folium, Sentinel-2 L2A Satellite Imagery Dataset - Project by Ahmed I. Mokhtari.

wildfire-burn-severity's People

Contributors

indigowizard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wildfire-burn-severity's Issues

Collapsible map legend element

Main issue gist

please make a PR to the dev branch where it would be merged if approved.

Implementing a collapsible map legend.
The current branca element based legend is just draggable but not collapsible, it would be great to implement such a feature to minimize the space it takes up on while navigating the map.

Make sure the legend stays draggable when implementing the collapse feature.

map-legend.mp4

Info

The project is using Folium and earthengine-api to generate the map and the raster/vector layers. By default, Folium creates a map in a separate HTML file wildfire-burn-severity/webmap.html from the main python app wildfire-burn-severity/webmap.py .

Even though the project is python based, it generates Leaflet.js based maps through the output html file, the legend is pure HTML/CSS/JS that can be injected in the main python source using Branca library.

I put the branca element based legend in a separate python file wildfire-burn-severity/uilegend.py. You can extract it and treat as just HTML so you get an easier time coding and seeing the results locally as in opposite to running the python app which requires a validated Google Earth Engine account (it takes long time to be accepted and validated).

The css is of course in the src/css

NOTE:

Make sure you put a preview (gif/mp4) of your result in the Pull Request so I can check what it looks like and how it behaves.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.