| 117 | |
| 118 | |
| 119 | def make_feature(coord, ftype, tags): |
| 120 | global type_to_colour, COLOURS |
| 121 | colour = None |
| 122 | if ftype in type_to_colour: |
| 123 | colour = type_to_colour[ftype] |
| 124 | else: |
| 125 | if type_to_colour: |
| 126 | i = max(type_to_colour.values()) |
| 127 | else: |
| 128 | i = -1 |
| 129 | if i < len(COLOURS) - 1: |
| 130 | colour = i + 1 |
| 131 | type_to_colour[ftype] = colour |
| 132 | if colour is not None: |
| 133 | tags['marker-color'] = COLOURS[colour] |
| 134 | |
| 135 | return { |
| 136 | 'type': 'Feature', |
| 137 | 'geometry': { |
| 138 | 'type': 'Point', |
| 139 | 'coordinates': coord, |
| 140 | }, |
| 141 | 'properties': tags |
| 142 | } |
| 143 | |
| 144 | |
| 145 | def ok_to_print(options, ftype): |