Parse Stadtteile

This commit is contained in:
2025-12-07 16:21:43 +01:00
parent 125772f8fe
commit 58c9e42a1e
2 changed files with 221285 additions and 0 deletions

31
geoparserstadtteile.py Normal file
View File

@@ -0,0 +1,31 @@
import json
import os
from collections import defaultdict
os.chdir("C:\\Users\\milli\\Documents\\Datenbereinigung")
output_file = {
"type": "FeatureCollection",
"features": [],
}
bezirk_table = defaultdict(dict)
with open("geostadtteile.json", "r", encoding='utf-8') as file:
data = json.load(file)
for entry in data["features"]:
if entry["properties"]["jahr_date"] == "2024-12-31":
output_file["features"].append({
"type": entry["type"],
"id": entry["id"],
"geometry": entry["geometry"],
"srsName": entry["srsName"],
"properties": {
"stadtteil": entry["properties"]["stadtteil"],
}
})
with open("geostadtteile-parsed.json", "w", encoding='utf-8') as output:
json.dump(output_file, output, ensure_ascii=False, indent=4)