OTBSettings.py 2.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- coding: utf-8 -*-

"""
***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************
"""
from builtins import str

__author__ = 'Rashad Kanavath'
__date__ = 'January 2019'
__copyright__ = '(C) CNES 2019'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

class OTBSettings(object):
    """
    OTBSetting's key names
    """
    # Checkbox to enable/disable otb provider (bool).
    ACTIVATE = "OTB_ACTIVATE"

    # Path to otb installation folder (string, directory).
    FOLDER = "OTB_FOLDER"

    # Path to otb application folder. multiple paths are supported (string, directory).
    APP_FOLDER = "OTB_APP_FOLDER"

    # A string to hold current version number. Useful for bug reporting.
    VERSION = "OTB_VERSION"

    # Default directory were DEM tiles are stored. It should only contain ```.hgt`` or or georeferenced ``.tif`` files. Empty if not set (no directory set).
    SRTM_FOLDER = "OTB_SRTM_FOLDER"

    # Default path to the geoid file that will be used to retrieve height of DEM above ellipsoid. Empty if not set (no geoid set).
    GEOID_FILE = "OTB_GEOID_FILE"

    # Default maximum memory that OTB should use for processing, in MB. If not set, default value is 128 MB.
    # This is set through environment variable ``OTB_MAX_RAM_HINT``
    MAX_RAM_HINT = 'OTB_MAX_RAM_HINT'

    # ``OTB_LOGGER_LEVEL``: Default level of logging for OTB. Should be one of ``DEBUG``, ``INFO``, ``WARNING``, ``CRITICAL`` or ``FATAL``, by increasing order of priority. Only messages with a higher priority than the level of logging will be displayed. If not set, default level is ``INFO``.
    LOGGER_LEVEL = 'OTB_LOGGER_LEVEL'
    
    @staticmethod
    def keys():
        return [
            OTBSettings.ACTIVATE,
            OTBSettings.FOLDER,
            OTBSettings.SRTM_FOLDER,
            OTBSettings.GEOID_FILE,
            OTBSettings.LOGGER_LEVEL,
            OTBSettings.MAX_RAM_HINT                
            ]