mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-04-03 17:31:47 +01:00
srtm altitude parsing
This commit is contained in:
parent
688a1795e7
commit
76688695b8
@ -82,7 +82,7 @@ class Cave(TroggleModel):
|
|||||||
references = models.TextField(blank=True, null=True)
|
references = models.TextField(blank=True, null=True)
|
||||||
survex_file = models.CharField(max_length=100, blank=True, null=True) # should be a foreign key?
|
survex_file = models.CharField(max_length=100, blank=True, null=True) # should be a foreign key?
|
||||||
survey = models.TextField(blank=True, null=True)
|
survey = models.TextField(blank=True, null=True)
|
||||||
underground_centre_line = models.TextField(blank=True, null=True)
|
# underground_centre_line = models.TextField(blank=True, null=True)
|
||||||
underground_description = models.TextField(blank=True, null=True)
|
underground_description = models.TextField(blank=True, null=True)
|
||||||
unofficial_number = models.CharField(max_length=60, blank=True, null=True)
|
unofficial_number = models.CharField(max_length=60, blank=True, null=True)
|
||||||
url = models.CharField(max_length=300, blank=True, null=True, unique = True)
|
url = models.CharField(max_length=300, blank=True, null=True, unique = True)
|
||||||
|
@ -617,7 +617,7 @@ class LoadingSurvex:
|
|||||||
SO we have to recognise the '*fix' too
|
SO we have to recognise the '*fix' too
|
||||||
"""
|
"""
|
||||||
# *fix|36|reference|36359.40|82216.08|2000.00\n
|
# *fix|36|reference|36359.40|82216.08|2000.00\n
|
||||||
rx_fixline = re.compile(r"(?i)^\s*[*]fix\s+([\w\d_\.\-]+)\s+(?:reference)?\s*([\d\.]*)\s+([\d\.]*)\s+([\d\.]*).*$")
|
rx_fixline = re.compile(r"(?i)^\s*[*]fix\s+([\w\d_\.\-]+)\s+(?:reference)?\s*([\d\.]*)\s+([\d\.]*)\s+([\d\.]*)\s*;(.*)$")
|
||||||
|
|
||||||
line = line.replace("\n","")
|
line = line.replace("\n","")
|
||||||
#fixline = self.rx_fixline.match(line)
|
#fixline = self.rx_fixline.match(line)
|
||||||
@ -644,7 +644,7 @@ class LoadingSurvex:
|
|||||||
#_, _, alt, *rest = (fixdata + [None]*5)[:5]
|
#_, _, alt, *rest = (fixdata + [None]*5)[:5]
|
||||||
name, _, _, alt, comment = (list(fixdata) + [None]*5)[:5]
|
name, _, _, alt, comment = (list(fixdata) + [None]*5)[:5]
|
||||||
fixid = str(survexblock.id)+ ":"+ name
|
fixid = str(survexblock.id)+ ":"+ name
|
||||||
self.fixes[fixid] = (survexblock, name)
|
self.fixes[fixid] = (survexblock, name, alt, comment)
|
||||||
message = f"{name}, {fixdata=}, last:{fixline.groups()[-1]}"
|
message = f"{name}, {fixdata=}, last:{fixline.groups()[-1]}"
|
||||||
print(self.insp + message)
|
print(self.insp + message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -2417,24 +2417,23 @@ def FindAndLoadSurvex():
|
|||||||
|
|
||||||
for f in svx_load.fixes:
|
for f in svx_load.fixes:
|
||||||
# why are we seeing no *fixes from fixedpts/gps18.svx etc. ? They are parsed !
|
# why are we seeing no *fixes from fixedpts/gps18.svx etc. ? They are parsed !
|
||||||
survexblock, altitude, comment = svx_load.fixes[f]
|
survexblock, name, altitude, comment = svx_load.fixes[f]
|
||||||
s = survexblock
|
s = survexblock
|
||||||
spath = ""
|
spath = s.parent.survexfile
|
||||||
sprevious = None
|
# sprevious = None
|
||||||
while s.parent != sprevious:
|
# while s.parent != sprevious:
|
||||||
spath += str(s.parent) + ":" + spath
|
# spath += str(s.parent) + ":" + spath
|
||||||
sprevious = s
|
# sprevious = s
|
||||||
if not s.parent:
|
# if not s.parent:
|
||||||
break
|
# break
|
||||||
s = s.parent
|
# s = s.parent
|
||||||
|
ff = survexblock.survexfile
|
||||||
if comment:
|
if comment:
|
||||||
print(f"COMMENT {survexblock} {altitude} {comment}")
|
# print(f"FIX {survexblock} {altitude} {comment}")
|
||||||
if re.match("(?i)[^s]*srtm[\s\S]*", comment.lower()):
|
if re.match("(?i)[^s]*srtm[\s\S]*", comment.lower()):
|
||||||
print(f"{f} - {spath}::{survexblock} - {comment}")
|
print(f"SRTM {ff}.svx::{survexblock} - {spath}.svx - '{comment}'")
|
||||||
else:
|
if re.match("(?i)[^s]*radost[\s\S]*", comment.lower()):
|
||||||
if str(f).startswith("1623"):
|
print(f"RDST {ff}.svx::{survexblock} - {spath}.svx - '{comment}'")
|
||||||
print(f"{f} - {spath}::{survexblock} - {altitude=}")
|
|
||||||
|
|
||||||
svx_load = None
|
svx_load = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user