diff --git a/deforisk_plugin_dialog_base.ui b/deforisk_plugin_dialog_base.ui index f77c57f..af2b88f 100644 --- a/deforisk_plugin_dialog_base.ui +++ b/deforisk_plugin_dialog_base.ui @@ -579,7 +579,7 @@ - 5000 + 1000 5000 diff --git a/help/docsrc/_static/icon_deforisk_toolbar.png b/help/docsrc/_static/icon_deforisk_toolbar.png new file mode 100644 index 0000000..89e2ee1 Binary files /dev/null and b/help/docsrc/_static/icon_deforisk_toolbar.png differ diff --git a/help/docsrc/_static/icon_python_console_toolbar.png b/help/docsrc/_static/icon_python_console_toolbar.png new file mode 100644 index 0000000..4ed1944 Binary files /dev/null and b/help/docsrc/_static/icon_python_console_toolbar.png differ diff --git a/help/docsrc/_static/interface_MTQ-tuto-benchmark.png b/help/docsrc/_static/interface_MTQ-tuto-benchmark.png new file mode 100644 index 0000000..b322539 Binary files /dev/null and b/help/docsrc/_static/interface_MTQ-tuto-benchmark.png differ diff --git a/help/docsrc/_static/interface_MTQ-tuto-variables.png b/help/docsrc/_static/interface_MTQ-tuto-variables.png new file mode 100644 index 0000000..260923c Binary files /dev/null and b/help/docsrc/_static/interface_MTQ-tuto-variables.png differ diff --git a/help/docsrc/_static/interface_MTQ-tuto.png b/help/docsrc/_static/interface_MTQ-tuto.png deleted file mode 100644 index 3b9034c..0000000 Binary files a/help/docsrc/_static/interface_MTQ-tuto.png and /dev/null differ diff --git a/help/docsrc/_static/qgis-benchmark-results.png b/help/docsrc/_static/qgis-benchmark-results.png new file mode 100644 index 0000000..bea69d1 Binary files /dev/null and b/help/docsrc/_static/qgis-benchmark-results.png differ diff --git a/help/docsrc/_static/qgis-variables-results.png b/help/docsrc/_static/qgis-variables-results.png new file mode 100644 index 0000000..e58b188 Binary files /dev/null and b/help/docsrc/_static/qgis-variables-results.png differ diff --git a/help/docsrc/_static/qgis-variables.png b/help/docsrc/_static/qgis-variables.png deleted file mode 100644 index 268c975..0000000 Binary files a/help/docsrc/_static/qgis-variables.png and /dev/null differ diff --git a/help/docsrc/get_started.org b/help/docsrc/get_started.org index 980023e..ef4c910 100644 --- a/help/docsrc/get_started.org +++ b/help/docsrc/get_started.org @@ -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//deforisk/MTQ-tuto~, but it could be ~C:\Users\\deforisk\MTQ-tuto~ on Windows for example. - ~Area Of Interest~: MTQ @@ -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 ~/defrate_cat_bm_.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 diff --git a/help/docsrc/get_started.rst b/help/docsrc/get_started.rst index 71d51a1..3673580 100644 --- a/help/docsrc/get_started.rst +++ b/help/docsrc/get_started.rst @@ -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 `_ 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 `_ 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 `_ 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//deforisk/MTQ-tuto``, but it could be ``C:\Users\\deforisk\MTQ-tuto`` on Windows for example. @@ -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 ``/defrate_cat_bm_.csv`` tables with deforestation rates for each class of deforestation risk (see details `here `_). + +.. 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 ------------------- diff --git a/help/docsrc/installation.org b/help/docsrc/installation.org index 9ba0eed..e3cb92f 100644 --- a/help/docsrc/installation.org +++ b/help/docsrc/installation.org @@ -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 @@ -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 @@ -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 @@ -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. diff --git a/help/docsrc/installation.rst b/help/docsrc/installation.rst index 76b09be..45383db 100644 --- a/help/docsrc/installation.rst +++ b/help/docsrc/installation.rst @@ -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 `_ 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 `_ 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -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 @@ -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 `_, 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 `_, 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 @@ -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 `_ 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. diff --git a/help/docsrc/plugin_api.org b/help/docsrc/plugin_api.org index 1a7c8d5..d23db32 100644 --- a/help/docsrc/plugin_api.org +++ b/help/docsrc/plugin_api.org @@ -25,7 +25,7 @@ The plugin interface shows five tabs: ~Get variables~, ~Benchmark~, ~FAR models~ This box is for collecting the information needed to download the data and compute the variables that will be used to spatially model the deforestation risk for a given area of interest. - ~Working directory~: Path to the working directory where all the data and model outputs will be stored. -- ~Area Of Interest~: Country ISO 3166-1 alpha-3 code (e.g. MTQ) or path to GPKG vector file in lat/lon delimiting the area of interest (jurisdiction) and the sub-jurisdictions. The GPKG vector file must include two layers, the first one must be named "aoi" for the jurisdiction and the second one must be named "subj" for subjurisdictions. This GPKG vector file can be manually obtained using Qgis tools and data from the Global Administrative Areas ([[https://gadm.org/download_country.html][GADM]]) website. An example is given in the following article on using [[file:articles/subnational_jurisd.html][subnational jurisdictions]]. +- ~Area Of Interest~: Country ISO 3166-1 alpha-3 code (e.g. MTQ) or path to GPKG vector file in lat/lon delimiting the area of interest (jurisdiction) and the sub-jurisdictions. The GPKG vector file must include two layers, the first one must be named "aoi" for the jurisdiction and the second one must be named "subj" for subjurisdictions. This GPKG vector file can be manually obtained using QGIS tools and data from the Global Administrative Areas ([[https://gadm.org/download_country.html][GADM]]) website. An example is given in the following article on using [[file:articles/subnational_jurisd.html][subnational jurisdictions]]. - ~Years~: Years delimiting the two periods (calibration and validation periods) for forest cover change observations. Three years must be provided. Years can be in the interval 2001--2024 for GFC (GFC does not provide tree cover loss for the year 2000) and 2000--2023 for TMF. - ~Forest data source~: Source of the forest data. Could be either "tmf" or "gfc". - ~Tree cover threshold (%)~: Tree cover percentage used to define the forest when using GFC. @@ -35,7 +35,7 @@ This box is for collecting the information needed to download the data and compu - ~WDPA access~: Personal API Token (a series of letters and numbers such as =ca4703ffba6b9a26b2db73f78e56e088=) or a path to a text file specifying the value of the "WDPA_KEY" environmental variable (e.g. a simple text file including on one line ~WDPA_KEY="3e404871700e77c453c4e189d848f739"~ for example). - ~Projection EPSG code~: EPSG code of the coordinate reference system used for projecting maps. -Pushing the ~Run~ button in this box will download the data and compute the variables in the background. When the operation is finished, a forest cover change map appears in the list of Qgis layers and a plot of the forest cover change ~fcc123.png~ is created in folder ~outputs/variables~. New folders are created in the working directory: +Pushing the ~Run~ button in this box will download the data and compute the variables in the background. When the operation is finished, a forest cover change map appears in the list of QGIS layers and a plot of the forest cover change ~fcc123.png~ is created in folder ~outputs/variables~. New folders are created in the working directory: Six data folders are created: - ~data_raw~: raw data with intermediary files. @@ -50,7 +50,7 @@ The following four folders only include symlinks to avoid duplicating data: Three other folders are created: - ~outputs~: Outputs (figures and tables). - ~outputs/variables~: Output for variables. -- ~qgis_layer_style~: Layer styles for Qgis. +- ~qgis_layer_style~: Layer styles for QGIS. * Benchmark @@ -100,7 +100,7 @@ This step is for predicting the deforestation risk and deriving risk maps using - ~t2 validation~: If checked, computes predictions at t2 for validation (using the benchmark model fitted over the calibration period). - ~t3 forecast~: If checked, computes predictions at t3 for forecasting (using the benchmark model fitted over the historical period). -Pushing the ~Run~ button in this box will use the benchmark models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of Qgis layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge. +Pushing the ~Run~ button in this box will use the benchmark models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of QGIS layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge. The following folders are created: ~outputs/rmj_benchmark/validation~ and ~outputs/rmj_benchmark/forecast~.The following files are added to these folders: - ~prob_bm_.tif~: Raster with classes of deforestation risk going from 1001 to potentially 30999 (high deforestation risk). @@ -122,7 +122,7 @@ This box is for collecting the information needed to sample the deforestation ob - ~calib. period~: If checked, the observations are sampled for the calibration period (t1--t2). - ~hist. period~: If checked, the observations are sampled for the historical period (t1--t3). -Pushing the ~Run~ button in this box will sample the observations. Note that you cannot sample the observations before downloading and computing the variables (see previous step). When the operation is finished, the sampled observations appear in the list of Qgis layers. You can navigate the map to confirm that about half the observations have been sampled in the deforested area and half in the non-deforested area. +Pushing the ~Run~ button in this box will sample the observations. Note that you cannot sample the observations before downloading and computing the variables (see previous step). When the operation is finished, the sampled observations appear in the list of QGIS layers. You can navigate the map to confirm that about half the observations have been sampled in the deforested area and half in the non-deforested area. The folder ~outputs/far_models~ is created with ~calibration~ and ~historical~ subfolders if ~calib. period~ and ~hist. period~ have been checked respectively. Files ~sample.txt~, ~sample_size.csv~, ~csize_icar.txt~, and ~correlation.pdf~ are added to the output folders for each period. @@ -161,7 +161,7 @@ This step is for predicting the deforestation risk and deriving risk maps using - ~t1 historical~: If checked, computes predictions at t1 using models fitted over the historical period. - ~t3 forecast~: If checked, computes predictions at t3 for forecasting (using models fitted over the historical period). -Pushing the ~Run~ button in this box will use the statistical models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of Qgis layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge, of the distance to roads, or of protected areas. +Pushing the ~Run~ button in this box will use the statistical models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of QGIS layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge, of the distance to roads, or of protected areas. The following folders are created for each period: ~outputs/far_models/~. The following files are created for each model, date or period: - ~prob__.tif~: Raster with classes of deforestation risk going from 1 to 65535 (highest deforestation risk). @@ -199,7 +199,7 @@ This step is for predicting the deforestation risk and deriving risk maps using - ~t1 historical~: If checked, computes predictions at t1 using models fitted over the historical period. - ~t3 forecast~: If checked, computes predictions at t3 for forecasting (using models fitted over the historical period). -Pushing the ~Run~ button in this box will use the moving window models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of Qgis layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. +Pushing the ~Run~ button in this box will use the moving window models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of QGIS layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. The following folders are created for each period: ~outputs/rmj_benchmark/~. The following files are created for each window size, date or period: - ~prob_mw__.tif~: Raster with classes of deforestation risk going from 1 (null deforestation risk beyond the distance threshold) to 65535 (highest deforestation risk). diff --git a/help/docsrc/plugin_api.rst b/help/docsrc/plugin_api.rst index e315f93..f8052e1 100644 --- a/help/docsrc/plugin_api.rst +++ b/help/docsrc/plugin_api.rst @@ -27,7 +27,7 @@ This box is for collecting the information needed to download the data and compu - ``Working directory``: Path to the working directory where all the data and model outputs will be stored. -- ``Area Of Interest``: Country ISO 3166-1 alpha-3 code (e.g. MTQ) or path to GPKG vector file in lat/lon delimiting the area of interest (jurisdiction) and the sub-jurisdictions. The GPKG vector file must include two layers, the first one must be named “aoi” for the jurisdiction and the second one must be named “subj” for subjurisdictions. This GPKG vector file can be manually obtained using Qgis tools and data from the Global Administrative Areas (`GADM `_) website. An example is given in the following article on using `subnational jurisdictions `_. +- ``Area Of Interest``: Country ISO 3166-1 alpha-3 code (e.g. MTQ) or path to GPKG vector file in lat/lon delimiting the area of interest (jurisdiction) and the sub-jurisdictions. The GPKG vector file must include two layers, the first one must be named “aoi” for the jurisdiction and the second one must be named “subj” for subjurisdictions. This GPKG vector file can be manually obtained using QGIS tools and data from the Global Administrative Areas (`GADM `_) website. An example is given in the following article on using `subnational jurisdictions `_. - ``Years``: Years delimiting the two periods (calibration and validation periods) for forest cover change observations. Three years must be provided. Years can be in the interval 2001--2024 for GFC (GFC does not provide tree cover loss for the year 2000) and 2000--2023 for TMF. @@ -45,7 +45,7 @@ This box is for collecting the information needed to download the data and compu - ``Projection EPSG code``: EPSG code of the coordinate reference system used for projecting maps. -Pushing the ``Run`` button in this box will download the data and compute the variables in the background. When the operation is finished, a forest cover change map appears in the list of Qgis layers and a plot of the forest cover change ``fcc123.png`` is created in folder ``outputs/variables``. New folders are created in the working directory: +Pushing the ``Run`` button in this box will download the data and compute the variables in the background. When the operation is finished, a forest cover change map appears in the list of QGIS layers and a plot of the forest cover change ``fcc123.png`` is created in folder ``outputs/variables``. New folders are created in the working directory: Six data folders are created: @@ -69,7 +69,7 @@ Three other folders are created: - ``outputs/variables``: Output for variables. -- ``qgis_layer_style``: Layer styles for Qgis. +- ``qgis_layer_style``: Layer styles for QGIS. Benchmark --------- @@ -143,7 +143,7 @@ This step is for predicting the deforestation risk and deriving risk maps using - ``t3 forecast``: If checked, computes predictions at t3 for forecasting (using the benchmark model fitted over the historical period). -Pushing the ``Run`` button in this box will use the benchmark models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of Qgis layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge. +Pushing the ``Run`` button in this box will use the benchmark models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of QGIS layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge. The following folders are created: ``outputs/rmj_benchmark/validation`` and ``outputs/rmj_benchmark/forecast``.The following files are added to these folders: @@ -175,7 +175,7 @@ This box is for collecting the information needed to sample the deforestation ob - ``hist. period``: If checked, the observations are sampled for the historical period (t1--t3). -Pushing the ``Run`` button in this box will sample the observations. Note that you cannot sample the observations before downloading and computing the variables (see previous step). When the operation is finished, the sampled observations appear in the list of Qgis layers. You can navigate the map to confirm that about half the observations have been sampled in the deforested area and half in the non-deforested area. +Pushing the ``Run`` button in this box will sample the observations. Note that you cannot sample the observations before downloading and computing the variables (see previous step). When the operation is finished, the sampled observations appear in the list of QGIS layers. You can navigate the map to confirm that about half the observations have been sampled in the deforested area and half in the non-deforested area. The folder ``outputs/far_models`` is created with ``calibration`` and ``historical`` subfolders if ``calib. period`` and ``hist. period`` have been checked respectively. Files ``sample.txt``, ``sample_size.csv``, ``csize_icar.txt``, and ``correlation.pdf`` are added to the output folders for each period. @@ -235,7 +235,7 @@ This step is for predicting the deforestation risk and deriving risk maps using - ``t3 forecast``: If checked, computes predictions at t3 for forecasting (using models fitted over the historical period). -Pushing the ``Run`` button in this box will use the statistical models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of Qgis layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge, of the distance to roads, or of protected areas. +Pushing the ``Run`` button in this box will use the statistical models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of QGIS layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. For example, you can have a look at the effect of the distance to forest edge, of the distance to roads, or of protected areas. The following folders are created for each period: ``outputs/far_models/``. The following files are created for each model, date or period: @@ -290,7 +290,7 @@ This step is for predicting the deforestation risk and deriving risk maps using - ``t3 forecast``: If checked, computes predictions at t3 for forecasting (using models fitted over the historical period). -Pushing the ``Run`` button in this box will use the moving window models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of Qgis layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. +Pushing the ``Run`` button in this box will use the moving window models for predictions. Note that you cannot make predictions if you have not fitted the models (see previous step). When the operation is finished, rasters representing the classes of deforestation risk appear in the list of QGIS layers. You can navigate the different maps to see how the risk of deforestation is changing in space for the different dates. The following folders are created for each period: ``outputs/rmj_benchmark/``. The following files are created for each window size, date or period: @@ -298,7 +298,7 @@ The following folders are created for each period: ``outputs/rmj_benchmark/_.png``: Plot of the deforestation risk map. -- ``defrate_cat_mw__.csv``: Table with deforestation rates on the period for each class of deforestation risk. See details `above `_ with one exception for moving window models: column ``rate_mod`` is computed as :math:`\theta_{m,1} = 0` and :math:`\theta_{m,i} = ((i - 2) \times 999999 / 65533 + 1) \times 1e^{-6}` for :math:`i \geq 2`. This formula leads to an almost null (:math:`1e^{-6}`) deforestation probability when :math:`i=2` and to a deforestation probability of 1 when :math:`i=65535`. +- ``defrate_cat_mw__.csv``: Table with deforestation rates on the period for each class of deforestation risk. See details `above `_ with one exception for moving window models: column ``rate_mod`` is computed as :math:`\theta_{m,1} = 0` and :math:`\theta_{m,i} = ((i - 2) \times 999999 / 65533 + 1) \times 1e^{-6}` for :math:`i > 1`. This formula leads to an almost null (:math:`1e^{-6}`) deforestation probability when :math:`i=2` and to a deforestation probability of 1 when :math:`i=65535`. Validation ----------