-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMHK_bicycle_racks.py
46 lines (40 loc) · 1.38 KB
/
MHK_bicycle_racks.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
41
42
43
44
45
46
"""
ogr2osm translation file I used to import all bicycle racks in the city of
Manhattan, KS into OSM from a shapefile provided to me by the city.
This translation file requires the old version of ogr2osm (see readme)
"""
def translateAttributes(attrs):
if not attrs: return
tags = {}
if attrs['Style']:
tags.update({'MHK:Style':attrs['Style']})
if attrs['Capacity']:
tags.update({'capacity':attrs['Capacity'].lstrip(' ')})
if attrs['Condition']:
tags.update({'MHK:Condition':attrs['Condition']})
if attrs['Owner']:
if attrs['Owner'].find('City') != -1:
tags.update({'operator':'City of Manhattan'})
tags.update({'access':'yes'})
elif attrs['Owner'].find('KSU') != -1:
tags.update({'operator':'Kansas State University'})
tags.update({'access':'university'})
elif attrs['Owner'].find('RLCO') != -1:
tags.update({'operator':'Riley County'})
tags.update({'access':'yes'})
else:
tags.update({'MHK:Owner':attrs['Owner']})
if attrs['Security']:
tags.update({'MHK:Security':attrs['Security']})
if attrs['Locking']:
tags.update({'MHK:Locking':attrs['Locking']})
if attrs['Weather_Pr']:
if attrs['Weather_Pr'].find('Yes') != -1:
tags.update({'covered':'yes'})
elif attrs['Weather_Pr'].find('No') != -1:
tags.update({'covered':'no'})
if 'Notes' in attrs:
print "Notes in attrs!"
if attrs['Notes']:
tags.update({'notes':attrs['Notes']})
return tags