def station_coords(code): result = {} result['type'] = "station_coords" result['code'] = code coords = meta.coords(code) result['coords'] = [coords['lat'], coords['lon']] return jsondump(result)
def station_allmeta(code): result = {} result['type'] = 'station_metadata' result['code'] = code coords = meta.coords(code) result['coords'] = [coords['lat'], coords['lon']] result['properties'] = meta.properties(code) return jsondump(result)
def lines_stations(lignesens): # TODO: A améliorer t = Timeo() result = {} result['type'] = 'line_stations' result['stations'] = t.getall_arrets(lignesens) coords = meta.coords(list(result['stations'].keys())) if not set(result['stations'].keys()) == set(coords.keys()): for i in set(result['stations'].keys())-set(coords.keys()): coords[i] = [] for code in result['stations'].keys(): result['stations'][code] = { 'coords': coords[code], 'name': result['stations'][code] } return jsondump(result)