Skip to content

Commit

Permalink
8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
semiautomaticgit committed Dec 10, 2023
1 parent a00ab34 commit cee9e9f
Show file tree
Hide file tree
Showing 22 changed files with 23,846 additions and 23,641 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.7 - Infinity'
return 'Version 8.2.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.1.7" plugin_id="284">
<pyqgis_plugin name="Semi-Automatic Classification Plugin - master" version="8.2.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.1.7</version>
<version>8.2.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
1,081 changes: 543 additions & 538 deletions i18n/models/semiautomaticclassificationplugin.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_ar.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_de.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_el_GR.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_es.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_fr.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_it.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_ja.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_pl.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_pt.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_pt_BR.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_uk_UA.ts

Large diffs are not rendered by default.

1,081 changes: 543 additions & 538 deletions i18n/semiautomaticclassificationplugin_zh_CN.ts

Large diffs are not rendered by default.

120 changes: 119 additions & 1 deletion interface/download_products_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,13 @@ def display_images():
elif (sat == cfg.rs.configurations.landsat_hls
or sat == cfg.rs.configurations.sentinel2_hls):
display_nasa_images(image_id)
elif (sat == cfg.rs.configurations.landsat_mpc
or sat == cfg.rs.configurations.sentinel2_mpc
or sat == cfg.rs.configurations.modis_09q1_mpc
or sat == cfg.rs.configurations.modis_11a2_mpc
or sat == cfg.rs.configurations.aster_l1t_mpc
or sat == cfg.rs.configurations.cop_dem_glo_30_mpc):
display_mpc_images(image_id)
progress = progress + progress_step
cfg.ui_utils.update_bar(progress, cfg.translate('Downloading ...'))
cfg.ui_utils.remove_progress_bar(sound=False)
Expand All @@ -584,6 +591,13 @@ def table_click():
elif (sat == cfg.rs.configurations.landsat_hls
or sat == cfg.rs.configurations.sentinel2_hls):
display_nasa_images(row, True)
elif (sat == cfg.rs.configurations.landsat_mpc
or sat == cfg.rs.configurations.sentinel2_mpc
or sat == cfg.rs.configurations.modis_09q1_mpc
or sat == cfg.rs.configurations.modis_11a2_mpc
or sat == cfg.rs.configurations.aster_l1t_mpc
or sat == cfg.rs.configurations.cop_dem_glo_30_mpc):
display_mpc_images(row, True)
cfg.ui_utils.remove_progress_bar(sound=False)


Expand Down Expand Up @@ -895,6 +909,48 @@ def display_nasa_images(row, preview=False):
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)


# display images
def display_mpc_images(row, preview=False):
table = cfg.dialog.ui.download_images_tableWidget
sat = str(table.item(row, 0).text())
image_id = str(table.item(row, 1).text())
min_lat = str(table.item(row, 7).text())
min_lon = str(table.item(row, 8).text())
max_lat = str(table.item(row, 9).text())
max_lon = str(table.item(row, 10).text())
url = str(table.item(row, 13).text())
# image preview
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.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.rs.configurations.temp.dir, image_id)
)
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)
else:
download_mpc_thumbnail(
image_id, min_lat, min_lon, max_lat, max_lon, url, sat, preview
)
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.rs.configurations.temp.dir, image_id)
)
cfg.util_qgis.set_raster_color_composite(r, 1, 2, 3)


# display image in label
def preview_in_label(image_path):
temp_image = sub(r'\.jp2$', '.png', str(image_path))
Expand Down Expand Up @@ -1036,8 +1092,70 @@ def download_nasa_thumbnail(
check = False
if (sat == cfg.rs.configurations.landsat_hls
or sat == cfg.rs.configurations.sentinel2_hls):
proxy_host = None
proxy_port = None
proxy_user = None
proxy_password = None
cfg.util_qgis.get_qgis_proxy_settings()
if str(cfg.proxy_enabled) == 'true' and len(cfg.proxy_host) > 0:
if len(cfg.proxy_user) > 0:
proxy_user = cfg.proxy_user
proxy_password = cfg.proxy_password
proxy_host = cfg.proxy_host
proxy_port = cfg.proxy_port
else:
proxy_host = cfg.proxy_host
proxy_port = cfg.proxy_port
check, output = cfg.rs.download_tools.download_file(
url, image_output, timeout=2,
proxy_host=proxy_host, proxy_port=proxy_port,
proxy_user=proxy_user, proxy_password=proxy_password
)
if check is True:
if preview is True:
preview_in_label(image_output)
return image_output
onthefly_georef_image(
image_output,
'%s/%s.vrt' % (cfg.rs.configurations.temp.dir, image_id), min_lon,
max_lon, min_lat, max_lat
)


# download thumbnail
def download_mpc_thumbnail(
image_id, min_lat, min_lon, max_lat, max_lon, url, sat, preview=False
):
image_output = '%s/%s_thumb.jpg' % (
cfg.rs.configurations.temp.dir, image_id
)
check = False
if (
sat == cfg.rs.configurations.landsat_mpc
or sat == cfg.rs.configurations.sentinel2_mpc
or sat == cfg.rs.configurations.modis_09q1_mpc
or sat == cfg.rs.configurations.modis_11a2_mpc
or sat == cfg.rs.configurations.aster_l1t_mpc
or sat == cfg.rs.configurations.cop_dem_glo_30_mpc
):
proxy_host = None
proxy_port = None
proxy_user = None
proxy_password = None
cfg.util_qgis.get_qgis_proxy_settings()
if str(cfg.proxy_enabled) == 'true' and len(cfg.proxy_host) > 0:
if len(cfg.proxy_user) > 0:
proxy_user = cfg.proxy_user
proxy_password = cfg.proxy_password
proxy_host = cfg.proxy_host
proxy_port = cfg.proxy_port
else:
proxy_host = cfg.proxy_host
proxy_port = cfg.proxy_port
check, output = cfg.rs.download_tools.download_file(
url, image_output, timeout=2
url, image_output, timeout=2,
proxy_host=proxy_host, proxy_port=proxy_port,
proxy_user=proxy_user, proxy_password=proxy_password
)
if check is True:
if preview is True:
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.7
version=8.2.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,9 @@ icon=semiautomaticclassificationplugin.png

changelog=

8.2.0
-in Download products added the options to search and download Collections from Microsoft Planetary Computer: Sentinel-2, Landsat, ASTER, MODIS Surface Reflectance 8-Day, and Copernicus DEM(required Remotior Sensus >= 0.2.01)

8.1.7
-in Download products added option for login Copernicus Data Space Ecosystem (required Remotior Sensus >= 0.1.24)
-in SCP dock added zoom to ROI after double clik on ROI name
Expand Down
12 changes: 9 additions & 3 deletions semiautomaticclassificationplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,15 @@ def initGui(self):
QDate.currentDate().addDays(-365)
)
# add satellite list to combo
for product in cfg.rs.configurations.product_list:
cfg.dialog.ui.landsat_satellite_combo.addItem(product)
try:
for product \
in cfg.rs.configurations.product_description.keys():
cfg.dialog.ui.landsat_satellite_combo.addItem(product)
except Exception as err:
str(err)
# backward compatibility remotior sensus < 0.2
for product in cfg.rs.configurations.product_list:
cfg.dialog.ui.landsat_satellite_combo.addItem(product)
# add color list to combo
cfg.scatter_plot.add_colormap_to_combo(cfg.scatter_color_map)
cfg.usgs_spectral_lib.add_spectral_library_to_combo()
Expand Down Expand Up @@ -765,7 +772,6 @@ def unload():
try:
for r in cfg.qgis_registry:
cfg.util_qt.write_registry_keys(r, cfg.qgis_registry[r])
print(r, cfg.qgis_registry[r])
except Exception as err:
try:
cfg.logger.log.error(str(err))
Expand Down
Loading

0 comments on commit cee9e9f

Please sign in to comment.