Skip to content

Commit

Permalink
Merge pull request #37 from shred86/dev
Browse files Browse the repository at this point in the history
Version 1.40.07
  • Loading branch information
shred86 authored Jul 13, 2024
2 parents ece7e98 + 3395319 commit 1f88dad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
25 changes: 12 additions & 13 deletions src/O4_DSF_Utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions src/O4_OSM_Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

################################################################################
Expand Down
15 changes: 4 additions & 11 deletions src/O4_Overlay_Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ")

################################################################################
Expand Down Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/O4_Version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version='1.40.06'
version='1.40.07'

0 comments on commit 1f88dad

Please sign in to comment.