1
0
Fork 0
forked from 0x2620/oxjs

make map in async listmap async

This commit is contained in:
rolux 2011-05-29 14:22:54 +02:00
commit 93408b0b4d
4 changed files with 167 additions and 135 deletions

View file

@ -1127,6 +1127,18 @@ import wikipedia
if __name__ == '__main__':
file = '../txt/geonames.org/cities1000.txt'
geo['keys'] = read_json('../json/oxjs.org/geonames.keys.json')
keys = geo['keys']['place']['geonames.org']
drop = ['alternatenames']
# filter = lambda x: x['feature_code'] != 'PPLX' and x['population'] >= 100000
filter = lambda x: x['feature_code'] == 'PPLC' or x['population'] >= 10000
sort = lambda x: -x['population']
data = read_table(file, keys, drop=drop, filter=filter, sort=sort)
write_json('../json/geonames.org/cities10000.json', data, False)
print len(data)
sys.exit()
write_json('../json/geo.json', geo)
countries = get_countries()