Skip to content

Instantly share code, notes, and snippets.

@ian29
Created April 4, 2012 22:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ian29/380dd59f756da466d0cc to your computer and use it in GitHub Desktop.
def translateAttributes(attrs):
if not attrs: return
tags = {}
# Use the "NOM_ACT" attribute as the name= tag
if attrs['NAME1']:
tags = {'name':attrs['NAME1']}
# If the name contains an hyphen, set it to the ref= tag too
if attrs['NAME1'].find('-') != -1:
tags.update({'ref':attrs['NAME1']})
tags.update({'boundary':'administrative'})
# egyptian governates are admin_level three: http://wiki.openstreetmap.org/wiki/Tag:boundary=administrative
tags.update({'admin_level':'3'})
return tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment