Skip to content

Commit

Permalink
8.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
semiautomaticgit committed Nov 1, 2023
1 parent 5e58eaa commit 31f1a59
Show file tree
Hide file tree
Showing 8 changed files with 16,489 additions and 16,471 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.1.0 - Infinity'
return 'Version 8.1.1 - 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.1.0" plugin_id="284">
<pyqgis_plugin name="Semi-Automatic Classification Plugin - master" version="8.1.1" 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.1.0</version>
<version>8.1.1</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
9 changes: 4 additions & 5 deletions interface/bandset_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,11 +779,12 @@ def perform_bandset_tools():


# perform bandset tools
def bandset_tools(output_directory, batch=True):
def bandset_tools(output_directory, bandset_number=None, batch=True):
if batch is False:
cfg.ui_utils.add_progress_bar()
cfg.logger.log.info('bandset_tools: %s' % output_directory)
bandset_number = cfg.project_registry[cfg.reg_active_bandset_number]
if bandset_number is None:
bandset_number = cfg.project_registry[cfg.reg_active_bandset_number]
name = cfg.bandset_catalog.get_name(bandset_number)
if cfg.rs.configurations.action:
if cfg.dialog.ui.band_calc_checkBox.isChecked() is True:
Expand Down Expand Up @@ -879,9 +880,7 @@ def band_set_to_table(bandset_number):
cfg.dialog.ui.bandset_tableWidget.blockSignals(True)
names = str(bandset_x.get_band_attributes('name')).replace(
"'", ''
).replace(
'[', ''
).replace(']', '')
).replace('[', '').replace(']', '')
if names == 'None':
names = ''
cfg.util_qt.add_table_item(
Expand Down
8 changes: 6 additions & 2 deletions interface/clip_bands_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ def clip_bands():
# temporary layer
date_time = cfg.utils.get_time()
t_vector_name = cfg.temp_roi_name + date_time + '.shp'
t_vector = cfg.temp_dir + '/' + date_time + t_vector_name
t_vector = (
cfg.rs.configurations.temp.dir + '/' + date_time
+ t_vector_name
)
# get layer crs
crs = cfg.util_gdal.get_crs_gdal(reference)
# create a temp shapefile with a field
Expand Down Expand Up @@ -380,7 +383,8 @@ def set_script():
# temporary layer
date_time = cfg.utils.get_time()
t_vector_name = cfg.temp_roi_name + date_time + '.shp'
t_vector = cfg.temp_dir + '/' + date_time + t_vector_name
t_vector = (cfg.rs.configurations.temp.dir+ '/' + date_time
+ t_vector_name)
# get layer crs
crs = cfg.util_gdal.get_crs_gdal(reference)
# create a temp shapefile with a field
Expand Down
27 changes: 17 additions & 10 deletions interface/download_products_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def display_sentinel2(row, preview=False):
image_id = '%s_p.jp2' % image_name
url = str(table.item(row, 13).text())
# image preview
image_output = '%s//%s' % (cfg.temp_dir, image_id)
image_output = '%s/%s' % (cfg.rs.configurations.temp.dir, image_id)
if preview is True and cfg.utils.check_file(image_output):
preview_in_label(image_output)
return image_output
Expand Down Expand Up @@ -739,29 +739,33 @@ def display_nasa_images(row, preview=False):
max_lon = str(table.item(row, 10).text())
url = str(table.item(row, 13).text())
# image preview
image_output = '%s//%s_thumb.jpg' % (cfg.temp_dir, image_id)
image_output = '%s/%s_thumb.jpg' % (
cfg.rs.configurations.temp.dir, image_id
)
if preview is True and cfg.utils.check_file(image_output):
preview_in_label(image_output)
return image_output
elif cfg.utils.check_file('%s//%s.vrt' % (cfg.temp_dir, image_id)):
elif cfg.utils.check_file(
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
):
layer = cfg.util_qgis.select_layer_by_name(image_id)
if layer is not None:
cfg.util_qgis.set_layer_visible(layer, True)
cfg.util_qgis.move_layer_to_top(layer)
else:
r = cfg.util_qgis.add_raster_layer(
'%s//%s.vrt'
% (cfg.temp_dir, image_id)
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
)
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)
else:
download_nasa_thumbnail(
image_id, min_lat, min_lon, max_lat, max_lon, url, sat, preview
)
if cfg.utils.check_file('%s//%s.vrt' % (cfg.temp_dir, image_id)):
if cfg.utils.check_file(
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
):
r = cfg.util_qgis.add_raster_layer(
'%s//%s.vrt'
% (cfg.temp_dir, image_id)
'%s//%s.vrt' % (cfg.rs.configurations.temp.dir, image_id)
)
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)

Expand Down Expand Up @@ -901,7 +905,9 @@ def onthefly_georef_image(
def download_nasa_thumbnail(
image_id, min_lat, min_lon, max_lat, max_lon, url, sat, preview=False
):
image_output = '%s//%s_thumb.jpg' % (cfg.temp_dir, image_id)
image_output = '%s/%s_thumb.jpg' % (
cfg.rs.configurations.temp.dir, image_id
)
check = False
if (sat == cfg.rs.configurations.landsat_hls
or sat == cfg.rs.configurations.sentinel2_hls):
Expand All @@ -913,6 +919,7 @@ def download_nasa_thumbnail(
preview_in_label(image_output)
return image_output
onthefly_georef_image(
image_output, '%s//%s.vrt' % (cfg.temp_dir, image_id), min_lon,
image_output,
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id), min_lon,
max_lon, min_lat, max_lat
)
5 changes: 5 additions & 0 deletions interface/image_conversion_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,15 @@ def perform_conversion(output_path=None, load_in_qgis=False):
else:
cfg.mx.msg_err_1()
if add_bandset is True:
bandset_number = None
for bandset_number in range(
1, cfg.bandset_catalog.get_bandset_count() + 1
):
cfg.bst.band_set_to_table(bandset_number)
cfg.bst.bandset_tools(
output_directory=output_path,
bandset_number=bandset_number
)
cfg.mx.msg_inf_6()
cfg.ui_utils.remove_progress_bar(smtp=str(__name__))

Expand Down
5 changes: 4 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.1.0
version=8.1.1
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,9 @@ icon=semiautomaticclassificationplugin.png

changelog=

8.1.1
-fixed band set tools integration with image conversion

8.1.0
-added function to automatically download Remotior Sensus if not found in the environment

Expand Down
Loading

0 comments on commit 31f1a59

Please sign in to comment.