Skip to content

Instantly share code, notes, and snippets.

@elon-
Created November 17, 2015 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elon-/f0173abf50073327ebbe to your computer and use it in GitHub Desktop.
Save elon-/f0173abf50073327ebbe to your computer and use it in GitHub Desktop.
problem 6.6
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