Created
November 17, 2015 23:45
-
-
Save elon-/f0173abf50073327ebbe to your computer and use it in GitHub Desktop.
problem 6.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def shape_element(element): | |
node = {} | |
a=[] | |
if element.tag == "node" or element.tag == "way" : | |
node=element.attrib | |
a.append(element.get("lat")) | |
a.append(element.get("lon")) | |
node["pos"]=a | |
node["created"]={c:node[c] for c in CREATED} | |
for k in element.iter(): | |
print k.attrib | |
del node["lat"] | |
del node["lon"] | |
for i in CREATED: | |
del node[i] | |
for k in element.iter(): | |
print k.attrib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment