Skip to content

Commit

Permalink
Updating the website
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed Jun 23, 2024
1 parent 6c044b2 commit f818c87
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 40 deletions.
2 changes: 1 addition & 1 deletion deforisk_plugin_dialog_base.ui
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@
<item row="3" column="1">
<widget class="QLineEdit" name="mcmc">
<property name="text">
<string>5000</string>
<string>1000</string>
</property>
<property name="placeholderText">
<string>5000</string>
Expand Down
Binary file added help/docsrc/_static/icon_deforisk_toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed help/docsrc/_static/interface_MTQ-tuto.png
Binary file not shown.
Binary file added help/docsrc/_static/qgis-benchmark-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added help/docsrc/_static/qgis-variables-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed help/docsrc/_static/qgis-variables.png
Binary file not shown.
50 changes: 46 additions & 4 deletions help/docsrc/get_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,32 @@

* Introduction

To test the plugin installation and have a first look at its functionalities, try it on a small area of interest (AOI) such as the [[https://en.wikipedia.org/wiki/Martinique][Martinique]] island (1128 km^{2}) which as the MTQ iso code. Testing the plugin on a small AOI has the advantage of making computations faster so that you can directly see the outputs, interpret the results, and understand the functioning of the plugin.
#+begin_export rst
.. |ico_py| image:: _static/icon_python_console_toolbar.png
:class: no-scaled-link
.. |ico_deforisk| image:: _static/icon_deforisk_toolbar.png
:class: no-scaled-link
#+end_export

Open QGIS on your computer. To have access to log messages, activate the "Log Messages" panel in QGIS going to =View > Panel > Log Messages= in the Menu. When using a plugin, it is also a good habit to open the Python console in QGIS to have access to Python messages returned in the console. To open it, click on the Python icon @@rst:|ico_py|@@ in the "Plugins Toolbar". If the toolbar is not visible, activate it going to =View > Toolbars > Plugins Toolbar= in the Menu.

Once the plugin has been installed (see [[file:installation.html][Installation]] instructions), open the plugin clicking on its icon @@rst:|ico_deforisk|@@. You should see the versions of the dependencies installed in your environment written in the Python console. Check that these version numbers correspond to the last version for each dependency. Otherwise upgrade your dependencies.

#+begin_src python :results none :exports code
osmconvert 0.8.10
osmfilter 1.4.4
geefcc 0.1.3
pywdpa 0.1.6
forestatrisk 1.2
riskmapjnr 1.3
#+end_src

To test the plugin and have a first look at its functionalities, try it on a small area of interest (AOI) such as the [[https://en.wikipedia.org/wiki/Martinique][Martinique]] island (1128 km^{2}) which has the MTQ iso code. Testing the plugin on a small AOI has the advantage of making computations fast so that you can directly see the outputs, interpret the results, and understand the functioning of the plugin.

* Get variables

#+attr_rst: :alt MTQ variables
[[file:_static/interface_MTQ-tuto.png]]
[[file:_static/interface_MTQ-tuto-variables.png]]

- ~Working directory~: Select your working directory. Here ~/home/<username>/deforisk/MTQ-tuto~, but it could be ~C:\Users\<username>\deforisk\MTQ-tuto~ on Windows for example.
- ~Area Of Interest~: MTQ
Expand All @@ -29,13 +49,35 @@ To test the plugin installation and have a first look at its functionalities, tr
- ~WDPA access~: Personal WDPA API Token or path to text file with WDPA_KEY environmental variable.
- ~Projection EPSG code~: EPSG:5490

Click the run button and you should get the following layer on QGIS:
Click the run button. A forest cover change map appears in the list of QGIS layers (see image below and click to enlarge) and a plot of the forest cover change ~fcc123.png~ is created in folder ~outputs/variables~. New folders are created in the working directory among which the ~data_raw~ folder which includes raw data with intermediary files and the ~data~ folder which includes processed data used for models and plots. You can visualize the road network for example adding the ~roads_proj.shp~ vector file, which is located in the ~data_raw~ directory, in QGIS.

#+attr_rst: :width 650px :alt QGIS variables
[[file:_static/qgis-variables.png]]
[[file:_static/qgis-variables-results.png]]

* Benchmark model

#+attr_rst: :alt MTQ variables
[[file:_static/interface_MTQ-tuto-benchmark.png]]

** Fit model to data

- ~Deforestation threshold (%)~: 99.5%
- ~Max. distance to forest edge (m)~: 2500
- ~calib. period~: Checked, the model is fitted over the calibration period (t1--t2).
- ~hist. period~: Checked, the model is fitted over the historical period (t1--t3).

Click the ~Run~ button to estimate the deforestation risk with the benchmark model and predict the deforestation risk at t1 using both data on the calibration and historical periods. Maps with classes of deforestation risk are added to the list of QGIS layers (see image below) and new folders with results are created in the ~outputs/rmj_benchmark/~ directory including the ~<period>/defrate_cat_bm_<period>.csv~ tables with deforestation rates for each class of deforestation risk (see details [[file:plugin_api.html#defrate-table][here]]).

#+attr_rst: :width 650px :alt QGIS variables
[[file:_static/qgis-benchmark-results.png]]

** Predict the deforestation risk

- ~t2 validation~: Checked, computes predictions at t2 for validation (using the benchmark model fitted over the calibration period).
- ~t3 forecast~: Checked, computes predictions at t3 for forecasting (using the benchmark model fitted over the historical period).

Click the ~Run~ button to predict the deforestation risk at t2 and t3 using the benchmark model. Maps with classes of deforestation risk are added to the list of QGIS layers (see image below) and new folders with results are created in the ~outputs/rmj_benchmark/~ directory.

* Forestatrisk models

* Moving window models
Expand Down
55 changes: 51 additions & 4 deletions help/docsrc/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,30 @@ Get started
Introduction
------------

To test the plugin installation and have a first look at its functionalities, try it on a small area of interest (AOI) such as the `Martinique <https://en.wikipedia.org/wiki/Martinique>`_ island (1128 km\ :sup:`2`\) which as the MTQ iso code. Testing the plugin on a small AOI has the advantage of making computations faster so that you can directly see the outputs, interpret the results, and understand the functioning of the plugin.
.. |ico_py| image:: _static/icon_python_console_toolbar.png
:class: no-scaled-link
.. |ico_deforisk| image:: _static/icon_deforisk_toolbar.png
:class: no-scaled-link

Open QGIS on your computer. To have access to log messages, activate the “Log Messages” panel in QGIS going to ``View > Panel > Log Messages`` in the Menu. When using a plugin, it is also a good habit to open the Python console in QGIS to have access to Python messages returned in the console. To open it, click on the Python icon |ico_py| in the “Plugins Toolbar”. If the toolbar is not visible, activate it going to ``View > Toolbars > Plugins Toolbar`` in the Menu.

Once the plugin has been installed (see `Installation <installation.html>`_ instructions), open the plugin clicking on its icon |ico_deforisk|. You should see the versions of the dependencies installed in your environment written in the Python console. Check that these version numbers correspond to the last version for each dependency. Otherwise upgrade your dependencies.

.. code:: python
osmconvert 0.8.10
osmfilter 1.4.4
geefcc 0.1.3
pywdpa 0.1.6
forestatrisk 1.2
riskmapjnr 1.3
To test the plugin and have a first look at its functionalities, try it on a small area of interest (AOI) such as the `Martinique <https://en.wikipedia.org/wiki/Martinique>`_ island (1128 km\ :sup:`2`\) which has the MTQ iso code. Testing the plugin on a small AOI has the advantage of making computations fast so that you can directly see the outputs, interpret the results, and understand the functioning of the plugin.

Get variables
-------------

.. image:: _static/interface_MTQ-tuto.png
.. image:: _static/interface_MTQ-tuto-variables.png
:alt: MTQ variables

- ``Working directory``: Select your working directory. Here ``/home/<username>/deforisk/MTQ-tuto``, but it could be ``C:\Users\<username>\deforisk\MTQ-tuto`` on Windows for example.
Expand All @@ -39,15 +57,44 @@ Get variables

- ``Projection EPSG code``: EPSG:5490

Click the run button and you should get the following layer on QGIS:
Click the run button. A forest cover change map appears in the list of QGIS layers (see image below and click to enlarge) and a plot of the forest cover change ``fcc123.png`` is created in folder ``outputs/variables``. New folders are created in the working directory among which the ``data_raw`` folder which includes raw data with intermediary files and the ``data`` folder which includes processed data used for models and plots. You can visualize the road network for example adding the ``roads_proj.shp`` vector file, which is located in the ``data_raw`` directory, in QGIS.

.. image:: _static/qgis-variables.png
.. image:: _static/qgis-variables-results.png
:width: 650px
:alt: QGIS variables

Benchmark model
---------------

.. image:: _static/interface_MTQ-tuto-benchmark.png
:alt: MTQ variables

Fit model to data
~~~~~~~~~~~~~~~~~

- ``Deforestation threshold (%)``: 99.5%

- ``Max. distance to forest edge (m)``: 2500

- ``calib. period``: Checked, the model is fitted over the calibration period (t1--t2).

- ``hist. period``: Checked, the model is fitted over the historical period (t1--t3).

Click the ``Run`` button to estimate the deforestation risk with the benchmark model and predict the deforestation risk at t1 using both data on the calibration and historical periods. Maps with classes of deforestation risk are added to the list of QGIS layers (see image below) and new folders with results are created in the ``outputs/rmj_benchmark/`` directory including the ``<period>/defrate_cat_bm_<period>.csv`` tables with deforestation rates for each class of deforestation risk (see details `here <plugin_api.html#defrate-table>`_).

.. image:: _static/qgis-benchmark-results.png
:width: 650px
:alt: QGIS variables

Predict the deforestation risk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- ``t2 validation``: Checked, computes predictions at t2 for validation (using the benchmark model fitted over the calibration period).

- ``t3 forecast``: Checked, computes predictions at t3 for forecasting (using the benchmark model fitted over the historical period).

Click the ``Run`` button to predict the deforestation risk at t2 and t3 using the benchmark model. Maps with classes of deforestation risk are added to the list of QGIS layers (see image below) and new folders with results are created in the ``outputs/rmj_benchmark/`` directory.

Forestatrisk models
-------------------

Expand Down
16 changes: 8 additions & 8 deletions help/docsrc/installation.org
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ To be able to use the ~deforisk~ QGIS plugin, you need to activate the developer
- Toggle the Developer Mode setting, at the top of the "For developers" page.
- Read the disclaimer for the setting you choose. Click "Yes" to accept the change.

** Install Qgis and GDAL on Windows
** Install QGIS and GDAL on Windows

To install Qgis and GDAL on Windows, use the [[https://trac.osgeo.org/osgeo4w/][OSGeo4W]] network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select /Express Install/ and install both Qgis and GDAL. Several Gb of space will be needed on disk to install these programs. This will also install /OSGeo4W Shell/ to execute command lines.
To install QGIS and GDAL on Windows, use the [[https://trac.osgeo.org/osgeo4w/][OSGeo4W]] network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select /Express Install/ and install both QGIS and GDAL. Several Gb of space will be needed on disk to install these programs. This will also install /OSGeo4W Shell/ to execute command lines.

** Install the ~forestatrisk~ and ~riskmapjnr~ Python packages on Windows

Expand All @@ -44,9 +44,9 @@ python3.exe --version

* On Unix-like systems (Linux and macOS)

** Install Qgis and GDAL on Unix-like systems
** Install QGIS and GDAL on Unix-like systems

Install Qgis and GDAL on your system, for example using ~apt-get~ for Debian/Ubuntu Linux distributions.
Install QGIS and GDAL on your system, for example using ~apt-get~ for Debian/Ubuntu Linux distributions.

#+begin_src shell
sudo apt-get update
Expand All @@ -70,7 +70,7 @@ python3 -m pip install forestatrisk riskmapjnr gdal==$(gdal-config --version)
deactivate
#+end_src

Then, in the ~startup.py~ [[https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/intro.html#running-python-code-when-qgis-starts][Python file]], add the following two lines, adapting the path to your specific case (check the Python version). These two lines will be executed when Qgis starts and will add the path to the packages installed in the virtual environment to ~sys.path~.
Then, in the ~startup.py~ [[https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/intro.html#running-python-code-when-qgis-starts][Python file]], add the following two lines, adapting the path to your specific case (check the Python version). These two lines will be executed when QGIS starts and will add the path to the packages installed in the virtual environment to ~sys.path~.

#+begin_src python :results output :exports both
import sys
Expand Down Expand Up @@ -99,9 +99,9 @@ In the ~deforisk~ plugin, for the ~WDPA access~ argument available in the "Get v
#+attr_rst: :width 500px :alt WDPA access
[[file:_static/wdpa_access.png]]

* Installing the ~deforisk~ plugin in Qgis
* Installing the ~deforisk~ plugin in QGIS

- Download the ~deforisk~ [[https://github.com/ghislainv/deforisk-qgis-plugin/archive/refs/heads/main.zip][zip file]] from GitHub.
- Open Qgis.
- In Qgis menu bar, go to ~Extensions/Install extensions/Install from ZIP~.
- Open QGIS.
- In QGIS menu bar, go to ~Extensions/Install extensions/Install from ZIP~.
- Select the zip file that has been downloaded.
16 changes: 8 additions & 8 deletions help/docsrc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ To be able to use the ``deforisk`` QGIS plugin, you need to activate the develop

- Read the disclaimer for the setting you choose. Click “Yes” to accept the change.

Install Qgis and GDAL on Windows
Install QGIS and GDAL on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To install Qgis and GDAL on Windows, use the `OSGeo4W <https://trac.osgeo.org/osgeo4w/>`_ network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select *Express Install* and install both Qgis and GDAL. Several Gb of space will be needed on disk to install these programs. This will also install *OSGeo4W Shell* to execute command lines.
To install QGIS and GDAL on Windows, use the `OSGeo4W <https://trac.osgeo.org/osgeo4w/>`_ network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select *Express Install* and install both QGIS and GDAL. Several Gb of space will be needed on disk to install these programs. This will also install *OSGeo4W Shell* to execute command lines.

Install the ``forestatrisk`` and ``riskmapjnr`` Python packages on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -50,10 +50,10 @@ Note: In case of problems, you can check the version of Python used by OSGeo4W u
On Unix-like systems (Linux and macOS)
--------------------------------------

Install Qgis and GDAL on Unix-like systems
Install QGIS and GDAL on Unix-like systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Install Qgis and GDAL on your system, for example using ``apt-get`` for Debian/Ubuntu Linux distributions.
Install QGIS and GDAL on your system, for example using ``apt-get`` for Debian/Ubuntu Linux distributions.

.. code:: shell
Expand All @@ -79,7 +79,7 @@ On recent systems, you cannot use pip to install Python packages system-wide. As
python3 -m pip install forestatrisk riskmapjnr gdal==$(gdal-config --version)
deactivate
Then, in the ``startup.py`` `Python file <https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/intro.html#running-python-code-when-qgis-starts>`_, add the following two lines, adapting the path to your specific case (check the Python version). These two lines will be executed when Qgis starts and will add the path to the packages installed in the virtual environment to ``sys.path``.
Then, in the ``startup.py`` `Python file <https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/intro.html#running-python-code-when-qgis-starts>`_, add the following two lines, adapting the path to your specific case (check the Python version). These two lines will be executed when QGIS starts and will add the path to the packages installed in the virtual environment to ``sys.path``.

.. code:: python
Expand Down Expand Up @@ -113,13 +113,13 @@ In the ``deforisk`` plugin, for the ``WDPA access`` argument available in the
:width: 500px
:alt: WDPA access

Installing the ``deforisk`` plugin in Qgis
Installing the ``deforisk`` plugin in QGIS
------------------------------------------

- Download the ``deforisk`` `zip file <https://github.com/ghislainv/deforisk-qgis-plugin/archive/refs/heads/main.zip>`_ from GitHub.

- Open Qgis.
- Open QGIS.

- In Qgis menu bar, go to ``Extensions/Install extensions/Install from ZIP``.
- In QGIS menu bar, go to ``Extensions/Install extensions/Install from ZIP``.

- Select the zip file that has been downloaded.
Loading

0 comments on commit f818c87

Please sign in to comment.