17 lines
523 B
Python
17 lines
523 B
Python
|
#!/usr/bin/python3
|
||
|
|
||
|
import osmnx as ox
|
||
|
import json
|
||
|
import configparser
|
||
|
|
||
|
config = configparser.ConfigParser()
|
||
|
config.read('config.ini')
|
||
|
osm_file = config['SHARED']['basepath'] + config['XMLPARSER']['osm_file']
|
||
|
json_file = config['SHARED']['basepath'] + config['SHARED']['json_file']
|
||
|
print('converting osm file, this takes very long!')
|
||
|
osm_data = ox.overpass_json_from_file(osm_file)
|
||
|
print("writing to file, this will take some time!")
|
||
|
with open(json_file, 'w') as writefile:
|
||
|
json.dump(osm_data, writefile)
|
||
|
print("done")
|