.github

Index

  1. About Fire2a
  2. Getting help
  3. Contributing
  4. Developer setup

About Fire2a

We are a team dedicated to finding scientific and technological solutions to mitigate the effects of wildfires. We believe open-source collaboration is key and also providing custom consulting services for real-world organizations. Contact us

Our solutions involve the development of novel methodologies through the integration of various mathematical and technological tools. These tools include machine learning for fire ignition modeling, spatially explicit wildfire simulators, fire risk metrics, species distribution models, stochastic and multiobjective optimization, and simulation-based optimization.

Our goal is create fire-resilient landscapes while minimizing potential carbon emissions, protecting wildlife biodiversity, and ensuring the safety of human communities.

Main repos overview:

1. Cell2FireW: C++ command line WildFire simulator (forked)

2. Fire-Analytics-ToolBox: Friendly QGIS Processing Toolbox Plugin, interfacing our tools (simulation, optimization, GIS tasks and algorithm, etc.) in various ways, including easy to use clickable dialogs.

3. Algorithms-libs: Python package with algorithms and common GIS tasks.

4. Documentation: End user documentation, including Cell2Fire, Qgis-Toolbox, QGIS recipes, install & plugin management. Check it here

Getting help

Contributing

All contibutions are welcome, for effectiveness please follow:

Developer setup

Pick your poison:

Container

Long tutorial TL;DR:

  1. Clone the repos: Cell2FireW, Fire-Analytics-ToolBox, Algorithms-libs
  2. Get Containerfile and build.sh; Build the image (that mounts the repos and runs the build script).
  3. Run the container, enable our plugin in QGIS. ```bash

    required packages podman & git

    sudo apt install podman git wget

the current directory will be shared to the container

let’s start with an empty one

mkdir fire2a cd fire2a

get Containerfile and build.sh

wget https://raw.githubusercontent.com/fire2a/.github/refs/heads/main/build.sh wget https://raw.githubusercontent.com/fire2a/.github/refs/heads/main/Containerfile

clone the repos

git clone git@github.com:fire2a/C2F-W.git git clone git@github.com:fire2a/fire-analytics-qgis-processing-toolbox-plugin.git toolbox git clone git@github.com:fire2a/fire2a-lib.git

build the container mounting the current directory into container user’s home (/root)

podman build –tag qgis-fire2a –volume $(pwd):/root .

run the container also with display capabilities

podman run -it –env DISPLAY=$DISPLAY –volume /tmp/.X11-unix:/tmp/.X11-unix –volume $(pwd):/root –device /dev/dri –name fire2a qgis-fire2a

re-run the container

podman start fire2a podman stop fire2a

Keep in mind that any changes made to the container's filesystem are lost when stopped except those made into the user's home (`/root`).
This includes all temporary generated layers (whose files are generated into /tmp/processing...), so to keep them, save them home (`--volume $(pwd):/root`).

## Manual
1. Install the latest QGIS
2. Clone the repos
3. Symbolic link them
4. Run QGIS
### 1. Get latest qgis  
- steps from https://qgis.org/resources/installation-guide/#debianubuntu  
- check your distro version `$lsb_release -a`, below is for Debian 12 (bookworm)  
```bash
# required packages
sudo apt install gnupg software-properties-common wget

# add the key
sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg

# add the repo to sources.list (is the suite still bookworm?)
echo 'Types: deb deb-src
URIs: https://qgis.org/debian
Suites: bookworm
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg' | sudo tee /etc/apt/sources.list.d/qgis.sources

# install
sudo apt update
sudo apt install qgis qgis-plugin-grass

2. Get Cell2Fire, python libs and QGIS toolboox-plugin

# choose install location, below ~/fire is used
fire=~/fire
mkdir -p "$fire"

# get Cell2FireW
cd "$fire"
git clone git@github.com:fire2a/C2F-W.git
sudo apt install g++-12 libboost-all-dev libeigen3-dev libtiff-dev
cd C2F-W/Cell2Fire
make clean
make

# get python library
cd "$fire"
sudo apt install python3-venv 
python3 -m venv venv --system-site-packages # needs system qgis packages
source "$fire/venv/bin/activate"
git clone git@github.com:fire2a/fire2a-lib.git lib
cd lib
pip install -r requirements.build.txt
pip install -r requirements.code.txt
pip install -r requirements.txt
pip install --editable .

# get toolbox
cd "$fire"
git clone git@github.com:fire2a/fire-analytics-qgis-processing-toolbox-plugin.git toolbox
plugins_dir=~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/

 # if never opened QGIS
mkdir -p $plugins_dir

# toolbox to QGIS plugins
ln -sf "$(fire)/toolbox/fireanalyticstoolbox" "$plugins_dir/fireanalyticstoolbox"

# C2F to toolbox
ln -sf "$(fire)/C2F-W" "$(fire)/toolbox/fireanalyticstoolbox/simulator/C2F"

4. run

source $fire/venv/bin/activate
qgis

Enable our plugin on Plugins>Manage..>Installed> enable the check box on ‘FireFire Analytics Processing-Toolbox’

Official tutorial