Skip to content

Commit

Permalink
8.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
semiautomaticgit committed Nov 16, 2024
1 parent 91640fc commit 1137cb9
Show file tree
Hide file tree
Showing 26 changed files with 17,070 additions and 17,042 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def description():


def version():
return 'Version 8.4.0 - Infinity'
return 'Version 8.5.0 - Infinity'


def icon():
Expand Down
4 changes: 2 additions & 2 deletions docs/repository.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<plugins>
<pyqgis_plugin name="Semi-Automatic Classification Plugin - master" version="8.3.0" plugin_id="284">
<pyqgis_plugin name="Semi-Automatic Classification Plugin - master" version="8.5.0" plugin_id="284">
<description><![CDATA[The Semi-Automatic Classification Plugin (SCP) allows for the supervised classification of remote sensing images, providing tools for the download, the preprocessing and postprocessing of images.]]></description>
<about><![CDATA[Developed by Luca Congedo, the Semi-Automatic Classification Plugin (SCP) allows for the supervised classification of remote sensing images, providing tools for the download, the preprocessing and postprocessing of images. Search and download is available for Landsat, Sentinel-2 images. Several algorithms are available for the land cover classification. This plugin requires the installation of Remotior Sensus, GDAL, OGR, Numpy, SciPy, and Matplotlib. For more information please visit https://fromgistors.blogspot.com .]]></about>
<version>8.3.0</version>
<version>8.5.0</version>
<qgis_minimum_version>3.0.0</qgis_minimum_version>
<qgis_maximum_version>3.99.0</qgis_maximum_version>
<homepage><![CDATA[https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html]]></homepage>
Expand Down
4 changes: 2 additions & 2 deletions i18n/models/semiautomaticclassificationplugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_el_GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation>Sélectionner le vecteur ou raster de référence</translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_pt_BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_uk_UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions i18n/semiautomaticclassificationplugin_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="14471"/>
<location filename="../ui/ui_semiautomaticclassificationplugin.ui" line="16084"/>
<source>Select the reference vector or raster</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -5035,7 +5035,7 @@ size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../interface/raster_zonal_stats_tab.py" line="76"/>
<location filename="../interface/raster_zonal_stats_tab.py" line="78"/>
<source>Save output</source>
<translation type="unfinished"></translation>
</message>
Expand Down
25 changes: 16 additions & 9 deletions interface/raster_zonal_stats_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ def raster_zonal_stats_action():
def raster_zonal_stats():
raster_layer = cfg.dialog.ui.classification_name_combo_5.currentText()
raster = cfg.util_qgis.get_file_path(raster_layer)
vector_layer = cfg.dialog.ui.reference_name_combo_3.currentText()
vector = cfg.util_qgis.get_file_path(vector_layer)
reference_layer = cfg.dialog.ui.reference_name_combo_3.currentText()
reference = cfg.util_qgis.get_file_path(reference_layer)
field = cfg.dialog.ui.class_field_comboBox_4.currentText()
if raster is not None and len(field) > 0:
if len(field) == 0:
field = None
if raster is not None and reference is not None:
stat_percentile = None
# get statistics
stat_names = []
Expand Down Expand Up @@ -85,7 +87,7 @@ def raster_zonal_stats():
cfg.logger.log.info('raster zonal stats: %s' % output_path)
cfg.ui_utils.add_progress_bar()
output = cfg.rs.raster_zonal_stats(
raster_path=raster, vector_path=vector,
raster_path=raster, reference_path=reference,
vector_field=field, stat_names=stat_names,
stat_percentile=stat_percentile, output_path=output_path
)
Expand Down Expand Up @@ -114,6 +116,9 @@ def refresh_reference_layer():
or layer.wkbType() ==
cfg.util_qgis.get_qgis_wkb_types().MultiPolygon):
cfg.dialog.vector_zonal_raster_combo(layer.name())
elif layer.type() == cfg.util_qgis.get_qgis_map_raster():
if layer.bandCount() == 1:
cfg.dialog.vector_zonal_raster_combo(layer.name())


# reference layer name
Expand All @@ -133,11 +138,13 @@ def reference_layer_name():
# set script button
def set_script():
output_path = 'output_path'
reference_layer = cfg.dialog.ui.classification_name_combo_5.currentText()
raster_layer = cfg.dialog.ui.classification_name_combo_5.currentText()
raster = cfg.util_qgis.get_file_path(raster_layer)
reference_layer = cfg.dialog.ui.reference_name_combo_3.currentText()
reference = cfg.util_qgis.get_file_path(reference_layer)
vector_layer = cfg.dialog.ui.reference_name_combo_3.currentText()
vector = cfg.util_qgis.get_file_path(vector_layer)
field = cfg.dialog.ui.class_field_comboBox_4.currentText()
if len(field) == 0:
field = None
stat_percentile = None
# get statistics
stat_names = []
Expand Down Expand Up @@ -170,10 +177,10 @@ def set_script():
% (cfg.qgis_registry[cfg.reg_threads_value],
cfg.qgis_registry[cfg.reg_ram_value]))
command = ('# raster zonal stats \n'
'rs.raster_zonal_stats(raster_path="%s", vector_path="%s", '
'rs.raster_zonal_stats(raster_path="%s", reference_path="%s", '
'vector_field="%s", output_path="%s", stat_names=%s, '
'stat_percentile=%s)'
% (str(reference), str(vector), str(field), str(output_path),
% (str(raster), str(reference), str(field), str(output_path),
str(stat_names), str(stat_percentile))
)
previous = cfg.dialog.ui.plainTextEdit_batch.toPlainText()
Expand Down
6 changes: 5 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name=Semi-Automatic Classification Plugin
qgisMinimumVersion=3.00
description=The Semi-Automatic Classification Plugin (SCP) allows for the supervised classification of remote sensing images, providing tools for the download, the preprocessing and postprocessing of images.
version=8.4.0
version=8.5.0
about=Developed by Luca Congedo, the Semi-Automatic Classification Plugin (SCP) allows for the supervised classification of remote sensing images, providing tools for the download, the preprocessing and postprocessing of images. Search and download is available for Landsat, Sentinel-2 images. Several algorithms are available for the land cover classification. This plugin requires the installation of Remotior Sensus, GDAL, OGR, Numpy, SciPy, and Matplotlib. For more information please visit https://fromgistors.blogspot.com .

author=Luca Congedo
Expand All @@ -13,6 +13,10 @@ icon=semiautomaticclassificationplugin.png

changelog=

8.5.0
-added raster input to the tool raster zonal stats and update the Processing
-this version requires Remotior Sensus >= 0.4.4

8.4.0
-fixed issue in clip band tool using vector
-added requirements.txt to be used by the plugin QPIP that allows for managing Python dependencies in QGIS
Expand Down
9 changes: 5 additions & 4 deletions qgis_processing/cross_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,15 @@ def processAlgorithm(self, parameters, context, feedback):
reference = self.parameterAsFile(
parameters, self.INPUT_RASTER_2, context
)
if len(reference) == 0:
reference = None
if reference is None:
reference = self.parameterAsFile(
parameters, self.INPUT_VECTOR, context
)
else:
if rs.files_directories.is_file(reference) is False:
layer_x = root.findLayer(reference)
reference = layer_x.layer().source().split("|layername=")[0]
if rs.files_directories.is_file(reference) is False:
layer_x = root.findLayer(reference)
reference = layer_x.layer().source().split("|layername=")[0]
field = self.parameterAsString(parameters, self.TEXT, context)
if len(field) == 0:
field = None
Expand Down
Loading

0 comments on commit 1137cb9

Please sign in to comment.