mirror of
https://github.com/netzbegruenung/social-spider.git
synced 2024-05-04 19:53:40 +02:00
fix issues in BW, reduce data in maps
This commit is contained in:
parent
08b6c6a7b4
commit
749d42f11e
|
@ -30,6 +30,8 @@ MAPPING = {"Neustadt a.d. Aisch-Bad Windsheim": "Neustadt-Aisch",
|
|||
"Kaufbeuren": "Ostallgäu",
|
||||
"Ostallgäu": "Ostallgäu"}
|
||||
|
||||
REMOVE_BW = ["08215", "08226", "08136", "08436"]
|
||||
|
||||
def createLVBasemap():
|
||||
green_data = []
|
||||
for entry in dir_entries():
|
||||
|
@ -45,7 +47,10 @@ def createLVBasemap():
|
|||
name = feature["properties"]["GEN"]
|
||||
for d in green_data:
|
||||
if d["state"] == name:
|
||||
feature["properties"]["green-data"] = d
|
||||
feature["properties"] = {}
|
||||
feature["properties"]["type"] = d["type"]
|
||||
feature["properties"]["level"] = d["level"]
|
||||
feature["properties"]["state"] = d["state"]
|
||||
result_map["features"].append(feature)
|
||||
with open("maps/lv_basemap.geojson", "w", encoding='utf-8') as output_f:
|
||||
json.dump(result_map, output_f, indent=4)
|
||||
|
@ -56,6 +61,23 @@ def initialize():
|
|||
with open("maps/landkreise_simplify200.geojson") as map_f:
|
||||
map_data = json.load(map_f)["features"]
|
||||
|
||||
# add additional bw data:
|
||||
map_data_copy = []
|
||||
for feature in map_data:
|
||||
if feature["properties"]["SN_L"] == "08" and feature["properties"]["RS"] in REMOVE_BW:
|
||||
pass # don't add it
|
||||
else:
|
||||
map_data_copy.append(feature)
|
||||
map_data = map_data_copy
|
||||
with open("maps/additional_bw.geojson") as map_f:
|
||||
map_data2 = json.load(map_f)["features"]
|
||||
for feature in map_data2:
|
||||
feature["properties"]["GEN"] = feature["properties"]["kvname"]
|
||||
feature["properties"]["NBD"] = ""
|
||||
feature["properties"]["BEZ"] = ""
|
||||
feature["properties"]["SN_L"] = "08"
|
||||
map_data += map_data2
|
||||
|
||||
for entry in dir_entries():
|
||||
if entry["type"] == "REGIONAL_CHAPTER":
|
||||
if entry["level"] == "DE:KREISVERBAND":
|
||||
|
@ -254,7 +276,11 @@ def createKVBasemap():
|
|||
else:
|
||||
# skip not-matched map parts
|
||||
continue
|
||||
feature["properties"]["green-data"] = entry
|
||||
feature["properties"] = {}
|
||||
feature["properties"]["type"] = entry["type"]
|
||||
feature["properties"]["level"] = entry["level"]
|
||||
feature["properties"]["state"] = entry["state"]
|
||||
feature["properties"]["district"] = entry["district"]
|
||||
result_features.append(feature)
|
||||
result_map = {"type": "FeatureCollection",
|
||||
"features": result_features}
|
||||
|
|
2046
maps/additional_bw.geojson
Normal file
2046
maps/additional_bw.geojson
Normal file
File diff suppressed because it is too large
Load diff
27075
maps/kv_basemap.geojson
27075
maps/kv_basemap.geojson
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue