Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
31
data/conf/isolines/add_missing_countries.py
Normal file
31
data/conf/isolines/add_missing_countries.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue