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
+1 -1
View File
@@ -201,7 +201,7 @@ AOI 在包内 `GIS.qgz` 中使用相对路径引用,默认不勾选。`output/
### 采样点图层.gpkg
来源:`source/Grid_5G.gpkg` 与 `source/Grid_4G.gpkg`。按当前市场范围筛出栅格后,比较栅格图形中心;相距 8 米以内视为同一个栅格,保留 5G 的图形(没有 5G 时保留 4G)。两边都有的 `mro_total_dl`、`mro_total_gd`、`mro_total_yd` 分别相加,`总采样点数` 是这三个和。不计入 `mro_total_dx`、`mro_total_lt`。属性缺失按 0。工程中放在竞对信号上面,默认勾选,蓝色空心边,避免挡住下面的竞对信号。
来源:`source/Grid_5G.gpkg` 与 `source/Grid_4G.gpkg`。按当前市场范围筛出栅格后,比较栅格图形中心;相距 8 米以内视为同一个栅格,保留 5G 的图形(没有 5G 时保留 4G)。两边都有的 `mro_total_dl`、`mro_total_gd`、`mro_total_yd` 分别相加,写入 `电联采样点`、`广电采样点`、`移动采样点`,`总采样点数` 是这三个和。不计入 `mro_total_dx`、`mro_total_lt`。属性缺失按 0。工程中放在竞对信号上面,默认勾选,蓝色空心边,避免挡住下面的竞对信号。
### 竞对信号.tif
+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"]
+1 -1
View File
@@ -59,7 +59,7 @@ class SampleMergeTests(unittest.TestCase):
self.assertEqual(result["feature_count"], 1)
conn = sqlite3.connect(root / "采样点图层.gpkg")
try:
row = conn.execute('select "mro_total_dl","mro_total_gd","mro_total_yd","总采样点数" from "采样点图层"').fetchone()
row = conn.execute('select "电联采样点","广电采样点","移动采样点","总采样点数" from "采样点图层"').fetchone()
finally:
conn.close()
self.assertEqual(row, (14, 7, 108, 129))
+1 -1
View File
@@ -225,7 +225,7 @@ class TaskIntegrationTest(unittest.TestCase):
sample_path.write_bytes(archive.read("采样点图层.gpkg"))
sample_conn = sqlite3.connect(sample_path)
try:
totals = {row[-1] for row in sample_conn.execute('select "mro_total_dl","mro_total_gd","mro_total_yd","总采样点数" from "采样点图层"')}
totals = {row[-1] for row in sample_conn.execute('select "电联采样点","广电采样点","移动采样点","总采样点数" from "采样点图层"')}
finally:
sample_conn.close()
if name == "31-甲.zip":