我想获取一个osm文件,清理它,然后将其保存为json文件。 xml文件大约有1GB大。你知道吗
def audit():
osm_file = open('c:\Users\Stephan\Downloads\los-angeles_california.osm', "r")
with open('lala.txt', 'w') as outfile:
for event, elem in ET.iterparse(osm_file, events=("start",)):
if elem.tag == "node" or elem.tag == "way":
json.dump(shape_element(elem),outfile)
elem.clear()
audit()
即使我使用榆树()我仍然有一个内存错误。有人知道为什么吗?你知道吗
如果你想清理它,它应该是可写的
相关问题 更多 >
编程相关推荐