Skip to content

Commit 7366b7f

Browse files
8.3.0
1 parent 9ab5dd5 commit 7366b7f

112 files changed

Lines changed: 67830 additions & 43090 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# classification of remote sensing images, providing tools for the download,
44
# the preprocessing and postprocessing of images.
55
# begin: 2012-12-29
6-
# Copyright (C) 2012-2023 by Luca Congedo.
6+
# Copyright (C) 2012-2024 by Luca Congedo.
77
# Author: Luca Congedo
88
# Email: ing.congedoluca@gmail.com
99
#
@@ -34,7 +34,7 @@ def description():
3434

3535

3636
def version():
37-
return 'Version 8.2.2 - Infinity'
37+
return 'Version 8.3.0 - Infinity'
3838

3939

4040
def icon():

core/config.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# classification of remote sensing images, providing tools for the download,
44
# the preprocessing and postprocessing of images.
55
# begin: 2012-12-29
6-
# Copyright (C) 2012-2023 by Luca Congedo.
6+
# Copyright (C) 2012-2024 by Luca Congedo.
77
# Author: Luca Congedo
88
# Email: ing.congedoluca@gmail.com
99
#
@@ -27,9 +27,10 @@
2727
scatter_plot_dlg = widget_dialog = settings = system_platform = logger = None
2828
util_qgis = rs = bandset_catalog = plugin_dir = temp_dir = accuracy = None
2929
dialog_accepted = class_report = class_vector = script = band_calc = None
30-
cross_classification = dilation = erosion = sieve = neighbor = rgb_combo = None
31-
reclassification = band_combination = pca_tab = vector_to_raster = None
32-
stack_bandset = split_bands = reproject_bands = masking_bands = None
30+
cross_classification = dilation = rgb_combo = neighbor = clustering = None
31+
reclassification = band_combination = pca_tab = vector_to_raster = sieve = None
32+
stack_bandset = split_bands = reproject_bands = masking_bands = erosion = None
33+
spectral_distance = raster_zonal_stats = None
3334
image_conversion = clip_bands = clip_bands_pointer = mosaic_bandsets = None
3435
download_products = download_products_pointer = util_qt = translate = None
3536
classification = working_toolbar = classification_preview_pointer = None
@@ -61,6 +62,8 @@
6162
download_table = preprocess_band_table = None
6263
# classification preview layer
6364
classification_preview = classifier_preview = preview_point = None
65+
# edit raster
66+
edit_old_array = edit_column_start = edit_row_start = None
6467
# saved directory
6568
last_saved_dir = ''
6669
project_path = ''

core/messages.py

Lines changed: 172 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# classification of remote sensing images, providing tools for the download,
44
# the preprocessing and postprocessing of images.
55
# begin: 2012-12-29
6-
# Copyright (C) 2012-2023 by Luca Congedo.
6+
# Copyright (C) 2012-2024 by Luca Congedo.
77
# Author: Luca Congedo
88
# Email: ing.congedoluca@gmail.com
99
#
@@ -21,7 +21,8 @@
2121
# If not, see <https://www.gnu.org/licenses/>.
2222

2323

24-
from PyQt5.QtWidgets import QMessageBox, QToolButton
24+
from PyQt5.QtWidgets import QMessageBox, QToolButton, QApplication
25+
# noinspection PyUnresolvedReferences
2526
from qgis.core import Qgis
2627

2728
cfg = __import__(str(__name__).split('.')[0] + '.core.config', fromlist=[''])
@@ -52,7 +53,13 @@ def msg_bar(title, message):
5253

5354
# message bar information
5455
def msg_bar_info(message):
55-
msg_bar(cfg.translate('SCP information'), message)
56+
# noinspection PyTypeChecker
57+
msg_bar(
58+
QApplication.translate(
59+
'semiautomaticclassificationplugin',
60+
'SCP information'
61+
), message
62+
)
5663

5764

5865
# Message bar error
@@ -67,7 +74,11 @@ def msg_bar_critical(title, message):
6774

6875
# Message bar error
6976
def msg_bar_error(message):
70-
msg_bar_critical(cfg.translate('Error'), message=message)
77+
# noinspection PyTypeChecker
78+
msg_bar_critical(
79+
QApplication.translate('semiautomaticclassificationplugin', 'Error'),
80+
message=message
81+
)
7182

7283

7384
# message bar warning
@@ -82,7 +93,12 @@ def _msg_bar_warning(title, message):
8293

8394
# message bar warning
8495
def msg_bar_warning(message):
85-
_msg_bar_warning(title=cfg.translate('Warning'), message=message)
96+
# noinspection PyTypeChecker
97+
_msg_bar_warning(
98+
title=QApplication.translate(
99+
'semiautomaticclassificationplugin', 'Warning'
100+
), message=message
101+
)
86102

87103

88104
''' Messages for callback '''
@@ -108,111 +124,234 @@ def error(message):
108124

109125

110126
def msg_test(message):
111-
msg_box(cfg.translate('Test results'), message)
127+
# noinspection PyTypeChecker
128+
msg_box(
129+
QApplication.translate(
130+
'semiautomaticclassificationplugin', 'Test results'
131+
), message
132+
)
112133

113134

114135
def msg_inf_1():
115-
msg_bar_info(cfg.translate('Training input cannot be edited'))
136+
# noinspection PyTypeChecker
137+
msg_bar_info(
138+
QApplication.translate(
139+
'semiautomaticclassificationplugin',
140+
'Training input cannot be edited'
141+
)
142+
)
116143

117144

118145
def msg_inf_2():
119-
msg_bar_info(cfg.translate('At least 3 points are required'))
146+
# noinspection PyTypeChecker
147+
msg_bar_info(
148+
QApplication.translate(
149+
'semiautomaticclassificationplugin',
150+
'At least 3 points are required'
151+
)
152+
)
120153

121154

122155
def msg_inf_3():
123-
msg_bar_info(cfg.translate('Detailed log is active'))
156+
# noinspection PyTypeChecker
157+
msg_bar_info(
158+
QApplication.translate(
159+
'semiautomaticclassificationplugin', 'Detailed log is active'
160+
)
161+
)
124162

125163

126164
def msg_inf_4():
127-
msg_bar_info(cfg.translate('Training vector exported'))
165+
# noinspection PyTypeChecker
166+
msg_bar_info(
167+
QApplication.translate(
168+
'semiautomaticclassificationplugin', 'Training vector exported'
169+
)
170+
)
128171

129172

130173
def msg_inf_5():
131-
msg_bar_info(cfg.translate('Enter class values'))
174+
# noinspection PyTypeChecker
175+
msg_bar_info(
176+
QApplication.translate(
177+
'semiautomaticclassificationplugin', 'Enter class values'
178+
)
179+
)
132180

133181

134182
def msg_inf_6():
135-
msg_bar_info(cfg.translate('Process completed'))
183+
# noinspection PyTypeChecker
184+
msg_bar_info(
185+
QApplication.translate(
186+
'semiautomaticclassificationplugin', 'Process completed'
187+
)
188+
)
189+
190+
191+
def msg_inf_7():
192+
# noinspection PyTypeChecker
193+
msg_bar_info(
194+
QApplication.translate(
195+
'semiautomaticclassificationplugin', 'Training Band set updated'
196+
)
197+
)
136198

137199

138200
""" Errors """
139201

140202

141203
def msg_err_1():
142-
msg_bar_error(cfg.translate('Process failed'))
204+
# noinspection PyTypeChecker
205+
msg_bar_error(
206+
QApplication.translate(
207+
'semiautomaticclassificationplugin', 'Process failed'
208+
)
209+
)
143210

144211

145212
def msg_err_2():
146-
msg_bar_error(cfg.translate('Bandset not found'))
213+
# noinspection PyTypeChecker
214+
msg_bar_error(
215+
QApplication.translate(
216+
'semiautomaticclassificationplugin', 'Bandset not found'
217+
)
218+
)
147219

148220

149221
def msg_err_3():
150-
msg_bar_error(cfg.translate('Area coordinates error'))
222+
# noinspection PyTypeChecker
223+
msg_bar_error(
224+
QApplication.translate(
225+
'semiautomaticclassificationplugin', 'Area coordinates error'
226+
)
227+
)
151228

152229

153230
def msg_err_4():
154-
msg_bar_error(cfg.translate('Unable to create RGB color composite'))
231+
# noinspection PyTypeChecker
232+
msg_bar_error(
233+
QApplication.translate(
234+
'semiautomaticclassificationplugin',
235+
'Unable to create RGB color composite'
236+
)
237+
)
155238

156239

157240
def msg_err_5():
158-
msg_bar_error(cfg.translate('Unable to open file'))
241+
# noinspection PyTypeChecker
242+
msg_bar_error(
243+
QApplication.translate(
244+
'semiautomaticclassificationplugin', 'Unable to open file'
245+
)
246+
)
159247

160248

161249
def msg_err_6():
162-
msg_bar_error(cfg.translate('Unable to calculate'))
250+
# noinspection PyTypeChecker
251+
msg_bar_error(
252+
QApplication.translate(
253+
'semiautomaticclassificationplugin', 'Unable to calculate'
254+
)
255+
)
163256

164257

165258
def msg_err_7():
166-
msg_bar_error(cfg.translate('Expression error'))
259+
# noinspection PyTypeChecker
260+
msg_bar_error(
261+
QApplication.translate(
262+
'semiautomaticclassificationplugin', 'Expression error'
263+
)
264+
)
265+
266+
267+
def msg_err_8():
268+
# noinspection PyTypeChecker
269+
msg_bar_error(
270+
QApplication.translate(
271+
'semiautomaticclassificationplugin',
272+
'Incompatible CRS, please create a new training input'
273+
)
274+
)
167275

168276

169277
""" Warnings """
170278

171279

172280
def msg_war_1():
173-
msg_bar_warning(cfg.translate('Pixel resolution undefined'))
281+
# noinspection PyTypeChecker
282+
msg_bar_warning(
283+
QApplication.translate(
284+
'semiautomaticclassificationplugin', 'Pixel resolution undefined'
285+
)
286+
)
174287

175288

176289
def msg_war_2():
290+
# noinspection PyTypeChecker
177291
msg_bar_warning(
178-
cfg.translate(
292+
QApplication.translate(
293+
'semiautomaticclassificationplugin',
179294
'Unable to define hidden layer size, setting default 100'
180-
)
295+
)
181296
)
182297

183298

184299
def msg_war_3():
300+
# noinspection PyTypeChecker
185301
msg_bar_warning(
186-
cfg.translate(
302+
QApplication.translate(
303+
'semiautomaticclassificationplugin',
187304
'Point outside band set or band set not defined'
188-
)
305+
)
189306
)
190307

191308

192309
def msg_war_4():
193-
msg_bar_warning(cfg.translate('ROI not found'))
310+
# noinspection PyTypeChecker
311+
msg_bar_warning(
312+
QApplication.translate(
313+
'semiautomaticclassificationplugin', 'ROI not found'
314+
)
315+
)
194316

195317

196318
def msg_war_5():
319+
# noinspection PyTypeChecker
197320
msg_bar_warning(
198-
cfg.translate(
321+
QApplication.translate(
322+
'semiautomaticclassificationplugin',
199323
'Select a training input; input is not loaded'
200-
)
324+
)
201325
)
202326

203327

204328
def msg_war_6(bandset_number=None):
329+
# noinspection PyTypeChecker
205330
msg_bar_warning(
206-
cfg.translate('Band set') + ' ' + str(bandset_number) + ' '
207-
+ cfg.translate('is empty')
331+
QApplication.translate(
332+
'semiautomaticclassificationplugin', 'Band set'
333+
) + ' ' + str(bandset_number) + ' '
334+
+ QApplication.translate(
335+
'semiautomaticclassificationplugin', 'is empty'
336+
)
208337
)
209338

210339

211340
def msg_war_7():
212-
msg_bar_warning(cfg.translate(
213-
'No band found. Check metadata inside the directory')
214-
)
341+
# noinspection PyTypeChecker
342+
msg_bar_warning(
343+
QApplication.translate(
344+
'semiautomaticclassificationplugin',
345+
'No band found. Check metadata inside the directory'
346+
)
347+
)
215348

216349

217350
def msg_war_8():
218-
msg_bar_warning(cfg.translate('No tool selected'))
351+
# noinspection PyTypeChecker
352+
msg_bar_warning(
353+
QApplication.translate(
354+
'semiautomaticclassificationplugin',
355+
'No tool selected'
356+
)
357+
)

0 commit comments

Comments
 (0)