A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

riskmapjnr

Obtain maps of the spatial risk of deforestation and forest degradation following the methodology developed in the context of the Jurisdictional and Nested REDD+ (JNR) and using only a forest cover change map as input.
https://github.com/ghislainv/riskmapjnr

Category: Biosphere
Sub Category: Deforestation and Reforestation

Keywords

climate-change-mitigation co2-emissions deforestation-risk forest-conservation jurisdictional-and-nested-redd verified-carbon-standard

Keywords from Contributors

tropical-forests

Last synced: about 16 hours ago
JSON representation

Repository metadata

📦🐍 Mapping deforestation risk following JNR methodology

README.rst

          ..
   # ==============================================================================
   # author          :Ghislain Vieilledent
   # email           :[email protected], [email protected]
   # web             :https://ecology.ghislainv.fr
   # license         :GPLv3
   # ==============================================================================

.. image:: https://ecology.ghislainv.fr/riskmapjnr/_static/logo-riskmapjnr.svg
   :align: right
   :target: https://ecology.ghislainv.fr/riskmapjnr
   :alt: Logo riskmapjnr
   :width: 140px

``riskmapjnr`` Python package
*****************************

|Python version| |PyPI version| |GitHub Actions| |License| |Zenodo|


Overview
========

The ``riskmapjnr`` Python package can be used to obtain **maps of the
spatial risk of deforestation and forest degradation** following the
methodology developed in the context of the Jurisdictional and Nested
REDD+ (`JNR`_) and using only a forest cover change map as input.

.. _JNR:
   https://verra.org/project/jurisdictional-and-nested-redd-framework/

.. image:: https://ecology.ghislainv.fr/riskmapjnr/_static/riskmapjnr-example.png
   :align: center
   :target: https://ecology.ghislainv.fr/riskmapjnr
   :alt: riskmapjnr-example
   :width: 1300px


Statement of Need
=================

The `VCS`_ (Verified Carbon Standard) program allows certified
projects to turn their greenhouse gas (GHG) emission reductions and
removals into tradable carbon credits. Since its launch in 2006, the
VCS program has grown into the world's largest voluntary GHG program.

In the forest sector, programs to mitigate GHG emissions across entire
national or subnational jurisdictions (called `REDD+`_ programs,
i.e. programs aiming at Reducing Emissions from Deforestation and
Forest Degradation) can be accounted for and credited using a
jurisdictional-scale framework, the Jurisdictional and Nested REDD+
(`JNR`_) framework. JNR integrates government-led and project-level
REDD+ activities and establishes a clear pathway for subnational- and
project-level activities to be incorporated within broader REDD+
programs. The JNR framework ensures all projects and other reducing
emissions from deforestation and degradation activities in a given
jurisdiction are developed using consistent baselines and crediting
approaches. They mitigate the risk of "leakage", i.e. the displacement
of emission-causing activities to areas outside the project boundary,
by monitoring emissions across an entire jurisdictional area.

The `JNR Risk Mapping Tool`_ is a "benchmark" methodology that
provides a standardized approach for developing deforestation and
forest degradation risk maps for users of the `JNR Allocation Tool`_
in the context of Jurisdictional and Nested REDD+ (JNR)
requirements. The methodology allows deriving a map of the
deforestation (or degradation) risk based on a minimal spatial
information provided by the past deforestation (or degradation) map at
the jurisdictional scale.

The `JNR Risk Mapping Tool`_ allows the creation of categorical and
spatially static maps whose categories represent different levels of
risk of deforestation or forest degradation in the validity period of
the Forest Reference Emissions Level (FREL) and throughout the
jurisdictional geographical boundaries. In the `JNR Allocation Tool`_,
the level of risk determines how the jurisdictional FREL is spatially
distributed to nested lower-level jurisdictional programs and
projects.

While the `JNR Risk Mapping Tool`_ methodology favors simplicity,
obtaining the risk map is not straightforward. The approach requires
several geoprocessing steps on raster data that can be large,
i.e. covering large spatial extent (eg. national scale) at high
spatial resolution (eg. 30 m). The ``riskmapjnr`` Python package
includes functions to perform these geoprocessing steps and derive a
risk map on any jurisdiction and at any spatial resolution following
the `JNR Risk Mapping Tool`_ methodology.

.. _VCS:
   https://verra.org/project/vcs-program/

.. _REDD+:
   https://redd.unfccc.int/

.. _JNR:
   https://verra.org/project/jurisdictional-and-nested-redd-framework/
   
.. _JNR Risk Mapping Tool:
   https://verra.org/wp-content/uploads/2021/04/DRAFT_JNR_Risk_Mapping_Tool_15APR2021.pdf

.. _JNR Allocation Tool:
   https://verra.org/wp-content/uploads/2021/04/JNR_Allocation_Tool_Guidance_v4.0.pdf

Installation
============

You will need several dependencies to run the ``riskmapjnr`` Python
package. The best way to install the package is to create a Python
virtual environment, either through ``conda`` (recommended) or
``virtualenv``.

Using ``conda`` (recommended)
+++++++++++++++++++++++++++++

You first need to have ``miniconda3`` installed (see `here
`__).

Then, create a conda environment (details `here
`__)
and install the ``riskmapjnr`` package with the following commands:

.. code-block:: shell
		
   conda create --name conda-rmj -c conda-forge python=3 gdal numpy matplotlib pandas pip scipy --yes
   conda activate conda-rmj
   pip install riskmapjnr # For PyPI version
   # pip install https://github.com/ghislainv/riskmapjnr/archive/master.zip # For GitHub dev version
   # conda install -c conda-forge sphinx flake8 jedi jupyter geopandas descartes folium --yes  # Optional additional packages

To deactivate and delete the conda environment:

.. code-block:: shell
		
   conda deactivate
   conda env remove --name conda-rmj

Using ``virtualenv``
++++++++++++++++++++

You first need to have the ``virtualenv`` package installed (see `here `__).

Then, create a virtual environment and install the ``riskmapjnr``
package with the following commands:

.. code-block:: shell

   cd ~
   mkdir venvs # Directory for virtual environments
   cd venvs
   virtualenv --python=/usr/bin/python3 venv-rmj
   source ~/venvs/venv-rmj/bin/activate
   # Install numpy first
   pip install numpy
   # Install gdal (the correct version) 
   pip install --global-option=build_ext --global-option="-I/usr/include/gdal" gdal==$(gdal-config --version)
   pip install riskmapjnr # For PyPI version, this will install all other dependencies
   # pip install https://github.com/ghislainv/riskmapjnr/archive/master.zip # For GitHub dev version
   # pip install sphinx flake8 jedi jupyter geopandas descartes folium # Optional additional packages

To deactivate and delete the virtual environment:

.. code-block:: shell
		
   deactivate
   rm -R ~/venvs/venv-rmj # Just remove the repository

Installation testing
++++++++++++++++++++

You can test that the package has been correctly installed using the
command ``riskmapjnr`` in a terminal:

.. code-block:: shell

  riskmapjnr

This should return a short description of the ``riskmapjnr`` package
and the version number:

.. code-block:: shell

  # riskmapjnr: Map of deforestation risk following JNR methodology.
  # https://ecology.ghislainv.fr/riskmapjnr/
  # riskmapjnr version x.x.

You can also test the package executing the commands in the `Get
started
`__
tutorial.
   
Main functionalities
====================

The ``riskmapjnr`` package includes functions to:

1. Estimate the distance to forest edge beyond which the deforestation
   risk is negligible: ``dist_edge_threshold()``.
2. Compute local deforestation rates using a moving window whose size
   can vary: ``local_defor_rate()``.
3. Transform local deforestation rates into categories of
   deforestation risks using several slicing algorithms:
   ``set_defor_cat_zero()`` and ``defor_cat()``
4. Validate maps of deforestation risk and select the map with the
   higher accuracy: ``defrate_per_cat()`` and ``validation()``.

The ``riskmapjnr`` package uses several known Python scientific
packages such as ``NumPy``, ``SciPy``, and ``Pandas`` for fast matrix
and vector operations and ``gdal`` for processing georeferenced raster
data. Raster data are divided into blocks of data for in-memory
processing. Such an approach allow processing large raster files with
large geographical extents (e.g. country scale) and high spatial
resolutions (eg. 30 m).

Contributing
============

The ``riskmapjnr`` Python package is Open Source and released under
the `GNU GPL version 3 license
`__. Anybody
who is interested can contribute to the package development following
our `Community guidelines
`__. Every
contributor must agree to follow the project's `Code of conduct
`__.


.. |Python version| image:: https://img.shields.io/pypi/pyversions/riskmapjnr?logo=python&logoColor=ffd43b&color=306998
   :target: https://pypi.org/project/riskmapjnr
   :alt: Python version

.. |PyPI version| image:: https://img.shields.io/pypi/v/riskmapjnr
   :target: https://pypi.org/project/riskmapjnr
   :alt: PyPI version

.. |GitHub Actions| image:: https://github.com/ghislainv/riskmapjnr/actions/workflows/python-package.yml/badge.svg
   :target: https://github.com/ghislainv/riskmapjnr/actions/workflows/python-package.yml
   :alt: GitHub Actions
	 
.. |License| image:: https://img.shields.io/badge/licence-GPLv3-8f10cb.svg
   :target: https://www.gnu.org/licenses/gpl-3.0.html
   :alt: License GPLv3	 

.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6670011.svg
   :target: https://doi.org/10.5281/zenodo.6670011
   :alt: Zenodo


        

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 6 days ago

Total Commits: 132
Total Committers: 2
Avg Commits per committer: 66.0
Development Distribution Score (DDS): 0.023

Commits in past year: 22
Committers in past year: 1
Avg Commits per committer in past year: 22.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Ghislain Vieilledent g****t@c****r 129
12rambau p****9@g****m 3

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 7
Total pull requests: 1
Average time to close issues: about 1 month
Average time to close pull requests: about 16 hours
Total issue authors: 4
Total pull request authors: 1
Average comments per issue: 3.0
Average comments per pull request: 1.0
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0

Past year issues: 1
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 0
Past year average comments per issue: 0.0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ghislainv/riskmapjnr

Top Issue Authors

  • 12rambau (4)
  • jaimegarbanzo (1)
  • nbipul (1)
  • sujitmg (1)

Top Pull Request Authors

  • 12rambau (1)

Top Issue Labels

Top Pull Request Labels


Package metadata

pypi.org: riskmapjnr

Mapping deforestation risk following JNR methodology

  • Homepage: https://github.com/ghislainv/riskmapjnr
  • Documentation: https://riskmapjnr.readthedocs.io/
  • Licenses: GPLv3
  • Latest release: 1.3.2 (published 10 months ago)
  • Last Synced: 2025-04-25T18:31:25.751Z (1 day ago)
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 303 Last month
  • Rankings:
    • Dependent packages count: 7.31%
    • Forks count: 14.274%
    • Stargazers count: 14.537%
    • Average: 20.786%
    • Dependent repos count: 22.088%
    • Downloads: 45.722%
  • Maintainers (1)

Dependencies

requirements.txt pypi
  • gdal *
  • matplotlib *
  • numpy *
  • pandas *
  • scipy *
setup.py pypi
  • gdal *
  • pandas *
.github/workflows/github-pages.yml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/python-package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/wheel-pypi.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • pypa/gh-action-pypi-publish release/v1 composite
environment.yml conda
  • _libgcc_mutex 0.1
  • _openmp_mutex 4.5
  • alsa-lib 1.2.3
  • boost-cpp 1.74.0
  • bzip2 1.0.8
  • c-ares 1.17.2
  • ca-certificates 2021.5.30
  • cairo 1.16.0
  • certifi 2021.5.30
  • cfitsio 3.470
  • curl 7.79.1
  • cycler 0.10.0
  • dbus 1.13.6
  • expat 2.4.1
  • flake8 3.9.2
  • font-ttf-dejavu-sans-mono 2.37
  • font-ttf-inconsolata 3.000
  • font-ttf-source-code-pro 2.038
  • font-ttf-ubuntu 0.83
  • fontconfig 2.13.1
  • fonts-conda-ecosystem 1
  • fonts-conda-forge 1
  • freetype 2.10.4
  • freexl 1.0.6
  • gdal 3.3.2
  • geos 3.9.1
  • geotiff 1.7.0
  • gettext 0.19.8.1
  • giflib 5.2.1
  • glib 2.68.4
  • glib-tools 2.68.4
  • gst-plugins-base 1.18.5
  • gstreamer 1.18.5
  • hdf4 4.2.15
  • hdf5 1.12.1
  • icu 68.1
  • importlib-metadata 4.8.1
  • jbig 2.1
  • jpeg 9d
  • json-c 0.15
  • kealib 1.4.14
  • kiwisolver 1.3.2
  • krb5 1.19.2
  • lcms2 2.12
  • ld_impl_linux-64 2.36.1
  • lerc 2.2.1
  • libblas 3.9.0
  • libcblas 3.9.0
  • libclang 11.1.0
  • libcurl 7.79.1
  • libdap4 3.20.6
  • libdeflate 1.7
  • libedit 3.1.20191231
  • libev 4.33
  • libevent 2.1.10
  • libffi 3.4.2
  • libgcc-ng 11.2.0
  • libgdal 3.3.2
  • libgfortran-ng 11.2.0
  • libgfortran5 11.2.0
  • libglib 2.68.4
  • libgomp 11.2.0
  • libiconv 1.16
  • libkml 1.3.0
  • liblapack 3.9.0
  • libllvm11 11.1.0
  • libnetcdf 4.8.1
  • libnghttp2 1.43.0
  • libogg 1.3.4
  • libopenblas 0.3.17
  • libopus 1.3.1
  • libpng 1.6.37
  • libpq 13.3
  • librttopo 1.1.0
  • libspatialite 5.0.1
  • libssh2 1.10.0
  • libstdcxx-ng 11.2.0
  • libtiff 4.3.0
  • libuuid 2.32.1
  • libvorbis 1.3.7
  • libwebp-base 1.2.1
  • libxcb 1.13
  • libxkbcommon 1.0.3
  • libxml2 2.9.12
  • libzip 1.8.0
  • libzlib 1.2.11
  • lz4-c 1.9.3
  • matplotlib 3.4.3
  • matplotlib-base 3.4.3
  • mccabe 0.6.1
  • mysql-common 8.0.25
  • mysql-libs 8.0.25
  • ncurses 6.2
  • nspr 4.30
  • nss 3.69
  • numpy 1.21.2
  • olefile 0.46
  • openjpeg 2.4.0
  • openssl 1.1.1l
  • pandas 1.3.3
  • pcre 8.45
  • pillow 8.3.2
  • pip 21.2.4
  • pixman 0.40.0
  • poppler 21.09.0
  • poppler-data 0.4.11
  • postgresql 13.3
  • proj 8.1.1
  • pthread-stubs 0.4
  • pycodestyle 2.7.0
  • pyflakes 2.3.1
  • pyparsing 2.4.7
  • pyqt 5.12.3
  • pyqt-impl 5.12.3
  • pyqt5-sip 4.19.18
  • pyqtchart 5.12
  • pyqtwebengine 5.12.1
  • python 3.9.7
  • python-dateutil 2.8.2
  • python_abi 3.9
  • pytz 2021.1
  • qt 5.12.9
  • readline 8.1
  • scipy 1.7.1
  • setuptools 58.0.4
  • six 1.16.0
  • sqlite 3.36.0
  • tiledb 2.3.4
  • tk 8.6.11
  • tornado 6.1
  • tzcode 2021a
  • tzdata 2021b
  • wheel 0.37.0
  • xerces-c 3.2.3
  • xorg-kbproto 1.0.7
  • xorg-libice 1.0.10
  • xorg-libsm 1.2.3
  • xorg-libx11 1.7.2
  • xorg-libxau 1.0.9
  • xorg-libxdmcp 1.1.3
  • xorg-libxext 1.3.4
  • xorg-libxrender 0.9.10
  • xorg-renderproto 0.11.1
  • xorg-xextproto 7.3.0
  • xorg-xproto 7.0.31
  • xz 5.2.5
  • zipp 3.6.0
  • zlib 1.2.11
  • zstd 1.5.0

Score: 9.709295823171686