diff --git a/src/O4_DSF_Utils.py b/src/O4_DSF_Utils.py index b0fdf003..c81f4ef6 100755 --- a/src/O4_DSF_Utils.py +++ b/src/O4_DSF_Utils.py @@ -1,21 +1,22 @@ +import array +import hashlib +import io +import numpy import os import pickle import shutil -import io -from math import floor, ceil -import array -import numpy -from PIL import Image, ImageDraw -from collections import defaultdict import struct -import hashlib +from collections import defaultdict +from math import ceil, floor +from PIL import Image, ImageDraw +import subprocess +import O4_Bathymetry as BATHY import O4_File_Names as FNAMES import O4_Geo_Utils as GEO import O4_Mask_Utils as MASK -import O4_UI_Utils as UI -import O4_Overlay_Utils as OVL import O4_Mesh_Utils as MESH -import O4_Bathymetry as BATHY +import O4_Overlay_Utils as OVL +import O4_UI_Utils as UI quad_init_level = 3 quad_capacity_high = 50000 @@ -397,9 +398,7 @@ def extract_elevation_and_bathymetry_data(lat, lon): if dsfid == "7z": UI.vprint(2, " The original DSF is a 7z archive, uncompressing...") os.replace(tmp_file, tmp_file + ".7z") - os.system( - OVL.unzip_cmd + " e -o" + FNAMES.Tmp_dir + ' "' + tmp_file + '.7z"' - ) + subprocess.run([OVL.unzip_cmd, "e", f"-o{FNAMES.Tmp_dir}", f"{tmp_file}.7z"]) os.remove(tmp_file + '.7z') file_len = os.path.getsize(tmp_file) f = open(tmp_file, "rb") diff --git a/src/O4_OSM_Utils.py b/src/O4_OSM_Utils.py index 8baee054..7aab5770 100755 --- a/src/O4_OSM_Utils.py +++ b/src/O4_OSM_Utils.py @@ -10,12 +10,12 @@ import O4_File_Names as FNAMES overpass_servers = { - "DE": "http://overpass-api.de/api/interpreter", - "FR": "http://api.openstreetmap.fr/oapi/interpreter", + "DE": "https://overpass-api.de/api/interpreter", "KU": "https://overpass.kumi.systems/api/interpreter", - "RU": "http://overpass.osm.rambler.ru/cgi/interpreter", + "RU": "https://overpass.openstreetmap.ru/api/interpreter", } -overpass_server_choice = "DE" +# KU server does not rate limit as of 2024-07-08 +overpass_server_choice = "KU" max_osm_tentatives = 8 ################################################################################ diff --git a/src/O4_Overlay_Utils.py b/src/O4_Overlay_Utils.py index 345041fe..7eddcb6e 100644 --- a/src/O4_Overlay_Utils.py +++ b/src/O4_Overlay_Utils.py @@ -16,13 +16,13 @@ custom_overlay_src_alternate = "" if "dar" in sys.platform: - unzip_cmd = "7z " + unzip_cmd = "7z" dsftool_cmd = os.path.join(FNAMES.Utils_dir, "mac", "DSFTool ") elif "win" in sys.platform: - unzip_cmd = os.path.join(FNAMES.Utils_dir, "win", "7z.exe ") + unzip_cmd = os.path.join(FNAMES.Utils_dir, "win", "7z.exe") dsftool_cmd = os.path.join(FNAMES.Utils_dir, "win", "DSFTool.exe ") else: - unzip_cmd = "7z " + unzip_cmd = "7z" dsftool_cmd = os.path.join(FNAMES.Utils_dir, "lin", "DSFTool ") ################################################################################ @@ -75,14 +75,7 @@ def build_overlay(lat, lon): if dsfid == "7z": UI.vprint(1, "-> The original DSF is a 7z archive, uncompressing...") os.replace(file_to_sniff_loc, file_to_sniff_loc + ".7z") - os.system( - unzip_cmd - + " e -o" - + FNAMES.Tmp_dir - + ' "' - + file_to_sniff_loc - + '.7z"' - ) + subprocess.run([unzip_cmd, "e", f"-o{FNAMES.Tmp_dir}", f"{file_to_sniff_loc}.7z"]) os.remove(file_to_sniff_loc + ".7z") UI.vprint(1, "-> Converting the copy to text format") dsfconvertcmd = [ diff --git a/src/O4_Version.py b/src/O4_Version.py index d27e057f..dbed5974 100755 --- a/src/O4_Version.py +++ b/src/O4_Version.py @@ -1 +1 @@ -version='1.40.06' +version='1.40.07'