Add geoparser script

This commit is contained in:
2025-12-07 15:58:01 +01:00
parent 9b9a8e8101
commit 045b55b974

25
geoparser.py Normal file
View File

@@ -0,0 +1,25 @@
import json
import os
from collections import defaultdict
os.chdir("C:\\Users\\milli\\Documents\\Datenbereinigung")
bezirk_table = defaultdict(dict)
with open("geobezirke.json", "r", encoding='utf-8') as file:
data = json.load(file)
for entry in data["features"]:
bezirk = entry["properties"]["bezirk"]
if bezirk not in bezirk_table:
bezirk_table[bezirk] = []
bezirk_table[bezirk].append(entry["properties"]["jahr_date"])
print(len(bezirk_table))
for bez in bezirk_table.keys():
print("----------")
print(bez)
for date in sorted(bezirk_table[bez]):
print(date)
print("---------")