From 493456e01207a7c25cdea45a1abe050959d9faf0 Mon Sep 17 00:00:00 2001 From: Carmen Tawalika Date: Thu, 2 Nov 2023 14:37:18 +0100 Subject: [PATCH] Enable import via vsicurl (#482) enable import via vsicurl --- src/actinia_core/core/common/process_chain.py | 34 ++++++++++++------- .../core/geodata_download_importer.py | 2 ++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/actinia_core/core/common/process_chain.py b/src/actinia_core/core/common/process_chain.py index 82de2ac71..e5a29f114 100644 --- a/src/actinia_core/core/common/process_chain.py +++ b/src/actinia_core/core/common/process_chain.py @@ -441,20 +441,28 @@ def _get_raster_vector_file_download_import_command(self, entry): """ rvf_downimport_commands = list() url = entry["import_descr"]["source"] - gdis = GeoDataDownloadImportSupport( - config=self.config, - temp_file_path=self.temp_file_path, - download_cache=self.temp_file_path, - message_logger=self.message_logger, - send_resource_update=self.send_resource_update, - url_list=[ - url, - ], - ) - download_commands, import_file_info = gdis.get_download_process_list() - rvf_downimport_commands.extend(download_commands) + + if not url.startswith("/vsicurl/"): + gdis = GeoDataDownloadImportSupport( + config=self.config, + temp_file_path=self.temp_file_path, + download_cache=self.temp_file_path, + message_logger=self.message_logger, + send_resource_update=self.send_resource_update, + url_list=[ + url, + ], + ) + ( + download_commands, + import_file_info, + ) = gdis.get_download_process_list() + rvf_downimport_commands.extend(download_commands) + input_source = import_file_info[0][2] + else: + input_source = url + map_name = entry["value"] - input_source = import_file_info[0][2] layer = None if "vector_layer" in entry["import_descr"]: diff --git a/src/actinia_core/core/geodata_download_importer.py b/src/actinia_core/core/geodata_download_importer.py index 36f59fd54..5ae042742 100644 --- a/src/actinia_core/core/geodata_download_importer.py +++ b/src/actinia_core/core/geodata_download_importer.py @@ -140,6 +140,8 @@ def _check_urls(self): nothing needs to be downloaded and checked. """ for url in self.url_list: + if url.startswith("/vsicurl/"): + continue # Send a resource update if self.send_resource_update is not None: self.send_resource_update(