Skip to content

Commit

Permalink
Enable import via vsicurl (#482)
Browse files Browse the repository at this point in the history
enable import via vsicurl
  • Loading branch information
mmacata authored Nov 2, 2023
1 parent ec6e2b1 commit 493456e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/actinia_core/core/common/process_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
2 changes: 2 additions & 0 deletions src/actinia_core/core/geodata_download_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 493456e

Please sign in to comment.