-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dictionaries.py
187 lines (181 loc) · 8.73 KB
/
Dictionaries.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import re
class Dictionaries():
# only fragment, to be completed for all possible OSM-attributes
def __init__(self):
self.osm_attrs = {
'"height"': [ "FromAttr.Float, FromAttr.Positive" ],
'"min_height"': [ "FromAttr.Float, FromAttr.Positive" ],
'"building:levels"': [ "FromAttr.Integer, FromAttr.Positive" ],
'"building:min_level"': [ "FromAttr.Integer, FromAttr.NonNegative" ],
'"building:material"': ["FromAttr.String, CladdingMaterials" ],
'"building:colour"': [ "FromAttr.Color" ],
'"building:part"': [ "FromAttr.String" ],
'"roof:levels"': [ "FromAttr.Integer, FromAttr.NonNegative" ],
'"roof:material"': ["FromAttr.String, CladdingMaterials"],
'"roof:colour"': [ "FromAttr.Color" ],
'"roof:shape"': [ "FromAttr.String, RoofShapes" ],
'"roof:height"': [ "FromAttr.Float, FromAttr.NonNegative" ],
'"roof:angle"': [ "FromAttr.Float" ],
'"roof:direction"': [ "FromAttr.String, RoofDefs.directions", "FromAttr.Float" ],
'"roof:orientation"': ["FromAttr.String, RoofOrientation" ],
'"roof:slope:direction"': [ "FromAttr.String, RoofDefs.directions", "FromAttr.Float" ]
}
self.colors = {
"aliceblue": (0.941, 0.973, 1., 1.),
"antiquewhite": (0.98, 0.922, 0.843, 1.),
"aqua": (0., 1., 1., 1.),
"aquamarine": (0.498, 1., 0.831, 1.),
"azure": (0.941, 1., 1., 1.),
"beige": (0.961, 0.961, 0.863, 1.),
"bisque": (1., 0.894, 0.769, 1.),
"black": (0., 0., 0., 1.),
"blanchedalmond": (1., 0.922, 0.804, 1.),
"blue": (0., 0., 1., 1.),
"blueviolet": (0.541, 0.169, 0.886, 1.),
"brown": (0.647, 0.165, 0.165, 1.),
"burlywood": (0.871, 0.722, 0.529, 1.),
"cadetblue": (0.373, 0.62, 0.627, 1.),
"chartreuse": (0.498, 1., 0., 1.),
"chocolate": (0.824, 0.412, 0.118, 1.),
"coral": (1., 0.498, 0.314, 1.),
"cornflowerblue": (0.392, 0.584, 0.929, 1.),
"cornsilk": (1., 0.973, 0.863, 1.),
"crimson": (0.863, 0.078, 0.235, 1.),
"cyan": (0., 1., 1., 1.),
"darkblue": (0., 0., 0.545, 1.),
"darkcyan": (0., 0.545, 0.545, 1.),
"darkgoldenrod": (0.722, 0.525, 0.043, 1.),
"darkgray": (0.663, 0.663, 0.663, 1.),
"darkgreen": (0., 0.392, 0., 1.),
"darkgrey": (0.663, 0.663, 0.663, 1.),
"darkkhaki": (0.741, 0.718, 0.42, 1.),
"darkmagenta": (0.545, 0., 0.545, 1.),
"darkolivegreen": (0.333, 0.42, 0.184, 1.),
"darkorange": (1., 0.549, 0., 1.),
"darkorchid": (0.6, 0.196, 0.8, 1.),
"darkred": (0.545, 0., 0., 1.),
"darksalmon": (0.914, 0.588, 0.478, 1.),
"darkseagreen": (0.561, 0.737, 0.561, 1.),
"darkslateblue": (0.282, 0.239, 0.545, 1.),
"darkslategray": (0.184, 0.31, 0.31, 1.),
"darkslategrey": (0.184, 0.31, 0.31, 1.),
"darkturquoise": (0., 0.808, 0.82, 1.),
"darkviolet": (0.58, 0., 0.827, 1.),
"deeppink": (1., 0.078, 0.576, 1.),
"deepskyblue": (0., 0.749, 1., 1.),
"dimgray": (0.412, 0.412, 0.412, 1.),
"dimgrey": (0.412, 0.412, 0.412, 1.),
"dodgerblue": (0.118, 0.565, 1., 1.),
"firebrick": (0.698, 0.133, 0.133, 1.),
"floralwhite": (1., 0.98, 0.941, 1.),
"forestgreen": (0.133, 0.545, 0.133, 1.),
"fuchsia": (1., 0., 1., 1.),
"gainsboro": (0.863, 0.863, 0.863, 1.),
"ghostwhite": (0.973, 0.973, 1., 1.),
"gold": (1., 0.843, 0., 1.),
"goldenrod": (0.855, 0.647, 0.125, 1.),
"gray": (0.502, 0.502, 0.502, 1.),
"green": (0., 0.502, 0., 1.),
"greenyellow": (0.678, 1., 0.184, 1.),
"grey": (0.502, 0.502, 0.502, 1.),
"honeydew": (0.941, 1., 0.941, 1.),
"hotpink": (1., 0.412, 0.706, 1.),
"indianred": (0.804, 0.361, 0.361, 1.),
"indigo": (0.294, 0., 0.51, 1.),
"ivory": (1., 1., 0.941, 1.),
"khaki": (0.941, 0.902, 0.549, 1.),
"lavender": (0.902, 0.902, 0.98, 1.),
"lavenderblush": (1., 0.941, 0.961, 1.),
"lawngreen": (0.486, 0.988, 0., 1.),
"lemonchiffon": (1., 0.98, 0.804, 1.),
"lightblue": (0.678, 0.847, 0.902, 1.),
"lightcoral": (0.941, 0.502, 0.502, 1.),
"lightcyan": (0.878, 1., 1., 1.),
"lightgoldenrodyellow": (0.98, 0.98, 0.824, 1.),
"lightgray": (0.827, 0.827, 0.827, 1.),
"lightgreen": (0.565, 0.933, 0.565, 1.),
"lightgrey": (0.827, 0.827, 0.827, 1.),
"lightpink": (1., 0.714, 0.757, 1.),
"lightsalmon": (1., 0.627, 0.478, 1.),
"lightseagreen": (0.125, 0.698, 0.667, 1.),
"lightskyblue": (0.529, 0.808, 0.98, 1.),
"lightslategray": (0.467, 0.533, 0.6, 1.),
"lightslategrey": (0.467, 0.533, 0.6, 1.),
"lightsteelblue": (0.69, 0.769, 0.871, 1.),
"lightyellow": (1., 1., 0.878, 1.),
"lime": (0., 1., 0., 1.),
"limegreen": (0.196, 0.804, 0.196, 1.),
"linen": (0.98, 0.941, 0.902, 1.),
"magenta": (1., 0., 1., 1.),
"maroon": (0.502, 0., 0., 1.),
"mediumaquamarine": (0.4, 0.804, 0.667, 1.),
"mediumblue": (0., 0., 0.804, 1.),
"mediumorchid": (0.729, 0.333, 0.827, 1.),
"mediumpurple": (0.576, 0.439, 0.859, 1.),
"mediumseagreen": (0.235, 0.702, 0.443, 1.),
"mediumslateblue": (0.482, 0.408, 0.933, 1.),
"mediumspringgreen": (0., 0.98, 0.604, 1.),
"mediumturquoise": (0.282, 0.82, 0.8, 1.),
"mediumvioletred": (0.78, 0.082, 0.522, 1.),
"midnightblue": (0.098, 0.098, 0.439, 1.),
"mintcream": (0.961, 1., 0.98, 1.),
"mistyrose": (1., 0.894, 0.882, 1.),
"moccasin": (1., 0.894, 0.71, 1.),
"navajowhite": (1., 0.871, 0.678, 1.),
"navy": (0., 0., 0.502, 1.),
"oldlace": (0.992, 0.961, 0.902, 1.),
"olive": (0.502, 0.502, 0., 1.),
"olivedrab": (0.42, 0.557, 0.137, 1.),
"orange": (1., 0.647, 0., 1.),
"orangered": (1., 0.271, 0., 1.),
"orchid": (0.855, 0.439, 0.839, 1.),
"palegoldenrod": (0.933, 0.91, 0.667, 1.),
"palegreen": (0.596, 0.984, 0.596, 1.),
"paleturquoise": (0.686, 0.933, 0.933, 1.),
"palevioletred": (0.859, 0.439, 0.576, 1.),
"papayawhip": (1., 0.937, 0.835, 1.),
"peachpuff": (1., 0.855, 0.725, 1.),
"peru": (0.804, 0.522, 0.247, 1.),
"pink": (1., 0.753, 0.796, 1.),
"plum": (0.867, 0.627, 0.867, 1.),
"powderblue": (0.69, 0.878, 0.902, 1.),
"purple": (0.502, 0., 0.502, 1.),
"red": (1., 0., 0., 1.),
"rosybrown": (0.737, 0.561, 0.561, 1.),
"royalblue": (0.255, 0.412, 0.882, 1.),
"saddlebrown": (0.545, 0.271, 0.075, 1.),
"salmon": (0.98, 0.502, 0.447, 1.),
"sandybrown": (0.957, 0.643, 0.376, 1.),
"seagreen": (0.18, 0.545, 0.341, 1.),
"seashell": (1., 0.961, 0.933, 1.),
"sienna": (0.627, 0.322, 0.176, 1.),
"silver": (0.753, 0.753, 0.753, 1.),
"skyblue": (0.529, 0.808, 0.922, 1.),
"slateblue": (0.416, 0.353, 0.804, 1.),
"slategray": (0.439, 0.502, 0.565, 1.),
"slategrey": (0.439, 0.502, 0.565, 1.),
"snow": (1., 0.98, 0.98, 1.),
"springgreen": (0., 1., 0.498, 1.),
"steelblue": (0.275, 0.51, 0.706, 1.),
"tan": (0.824, 0.706, 0.549, 1.),
"teal": (0., 0.502, 0.502, 1.),
"thistle": (0.847, 0.749, 0.847, 1.),
"tomato": (1., 0.388, 0.278, 1.),
"turquoise": (0.251, 0.878, 0.816, 1.),
"violet": (0.933, 0.51, 0.933, 1.),
"wheat": (0.961, 0.871, 0.702, 1.),
"white": (1., 1., 1., 1.),
"whitesmoke": (0.961, 0.961, 0.961, 1.),
"yellow": (1., 1., 0., 1.),
"yellowgreen": (0.604, 0.804, 0.196, 1.)
}
def getAttributeTypes(self,attribute):
if attribute not in self.osm_attrs.keys():
return [ "FromAttr.String" ]
else:
return self.osm_attrs[attribute]
def getColor(self, color):
if color in self.colors:
return self.colors[color]
else:
return None