Skip to content Skip to sidebar Skip to footer

Migrate From Et.parse To Etree.iterparse

Wrote a code to parse .osm file. Spend a lot of time to build a up to 50 rows code but ran into a 'Memory Error' problem. Seems like the best solution is to use interparse() inst

Solution 1:

tree = ET.iterparse('file.osm')
root = tree.root

this will give you the tree root. from there it is the same as parse


Post a Comment for "Migrate From Et.parse To Etree.iterparse"