fix: 回写清洗后的楼宇结果 CSV

This commit is contained in:
nixevol
2026-09-21 10:00:44 +08:00
parent 8db2d96116
commit a1daa619de
2 changed files with 14 additions and 1 deletions
+4
View File
@@ -25,6 +25,10 @@ class NrDataTest(unittest.TestCase):
writer.writerow(["2", "A", "失败", "超时", ""])
result = build_gpkg(data, polygon, output)
self.assertEqual(result["feature_count"], 1)
with data.open(encoding="gbk", newline="") as stream:
cleaned = csv.DictReader(stream)
self.assertEqual(cleaned.fieldnames, ["building_id", "building_name", "WKT"])
self.assertEqual(len(list(cleaned)), 1)
conn = sqlite3.connect(output)
try:
columns = [row[1] for row in conn.execute('pragma table_info("NRBuildingsData")')]