forked from cliffordsnow/Bellingham-Bldg-Addr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bellingham_bldg.py
40 lines (33 loc) · 1.26 KB
/
bellingham_bldg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Translation rules for Bellingham Buildings
Copyright 2016 Clifford Snow
"""
def filterTags(attrs):
if not attrs:
return
tags = {}
tags['building'] = 'yes'
if 'ADDR_NUM' in attrs and attrs['ADDR_NUM'] != '':
tags['addr:housenumber'] = attrs['ADDR_NUM']
if 'UNIT' in attrs and attrs['UNIT'] != '':
tags['addr:unit'] = attrs['UNIT']
if 'STREET' in attrs and attrs['STREET'] != '':
tags['addr:street'] = attrs['STREET']
if 'CITY' in attrs and attrs['CITY'] != '':
tags['addr:city'] = attrs['CITY']
if 'ZIP' in attrs and attrs['ZIP'] != '':
tags['addr:postcode'] = attrs['ZIP']
if 'BLDGTYPE' in attrs and attrs['BLDGTYPE'] != '':
if attrs['BLDGTYPE'] == 'CABIN':
tags['building'] = 'yes'
if attrs['BLDGTYPE'] == 'DUPLX':
tags['building'] = 'house'
if attrs['BLDGTYPE'] == 'HOUSE':
tags['building'] = 'house'
if attrs['BLDGTYPE'] == 'MOBIL':
tags['building'] = 'mobile_home'
if 'FLOORS' in attrs and attrs['FLOORS'] != '0.0':
tags['building:levels'] = attrs['FLOORS']
if 'NAME' in attrs and attrs['NAME'] != '':
tags['name'] = attrs['NAME']
return tags