Skip to content

Commit 31f1a59

Browse files
8.1.1
1 parent 5e58eaa commit 31f1a59

8 files changed

Lines changed: 16489 additions & 16471 deletions

File tree

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def description():
3434

3535

3636
def version():
37-
return 'Version 8.1.0 - Infinity'
37+
return 'Version 8.1.1 - Infinity'
3838

3939

4040
def icon():

docs/repository.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version = '1.0' encoding = 'UTF-8'?>
22
<plugins>
3-
<pyqgis_plugin name="Semi-Automatic Classification Plugin - master" version="8.1.0" plugin_id="284">
3+
<pyqgis_plugin name="Semi-Automatic Classification Plugin - master" version="8.1.1" plugin_id="284">
44
<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>
55
<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>
6-
<version>8.1.0</version>
6+
<version>8.1.1</version>
77
<qgis_minimum_version>3.0.0</qgis_minimum_version>
88
<qgis_maximum_version>3.99.0</qgis_maximum_version>
99
<homepage><![CDATA[https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html]]></homepage>

interface/bandset_tab.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,12 @@ def perform_bandset_tools():
779779

780780

781781
# perform bandset tools
782-
def bandset_tools(output_directory, batch=True):
782+
def bandset_tools(output_directory, bandset_number=None, batch=True):
783783
if batch is False:
784784
cfg.ui_utils.add_progress_bar()
785785
cfg.logger.log.info('bandset_tools: %s' % output_directory)
786-
bandset_number = cfg.project_registry[cfg.reg_active_bandset_number]
786+
if bandset_number is None:
787+
bandset_number = cfg.project_registry[cfg.reg_active_bandset_number]
787788
name = cfg.bandset_catalog.get_name(bandset_number)
788789
if cfg.rs.configurations.action:
789790
if cfg.dialog.ui.band_calc_checkBox.isChecked() is True:
@@ -879,9 +880,7 @@ def band_set_to_table(bandset_number):
879880
cfg.dialog.ui.bandset_tableWidget.blockSignals(True)
880881
names = str(bandset_x.get_band_attributes('name')).replace(
881882
"'", ''
882-
).replace(
883-
'[', ''
884-
).replace(']', '')
883+
).replace('[', '').replace(']', '')
885884
if names == 'None':
886885
names = ''
887886
cfg.util_qt.add_table_item(

interface/clip_bands_tab.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ def clip_bands():
238238
# temporary layer
239239
date_time = cfg.utils.get_time()
240240
t_vector_name = cfg.temp_roi_name + date_time + '.shp'
241-
t_vector = cfg.temp_dir + '/' + date_time + t_vector_name
241+
t_vector = (
242+
cfg.rs.configurations.temp.dir + '/' + date_time
243+
+ t_vector_name
244+
)
242245
# get layer crs
243246
crs = cfg.util_gdal.get_crs_gdal(reference)
244247
# create a temp shapefile with a field
@@ -380,7 +383,8 @@ def set_script():
380383
# temporary layer
381384
date_time = cfg.utils.get_time()
382385
t_vector_name = cfg.temp_roi_name + date_time + '.shp'
383-
t_vector = cfg.temp_dir + '/' + date_time + t_vector_name
386+
t_vector = (cfg.rs.configurations.temp.dir+ '/' + date_time
387+
+ t_vector_name)
384388
# get layer crs
385389
crs = cfg.util_gdal.get_crs_gdal(reference)
386390
# create a temp shapefile with a field

interface/download_products_tab.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def display_sentinel2(row, preview=False):
692692
image_id = '%s_p.jp2' % image_name
693693
url = str(table.item(row, 13).text())
694694
# image preview
695-
image_output = '%s//%s' % (cfg.temp_dir, image_id)
695+
image_output = '%s/%s' % (cfg.rs.configurations.temp.dir, image_id)
696696
if preview is True and cfg.utils.check_file(image_output):
697697
preview_in_label(image_output)
698698
return image_output
@@ -739,29 +739,33 @@ def display_nasa_images(row, preview=False):
739739
max_lon = str(table.item(row, 10).text())
740740
url = str(table.item(row, 13).text())
741741
# image preview
742-
image_output = '%s//%s_thumb.jpg' % (cfg.temp_dir, image_id)
742+
image_output = '%s/%s_thumb.jpg' % (
743+
cfg.rs.configurations.temp.dir, image_id
744+
)
743745
if preview is True and cfg.utils.check_file(image_output):
744746
preview_in_label(image_output)
745747
return image_output
746-
elif cfg.utils.check_file('%s//%s.vrt' % (cfg.temp_dir, image_id)):
748+
elif cfg.utils.check_file(
749+
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
750+
):
747751
layer = cfg.util_qgis.select_layer_by_name(image_id)
748752
if layer is not None:
749753
cfg.util_qgis.set_layer_visible(layer, True)
750754
cfg.util_qgis.move_layer_to_top(layer)
751755
else:
752756
r = cfg.util_qgis.add_raster_layer(
753-
'%s//%s.vrt'
754-
% (cfg.temp_dir, image_id)
757+
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
755758
)
756759
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)
757760
else:
758761
download_nasa_thumbnail(
759762
image_id, min_lat, min_lon, max_lat, max_lon, url, sat, preview
760763
)
761-
if cfg.utils.check_file('%s//%s.vrt' % (cfg.temp_dir, image_id)):
764+
if cfg.utils.check_file(
765+
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
766+
):
762767
r = cfg.util_qgis.add_raster_layer(
763-
'%s//%s.vrt'
764-
% (cfg.temp_dir, image_id)
768+
'%s//%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
765769
)
766770
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)
767771

@@ -901,7 +905,9 @@ def onthefly_georef_image(
901905
def download_nasa_thumbnail(
902906
image_id, min_lat, min_lon, max_lat, max_lon, url, sat, preview=False
903907
):
904-
image_output = '%s//%s_thumb.jpg' % (cfg.temp_dir, image_id)
908+
image_output = '%s/%s_thumb.jpg' % (
909+
cfg.rs.configurations.temp.dir, image_id
910+
)
905911
check = False
906912
if (sat == cfg.rs.configurations.landsat_hls
907913
or sat == cfg.rs.configurations.sentinel2_hls):
@@ -913,6 +919,7 @@ def download_nasa_thumbnail(
913919
preview_in_label(image_output)
914920
return image_output
915921
onthefly_georef_image(
916-
image_output, '%s//%s.vrt' % (cfg.temp_dir, image_id), min_lon,
922+
image_output,
923+
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id), min_lon,
917924
max_lon, min_lat, max_lat
918925
)

interface/image_conversion_tab.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,15 @@ def perform_conversion(output_path=None, load_in_qgis=False):
136136
else:
137137
cfg.mx.msg_err_1()
138138
if add_bandset is True:
139+
bandset_number = None
139140
for bandset_number in range(
140141
1, cfg.bandset_catalog.get_bandset_count() + 1
141142
):
142143
cfg.bst.band_set_to_table(bandset_number)
144+
cfg.bst.bandset_tools(
145+
output_directory=output_path,
146+
bandset_number=bandset_number
147+
)
143148
cfg.mx.msg_inf_6()
144149
cfg.ui_utils.remove_progress_bar(smtp=str(__name__))
145150

metadata.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name=Semi-Automatic Classification Plugin
33
qgisMinimumVersion=3.00
44
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.
5-
version=8.1.0
5+
version=8.1.1
66
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 .
77

88
author=Luca Congedo
@@ -13,6 +13,9 @@ icon=semiautomaticclassificationplugin.png
1313

1414
changelog=
1515

16+
8.1.1
17+
-fixed band set tools integration with image conversion
18+
1619
8.1.0
1720
-added function to automatically download Remotior Sensus if not found in the environment
1821

0 commit comments

Comments
 (0)