Files
comaps/data/conf/isolines/add_missing_countries.py
Konstantin Pastbin 20bae88649 [isolines] Add missing regions with poor profile
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-06-20 22:32:20 +07:00

32 lines
638 B
Python

import json
from os import listdir
data = object()
with open('countries-to-generate.json') as f1:
countries = set()
data = json.load(f1)
tree = data['countryParams']
for e in tree:
countries.add(e['key'])
for f2 in listdir('../../borders/'):
c = f2[:-5]
if c not in countries:
print(c)
entry = {
"key": c,
"value": {
"profileName": "poor",
"tileCoordsSubset": list(),
"tilesAreBanned": False
}
}
tree.append(entry)
with open('countries-to-generate.json', "w") as f3:
json.dump(data, f3, indent=4)