mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 07:57:07 +00:00
Handle NTBP flags in raw data.
This works by matching a regular expression against the full path name (not just the file name). If it matches, the NTBP flag is set to true.
This commit is contained in:
@@ -40,6 +40,9 @@ if __name__ == '__main__':
|
||||
pattern = raw_p111["pattern"]
|
||||
rx = re.compile(pattern["regex"])
|
||||
|
||||
if "ntbp" in survey["raw"]:
|
||||
ntbpRx = re.compile(survey["raw"]["ntbp"])
|
||||
|
||||
for fileprefix in raw_p111["paths"]:
|
||||
print(f"Path prefix: {fileprefix}")
|
||||
|
||||
@@ -59,6 +62,10 @@ if __name__ == '__main__':
|
||||
continue
|
||||
|
||||
file_info = dict(zip(pattern["captures"], match.groups()))
|
||||
if ntbpRx:
|
||||
ntbp = ntbpRx.match(filepath) is not None
|
||||
else:
|
||||
ntbp = False
|
||||
|
||||
p111_data = p111.from_file(filepath)
|
||||
|
||||
@@ -66,7 +73,7 @@ if __name__ == '__main__':
|
||||
|
||||
p111_records = p111.p111_type("S", p111_data)
|
||||
|
||||
db.save_raw_p111(p111_records, file_info, filepath, survey["epsg"])
|
||||
db.save_raw_p111(p111_records, file_info, filepath, survey["epsg"], ntbp=ntbp)
|
||||
else:
|
||||
print("Already in DB")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user