QGIS完成初步重构

This commit is contained in:
wzy-warehouse
2026-06-20 15:50:24 +08:00
parent d20b5744bb
commit 18d8bcb1a3
45 changed files with 1688 additions and 454 deletions
+16
View File
@@ -0,0 +1,16 @@
import zipfile, re
z = zipfile.ZipFile(r"F:\project\xian\xian_algorithm_new\app\data\template\rainfall\暴雨避难场所分布图.qgz")
c = z.read([n for n in z.namelist() if n.endswith('.qgs')][0]).decode()
layers = re.findall(r'<maplayer[^>]*>(.*?)</maplayer>', c, re.DOTALL)
for i, l in enumerate(layers):
nm = re.search(r'<layername>([^<]+)</layername>', l)
pv = re.search(r'<provider[^>]*>(\w+)</provider>', l)
ds = re.search(r'<datasource>(.*?)</datasource>', l, re.DOTALL)
name = nm.group(1) if nm else '?'
prov = pv.group(1) if pv else '?'
ds_text = ds.group(1).strip()[:120] if ds else ''
print(f"{i:2d}. [{prov:10s}] {name}")
if ds_text:
print(f" ds: {ds_text}")