MCPcopy Create free account
hub / github.com/comaps/comaps / make_feature

Function make_feature

tools/python/mixed_to_geojson.py:119–142  ·  view source on GitHub ↗
(coord, ftype, tags)

Source from the content-addressed store, hash-verified

117
118
119def 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
145def ok_to_print(options, ftype):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected