riskmapjnr


Nameriskmapjnr JSON
Version 1.3.2 PyPI version JSON
download
home_pagehttps://github.com/ghislainv/riskmapjnr
SummaryMapping deforestation risk following JNR methodology
upload_time2024-07-12 23:17:36
maintainerNone
docs_urlNone
authorGhislain Vieilledent
requires_python>=3.6
licenseGPLv3
keywords carbon deforestation emissions forests jnr map probabilityredd risk tropics vcs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ..
   # ==============================================================================
   # author          :Ghislain Vieilledent
   # email           :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com
   # 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
<https://docs.conda.io/en/latest/miniconda.html>`__).

Then, create a conda environment (details `here
<https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`__)
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 <https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`__).

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
<https://ecology.ghislainv.fr/riskmapjnr/notebooks/get_started.html>`__
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
<https://ecology.ghislainv.fr/riskmapjnr/license.html>`__. Anybody
who is interested can contribute to the package development following
our `Community guidelines
<https://ecology.ghislainv.fr/riskmapjnr/contributing.html>`__. Every
contributor must agree to follow the project's `Code of conduct
<https://ecology.ghislainv.fr/riskmapjnr/code_of_conduct.html>`__.


.. |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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ghislainv/riskmapjnr",
    "name": "riskmapjnr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "carbon deforestation emissions forests jnr map probabilityredd risk tropics vcs",
    "author": "Ghislain Vieilledent",
    "author_email": "ghislain.vieilledent@cirad.fr",
    "download_url": "https://files.pythonhosted.org/packages/20/a0/9dc490342229f88dada540b537267ff42d68b18710e2e50b041d8779c497/riskmapjnr-1.3.2.tar.gz",
    "platform": null,
    "description": "..\n   # ==============================================================================\n   # author          :Ghislain Vieilledent\n   # email           :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com\n   # web             :https://ecology.ghislainv.fr\n   # license         :GPLv3\n   # ==============================================================================\n\n.. image:: https://ecology.ghislainv.fr/riskmapjnr/_static/logo-riskmapjnr.svg\n   :align: right\n   :target: https://ecology.ghislainv.fr/riskmapjnr\n   :alt: Logo riskmapjnr\n   :width: 140px\n\n``riskmapjnr`` Python package\n*****************************\n\n|Python version| |PyPI version| |GitHub Actions| |License| |Zenodo|\n\n\nOverview\n========\n\nThe ``riskmapjnr`` Python package can be used to obtain **maps of the\nspatial risk of deforestation and forest degradation** following the\nmethodology developed in the context of the Jurisdictional and Nested\nREDD+ (`JNR`_) and using only a forest cover change map as input.\n\n.. _JNR:\n   https://verra.org/project/jurisdictional-and-nested-redd-framework/\n\n.. image:: https://ecology.ghislainv.fr/riskmapjnr/_static/riskmapjnr-example.png\n   :align: center\n   :target: https://ecology.ghislainv.fr/riskmapjnr\n   :alt: riskmapjnr-example\n   :width: 1300px\n\n\nStatement of Need\n=================\n\nThe `VCS`_ (Verified Carbon Standard) program allows certified\nprojects to turn their greenhouse gas (GHG) emission reductions and\nremovals into tradable carbon credits. Since its launch in 2006, the\nVCS program has grown into the world's largest voluntary GHG program.\n\nIn the forest sector, programs to mitigate GHG emissions across entire\nnational or subnational jurisdictions (called `REDD+`_ programs,\ni.e. programs aiming at Reducing Emissions from Deforestation and\nForest Degradation) can be accounted for and credited using a\njurisdictional-scale framework, the Jurisdictional and Nested REDD+\n(`JNR`_) framework. JNR integrates government-led and project-level\nREDD+ activities and establishes a clear pathway for subnational- and\nproject-level activities to be incorporated within broader REDD+\nprograms. The JNR framework ensures all projects and other reducing\nemissions from deforestation and degradation activities in a given\njurisdiction are developed using consistent baselines and crediting\napproaches. They mitigate the risk of \"leakage\", i.e. the displacement\nof emission-causing activities to areas outside the project boundary,\nby monitoring emissions across an entire jurisdictional area.\n\nThe `JNR Risk Mapping Tool`_ is a \"benchmark\" methodology that\nprovides a standardized approach for developing deforestation and\nforest degradation risk maps for users of the `JNR Allocation Tool`_\nin the context of Jurisdictional and Nested REDD+ (JNR)\nrequirements. The methodology allows deriving a map of the\ndeforestation (or degradation) risk based on a minimal spatial\ninformation provided by the past deforestation (or degradation) map at\nthe jurisdictional scale.\n\nThe `JNR Risk Mapping Tool`_ allows the creation of categorical and\nspatially static maps whose categories represent different levels of\nrisk of deforestation or forest degradation in the validity period of\nthe Forest Reference Emissions Level (FREL) and throughout the\njurisdictional geographical boundaries. In the `JNR Allocation Tool`_,\nthe level of risk determines how the jurisdictional FREL is spatially\ndistributed to nested lower-level jurisdictional programs and\nprojects.\n\nWhile the `JNR Risk Mapping Tool`_ methodology favors simplicity,\nobtaining the risk map is not straightforward. The approach requires\nseveral geoprocessing steps on raster data that can be large,\ni.e. covering large spatial extent (eg. national scale) at high\nspatial resolution (eg. 30 m). The ``riskmapjnr`` Python package\nincludes functions to perform these geoprocessing steps and derive a\nrisk map on any jurisdiction and at any spatial resolution following\nthe `JNR Risk Mapping Tool`_ methodology.\n\n.. _VCS:\n   https://verra.org/project/vcs-program/\n\n.. _REDD+:\n   https://redd.unfccc.int/\n\n.. _JNR:\n   https://verra.org/project/jurisdictional-and-nested-redd-framework/\n   \n.. _JNR Risk Mapping Tool:\n   https://verra.org/wp-content/uploads/2021/04/DRAFT_JNR_Risk_Mapping_Tool_15APR2021.pdf\n\n.. _JNR Allocation Tool:\n   https://verra.org/wp-content/uploads/2021/04/JNR_Allocation_Tool_Guidance_v4.0.pdf\n\nInstallation\n============\n\nYou will need several dependencies to run the ``riskmapjnr`` Python\npackage. The best way to install the package is to create a Python\nvirtual environment, either through ``conda`` (recommended) or\n``virtualenv``.\n\nUsing ``conda`` (recommended)\n+++++++++++++++++++++++++++++\n\nYou first need to have ``miniconda3`` installed (see `here\n<https://docs.conda.io/en/latest/miniconda.html>`__).\n\nThen, create a conda environment (details `here\n<https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`__)\nand install the ``riskmapjnr`` package with the following commands:\n\n.. code-block:: shell\n\t\t\n   conda create --name conda-rmj -c conda-forge python=3 gdal numpy matplotlib pandas pip scipy --yes\n   conda activate conda-rmj\n   pip install riskmapjnr # For PyPI version\n   # pip install https://github.com/ghislainv/riskmapjnr/archive/master.zip # For GitHub dev version\n   # conda install -c conda-forge sphinx flake8 jedi jupyter geopandas descartes folium --yes  # Optional additional packages\n\nTo deactivate and delete the conda environment:\n\n.. code-block:: shell\n\t\t\n   conda deactivate\n   conda env remove --name conda-rmj\n\nUsing ``virtualenv``\n++++++++++++++++++++\n\nYou first need to have the ``virtualenv`` package installed (see `here <https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`__).\n\nThen, create a virtual environment and install the ``riskmapjnr``\npackage with the following commands:\n\n.. code-block:: shell\n\n   cd ~\n   mkdir venvs # Directory for virtual environments\n   cd venvs\n   virtualenv --python=/usr/bin/python3 venv-rmj\n   source ~/venvs/venv-rmj/bin/activate\n   # Install numpy first\n   pip install numpy\n   # Install gdal (the correct version) \n   pip install --global-option=build_ext --global-option=\"-I/usr/include/gdal\" gdal==$(gdal-config --version)\n   pip install riskmapjnr # For PyPI version, this will install all other dependencies\n   # pip install https://github.com/ghislainv/riskmapjnr/archive/master.zip # For GitHub dev version\n   # pip install sphinx flake8 jedi jupyter geopandas descartes folium # Optional additional packages\n\nTo deactivate and delete the virtual environment:\n\n.. code-block:: shell\n\t\t\n   deactivate\n   rm -R ~/venvs/venv-rmj # Just remove the repository\n\nInstallation testing\n++++++++++++++++++++\n\nYou can test that the package has been correctly installed using the\ncommand ``riskmapjnr`` in a terminal:\n\n.. code-block:: shell\n\n  riskmapjnr\n\nThis should return a short description of the ``riskmapjnr`` package\nand the version number:\n\n.. code-block:: shell\n\n  # riskmapjnr: Map of deforestation risk following JNR methodology.\n  # https://ecology.ghislainv.fr/riskmapjnr/\n  # riskmapjnr version x.x.\n\nYou can also test the package executing the commands in the `Get\nstarted\n<https://ecology.ghislainv.fr/riskmapjnr/notebooks/get_started.html>`__\ntutorial.\n   \nMain functionalities\n====================\n\nThe ``riskmapjnr`` package includes functions to:\n\n1. Estimate the distance to forest edge beyond which the deforestation\n   risk is negligible: ``dist_edge_threshold()``.\n2. Compute local deforestation rates using a moving window whose size\n   can vary: ``local_defor_rate()``.\n3. Transform local deforestation rates into categories of\n   deforestation risks using several slicing algorithms:\n   ``set_defor_cat_zero()`` and ``defor_cat()``\n4. Validate maps of deforestation risk and select the map with the\n   higher accuracy: ``defrate_per_cat()`` and ``validation()``.\n\nThe ``riskmapjnr`` package uses several known Python scientific\npackages such as ``NumPy``, ``SciPy``, and ``Pandas`` for fast matrix\nand vector operations and ``gdal`` for processing georeferenced raster\ndata. Raster data are divided into blocks of data for in-memory\nprocessing. Such an approach allow processing large raster files with\nlarge geographical extents (e.g. country scale) and high spatial\nresolutions (eg. 30 m).\n\nContributing\n============\n\nThe ``riskmapjnr`` Python package is Open Source and released under\nthe `GNU GPL version 3 license\n<https://ecology.ghislainv.fr/riskmapjnr/license.html>`__. Anybody\nwho is interested can contribute to the package development following\nour `Community guidelines\n<https://ecology.ghislainv.fr/riskmapjnr/contributing.html>`__. Every\ncontributor must agree to follow the project's `Code of conduct\n<https://ecology.ghislainv.fr/riskmapjnr/code_of_conduct.html>`__.\n\n\n.. |Python version| image:: https://img.shields.io/pypi/pyversions/riskmapjnr?logo=python&logoColor=ffd43b&color=306998\n   :target: https://pypi.org/project/riskmapjnr\n   :alt: Python version\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/riskmapjnr\n   :target: https://pypi.org/project/riskmapjnr\n   :alt: PyPI version\n\n.. |GitHub Actions| image:: https://github.com/ghislainv/riskmapjnr/actions/workflows/python-package.yml/badge.svg\n   :target: https://github.com/ghislainv/riskmapjnr/actions/workflows/python-package.yml\n   :alt: GitHub Actions\n\t \n.. |License| image:: https://img.shields.io/badge/licence-GPLv3-8f10cb.svg\n   :target: https://www.gnu.org/licenses/gpl-3.0.html\n   :alt: License GPLv3\t \n\n.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6670011.svg\n   :target: https://doi.org/10.5281/zenodo.6670011\n   :alt: Zenodo\n\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Mapping deforestation risk following JNR methodology",
    "version": "1.3.2",
    "project_urls": {
        "Homepage": "https://github.com/ghislainv/riskmapjnr"
    },
    "split_keywords": [
        "carbon",
        "deforestation",
        "emissions",
        "forests",
        "jnr",
        "map",
        "probabilityredd",
        "risk",
        "tropics",
        "vcs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd488eed47e83d786952a44929695dceb5982f5de8a8ec72f89acb8925bd2741",
                "md5": "f3620818b61042230ff3b6c02c989c75",
                "sha256": "db5f3156eeff788b75e1d8da4e64dfdb86aaffaf302273c1f5ec8905fb4ae1c5"
            },
            "downloads": -1,
            "filename": "riskmapjnr-1.3.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f3620818b61042230ff3b6c02c989c75",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 450769,
            "upload_time": "2024-07-12T23:17:34",
            "upload_time_iso_8601": "2024-07-12T23:17:34.883902Z",
            "url": "https://files.pythonhosted.org/packages/bd/48/8eed47e83d786952a44929695dceb5982f5de8a8ec72f89acb8925bd2741/riskmapjnr-1.3.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20a09dc490342229f88dada540b537267ff42d68b18710e2e50b041d8779c497",
                "md5": "0f1d75da4adf5b45dda6f9e0dd5dc274",
                "sha256": "003189c353c6eed74ea88d731a7d3537752654f160df8b4fb0ce1ba62ed9e9fb"
            },
            "downloads": -1,
            "filename": "riskmapjnr-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0f1d75da4adf5b45dda6f9e0dd5dc274",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 440985,
            "upload_time": "2024-07-12T23:17:36",
            "upload_time_iso_8601": "2024-07-12T23:17:36.683091Z",
            "url": "https://files.pythonhosted.org/packages/20/a0/9dc490342229f88dada540b537267ff42d68b18710e2e50b041d8779c497/riskmapjnr-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-12 23:17:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ghislainv",
    "github_project": "riskmapjnr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "riskmapjnr"
}
        
Elapsed time: 4.83400s