forked from UMEP-dev/UMEP-processing
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocessing_umep_provider.py
More file actions
182 lines (159 loc) · 6.9 KB
/
Copy pathprocessing_umep_provider.py
File metadata and controls
182 lines (159 loc) · 6.9 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ProcessingUMEP
A QGIS plugin
UMEP for processing toolbox
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2020-04-02
copyright : (C) 2020 by Fredrik Lindberg
email : fredrikl@gvc.gu.se
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
"""
__author__ = "Fredrik Lindberg"
__date__ = "2020-04-02"
__copyright__ = "(C) 2020 by Fredrik Lindberg"
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = "$Format:%H$"
from qgis.core import QgsProcessingProvider
from .preprocessor.wall_heightaspect_algorithm import (
ProcessingWallHeightAscpetAlgorithm,
)
from .preprocessor.skyviewfactor_algorithm import (
ProcessingSkyViewFactorAlgorithm,
)
from .preprocessor.copernicusera5_algorithm import (
ProcessingCopernicusERA5Algorithm,
)
from .preprocessor.imagemorphparmspoint_algorithm import (
ProcessingImageMorphParmsPointAlgorithm,
)
from .preprocessor.imagemorphparms_algorithm import (
ProcessingImageMorphParmsAlgorithm,
)
from .preprocessor.landcoverfractionpoint_algorithm import (
ProcessingLandCoverFractionPointAlgorithm,
)
from .preprocessor.landcoverfraction_algorithm import (
ProcessingLandCoverFractionAlgorithm,
)
from .preprocessor.dsm_generator_algorithm import (
ProcessingDSMGeneratorAlgorithm,
)
from .preprocessor.treegenerator_algorithm import (
ProcessingTreeGeneratorAlgorithm,
)
from .preprocessor.uwgprepare_algorithm import ProcessingUWGPrepareAlgorithm
from .preprocessor.targetprepare_algorithm import (
ProcessingTARGETPrepareAlgorithm,
)
from .preprocessor.urock_prepare_algorithm import URockPrepareAlgorithm
from .processor.suews_algorithm import ProcessingSuewsAlgorithm
from .processor.shadow_generator_algorithm import (
ProcessingShadowGeneratorAlgorithm,
)
from .processor.sebe_algorithm import ProcessingSEBEAlgorithm
from .processor.solweig_algorithm import ProcessingSOLWEIGAlgorithm
from .processor.uwg_algorithm import ProcessingUWGProcessorAlgorithm
from .processor.urock_processing_algorithm import URockAlgorithm
from .processor.target_algorithm import ProcessingTargetProcessorAlgorithm
from .postprocessor.solwieganalyzer_algorithm import (
ProcessingSolweigAnalyzerAlgorithm,
)
from .postprocessor.suewsanalyzer_algorithm import (
ProcessingSuewsAnalyzerAlgorithm,
)
from .postprocessor.treeplanter_algorithm import ProcessingTreePlanterAlgorithm
from .postprocessor.uwganalyzer_algorithm import ProcessingUWGAnalyzerAlgorithm
from .postprocessor.spatialtc_algorithm import ProcessingSpatialTCAlgorithm
from .postprocessor.urock_analyser_algorithm import URockAnalyserAlgorithm
from .postprocessor.targetanalyzer_algorithm import (
ProcessingTARGETAnalyzerAlgorithm,
)
import os.path
from qgis.PyQt.QtGui import QIcon
class ProcessingUMEPProvider(QgsProcessingProvider):
def __init__(self):
"""
Default constructor.
"""
self.plugin_dir = os.path.dirname(__file__)
QgsProcessingProvider.__init__(self)
if not (os.path.isdir(self.plugin_dir + "/temp")):
os.mkdir(self.plugin_dir + "/temp")
def unload(self):
"""
Unloads the provider. Any tear-down steps required by the provider
should be implemented here.
"""
def loadAlgorithms(self):
"""
Loads all algorithms belonging to this provider.
"""
# Preprocessor
self.addAlgorithm(ProcessingSkyViewFactorAlgorithm())
self.addAlgorithm(ProcessingWallHeightAscpetAlgorithm())
self.addAlgorithm(ProcessingImageMorphParmsPointAlgorithm())
self.addAlgorithm(ProcessingCopernicusERA5Algorithm())
self.addAlgorithm(ProcessingImageMorphParmsAlgorithm())
self.addAlgorithm(ProcessingLandCoverFractionPointAlgorithm())
self.addAlgorithm(ProcessingLandCoverFractionAlgorithm())
self.addAlgorithm(ProcessingDSMGeneratorAlgorithm())
self.addAlgorithm(ProcessingTreeGeneratorAlgorithm())
self.addAlgorithm(ProcessingUWGPrepareAlgorithm())
self.addAlgorithm(ProcessingTARGETPrepareAlgorithm())
self.addAlgorithm(URockPrepareAlgorithm())
# Processor
self.addAlgorithm(ProcessingSEBEAlgorithm())
self.addAlgorithm(ProcessingShadowGeneratorAlgorithm())
self.addAlgorithm(ProcessingSOLWEIGAlgorithm())
self.addAlgorithm(ProcessingSuewsAlgorithm())
self.addAlgorithm(ProcessingTreePlanterAlgorithm())
self.addAlgorithm(ProcessingUWGProcessorAlgorithm())
self.addAlgorithm(ProcessingTargetProcessorAlgorithm())
self.addAlgorithm(URockAlgorithm())
# Postprocessor
self.addAlgorithm(ProcessingSolweigAnalyzerAlgorithm())
self.addAlgorithm(ProcessingSuewsAnalyzerAlgorithm())
self.addAlgorithm(ProcessingUWGAnalyzerAlgorithm())
self.addAlgorithm(ProcessingTARGETAnalyzerAlgorithm())
self.addAlgorithm(ProcessingSpatialTCAlgorithm())
self.addAlgorithm(URockAnalyserAlgorithm())
def id(self):
"""
Returns the unique provider id, used for identifying the provider. This
string should be a unique, short, character only string, eg "qgis" or
"gdal". This string should not be localised.
"""
return "umep"
def name(self):
"""
Returns the provider name, which is used to describe the provider
within the GUI.
This string should be short (e.g. "Lastools") and localised.
"""
return "UMEP"
def icon(self):
"""
Should return a QIcon which is used for your provider inside
the Processing toolbox.
"""
icon = QIcon(os.path.dirname(__file__) + "/icons/icon_umep.png")
return icon
def longName(self):
"""
Returns the a longer version of the provider name, which can include
extra details such as version numbers. E.g. "Lastools LIDAR tools
(version 2.2.1)". This string should be localised. The default
implementation returns the same string as name().
"""
return "UMEP for Processing, Version 3.0.1"