I want to take an osm file, clean it, and then save it as a json file. The xml file is about 1 gb big.
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()
Eventhough i use elm.clear() i still get an memory error. Anyone knows why ?