ForeFire is an open-source code for wildland fire spread models, developed and maintained by Université de Corse Pascal Paoli.
Access the demo simulator here
It has been designed and run on Unix systems, three modules can be built with the source code.
The main binaries are
- An interpreter (executable)
- A dynamic library (shared, with C/C++/Java and Fortran bindings)
The requirements and ForeFire can be installed by running install-forefire.sh
(Ubuntu or Debian distributions)
cd forefire
sudo sh install-requirements.sh
The program will be built in: /bin/forefire
OR run the commands:
apt-get update
apt install build-essential -y
apt install libnetcdf-dev libnetcdf-cxx-legacy-dev -y
apt install scons -y
To install
- The C++ compiler (that may come pre-built with your linux distribution)
- NetCDF Library and NetCDF-C++ legacy, for compatibilities issues
- SCons python tool, is used to build the executable and the python library
A sample SConstruct
file is included with the distribution.
Run it with
cd firefront
scons
Troubleshooting: If it does not work, try using the /tools/Sconstruct
file. Replace the Sconstruct
file with /tools/Sconstruct
. Set the environment variables, and insert the path to the Netcdf (and Java headers for JNI bindings if required).
To build with all warnings enabled
scons -Q w=1
To make the program executable from eveywhere (during the session) Add the bin folder to path
export PATH=$PATH:./bin
If you want to change it permanently add export PATH=$PATH:</path/to/file>
to your ~/.bashrc file
cd firefront/examples/aullene/
../../bin/forefire -i aullene.ff
The simulation result will be outputed in JSON format
Use the script ff2geojson.py
with the .json file as argument.
python3 py3_tools/ff2geojson.py examples/aullene/1-2009-07-24T15-01-00Z.json
The JSON will be converted to GeoJSON (EPSG 4326) of geometry type MultiPoint and saved in the same directory.
The "swig" repository contains python bindings requires numpy (and numpy.i), swig, and matplotlib for testing.
A sample Dockerfile can allow to build a Docker image with
docker build . -t forefire
To run this image and interactively acces the continer use
docker run -it forefire bash