Installation

The EnMAP-Box is a plugin for QGIS. It requires the QGIS Python API and various other Python packages. Here we describe how you can install QGIS, the required python packages and the EnMAP-Box plugin.

1. Install QGIS

Install QGIS via the official Standalone/OSGeo4W Installer

Install either the current QGIS Long Term Release (LTR) or the current QGIS Latest Release (LR) to run the latest EnMAP-Box using the QGIS installer from https://www.qgis.org/en/site/forusers/alldownloads.html#windows.

For beginners, we recommend using the standalone installers. More advanced QGIS users can use OSGeo4W installer, which eases updates of existing QGIS installation.

In case you already have the current QGIS LTR or LR version installed, you can skip this step.

In case you have an outdated QGIS version, make sure to install a current version.

2. Install Python Dependencies

Install Python Dependencies

  1. Close QGIS, if it is open.

  2. Open the OSGeo4W Shell from the start menu.

    ../_images/windows_start_osgeo.png
  3. Install Python dependencies via PIP by executing:

    pip install --upgrade --user -r https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.env/osgeo4w/requirements_osgeo4w.txt
    

    Note

    In rare cases, the user folder may contain wrongly installed packages, which are interfering with the package version managed by OSGeo4W, e.g. numpy, scipy or gdal. Wrongly installed packages can be deleted manually from the user folder.

    To locate the user folder used by your QGIS instance, run the following inside your QGIS Python console:

    >>> import site
    >>> print(site.USER_SITE)
    C:\Users\Andreas\AppData\Roaming\Python\Python39\site-packages
    
  4. (Optional) Install additional Python dependencies for SpecDeepMap (torch, lightning, tensorboard, torchvision, and segmentation-models-pytorch)

    The dependencies are only required for using algorithms of the SpecDeepMap Application. Run the following command in the OSGeo4W Shell.

    pip install --user lightning==2.5.0.post0 segmentation-models-pytorch==0.5.0 tensorboard==2.19.0 torch==2.6.0 torchvision==0.21.0 pandas==2.2.3 --no-warn-script-location
    
  5. (Optional) Install h5py and gdal-hdf5 dependencies via the OSGeo4W installer:

    The dependencies are only required for importing PRISMA products.

    Start the OSGeo4W installer by executing:

    setup
    

    Search for h5py, select the latest version of the python3-h5py package.

    ../_images/osgeo4w_install_h5py.png

    Now search for gdal-hdf5, select the latest version and finish the installation.

  6. Open QGIS from the start menu.

3. Install EnMAP-Box

Install EnMAP-Box Plugin via the QGIS Plugin Manager

  1. Start QGIS

  2. Go to Plugins -> Manage and Install Plugins

  3. Search for ‘EnMAP-Box’

  4. Click on ‘Install Plugin’

../_images/QgisGUI_InstallPlugin.gif
Activate Experimental Plugins (Optional)
  1. Go to Plugins -> Manage and Install Plugins -> Settings

  2. Enable Show also Experimental Plugins

../_images/QgisGUI_Experimental.gif

4. How to include EnMAP-box into your Python project

Here is how you can use an algorithm from Python using the PyCharm IDE:

  1. Setup a PyCharm Project and use the Python Interpreter that comes with QGIS.

  2. Include the installed EnMAP-Box Plugin as a Sources Root.

  3. Now you can use the EnMAP-Box API, i.e. enmapbox and enmapboxprocessing modules.

    import processing
    
    from enmapbox import initAll
    from enmapbox.testing import start_app
    
    start_app()
    initAll()
    
    processing.run(
        "enmapbox:Build3DCube",
        {
            'raster':'C:/Users/Aryan/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/exampledata/aerial_potsdam.tif',
            'spectralScale':1,
            'dx':1,
            'dy':1,
            'outputCubeFace':'TEMPORARY_OUTPUT',
            'outputCubeSide':'TEMPORARY_OUTPUT'
        }
    )