def get_stations(): model = Station("","") stations = model.get_stations() if len(stations) == 0: return jsonify({ "message":"sorry! no statiosn were found" }) return jsonify({ "message":"successful", "stations":stations })
#!/usr/bin/env python3 import folium import folium.plugins import os from models.station import Station, Stop from models.line import Line m = folium.Map(location=[52, 13], tiles='stamentoner', max_zoom=18, zoom_start=4) marker_cluster = folium.plugins.MarkerCluster().add_to(m) stations = Station.get_stations() lines = Line.get_lines() for station in stations: folium.Marker(station.location, popup=station.name).add_to(marker_cluster) #is_ubahn = False #colors = ['red', 'green', 'yellow', 'black', 'pink', 'brown', 'red', 'green', 'yellow', 'black', 'pink', 'brown', 'red', 'green', 'yellow', 'black', 'pink', 'brown', 'red', 'green', 'yellow', 'black', 'pink', 'brown'] #for line in lines: # # if not line.mode == 'train': # if line.name != 'U8': # continue # color = 'green' # if line.product == 'subway': # color = 'blue' # multipolyline = [] # i = 0 # for variant in line.variants: