feat: 采样点图层字段改为中文名

This commit is contained in:
nixevol
2026-10-15 16:38:03 +08:00
parent 6c0d565ea5
commit 0b94ab850c
4 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -15,7 +15,7 @@ from .raster_math import to_float
TABLE = "采样点图层"
GEOM = "geom"
SRS_ID = 4326
FIELDS = ("mro_total_dl", "mro_total_gd", "mro_total_yd", "总采样点数")
FIELDS = ("电联采样点", "广电采样点", "移动采样点", "总采样点数")
STYLES = Path(__file__).with_name("styles")
WGS84 = (
'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,'
@@ -214,10 +214,11 @@ def _write(output_path, records, fallback_extent):
"VALUES ('','',?,?,?,?,?,1,'','',NULL,?)",
(TABLE, GEOM, "Default", qml, "", now),
)
columns = ", ".join(f'"{name}"' for name in FIELDS)
placeholders = ", ".join(["?"] * (2 + len(FIELDS)))
for index, record in enumerate(records, start=1):
conn.execute(
f'INSERT INTO "{TABLE}" (fid, "{GEOM}", "mro_total_dl", "mro_total_gd", "mro_total_yd", "总采样点数") '
"VALUES (?,?,?,?,?,?)",
f'INSERT INTO "{TABLE}" (fid, "{GEOM}", {columns}) VALUES ({placeholders})',
(index, record["blob"], record["dl"], record["gd"], record["yd"], record["total"]),
)
minx, miny, maxx, maxy = record["bounds"]