def Berkeley_pop_route(start_dt, end_dt): box = [ [-122.267443, 37.864693], [-122.250985, 37.880687] ] tl = esdt.get_aggregate_timeline_from_dt(start_dt, end_dt, box) gj_list = gfc.get_geojson_for_timeline(None, tl, viz=True) list_of_points=[] for gj in gj_list: for feature in gj: if feature['type'] == 'FeatureCollection': for feat in feature['features']: if "properties" not in feat: continue if feat['properties']['feature_type'] == "section": points = feat.geometry.coordinates list_of_points.extend(points) return {"latlng": list_of_points}
def Berkeley_pop_route(start_dt, end_dt): box = [[-122.267443, 37.864693], [-122.250985, 37.880687]] tl = esdt.get_aggregate_timeline_from_dt(start_dt, end_dt, box) gj_list = gfc.get_geojson_for_timeline(None, tl, viz=True) list_of_points = [] for gj in gj_list: for feature in gj: if feature['type'] == 'FeatureCollection': for feat in feature['features']: if "properties" not in feat: continue if feat['properties']['feature_type'] == "section": points = feat.geometry.coordinates list_of_points.extend(points) return {"latlng": list_of_points}
def Commute_pop_route(mode, start_dt, end_dt): tl = esdt.get_aggregate_timeline_from_dt(start_dt, end_dt) gj_list = gfc.get_geojson_for_timeline(None, tl, viz=True) logging.debug("len gl list is %d" % len(gj_list)) list_of_point=[] for gj in gj_list: for feature in gj: if feature['type'] == 'FeatureCollection': for feat in feature['features']: if "properties" not in feat: continue if feat['properties']['feature_type'] == "section": if mode == 'all' or feat.properties["sensed_mode"] == mode: points = feat.geometry.coordinates list_of_point.extend(points) logging.debug("Returning list of size %s" % len(list_of_point)) return {"latlng": list_of_point}
def Commute_pop_route(mode, start_dt, end_dt): tl = esdt.get_aggregate_timeline_from_dt(start_dt, end_dt) gj_list = gfc.get_geojson_for_timeline(None, tl, viz=True) logging.debug("len gl list is %d" % len(gj_list)) list_of_point = [] for gj in gj_list: for feature in gj: if feature['type'] == 'FeatureCollection': for feat in feature['features']: if "properties" not in feat: continue if feat['properties']['feature_type'] == "section": if mode == 'all' or feat.properties[ "sensed_mode"] == mode: points = feat.geometry.coordinates list_of_point.extend(points) logging.debug("Returning list of size %s" % len(list_of_point)) return {"latlng": list_of_point}