Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. def filterTags(attrs):
  3. if not attrs:
  4. return
  5. tags = {}
  6.  
  7. # 基本のタグ付け
  8. # 県とか郡とかの is_inを付与。
  9. if attrs['FUDE']:
  10. tags.update({'ref:JP_fude':attrs['FUDE']})
  11. else:
  12. pass
  13.  
  14. # 耕地の種類にあわせてタグづけを変更
  15.  
  16. check_type = attrs['TYPE']
  17. if check_type.endswith('畑'):
  18. tags.update({'landuse':'farmland'})
  19. elif check_type.endswith('田'):
  20. tags.update({'landuse':'farmland'})
  21. tags.update({'crop':'rice'})
  22. else:
  23. pass
  24.  
  25. return tags
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement