-
Notifications
You must be signed in to change notification settings - Fork 0
/
strava_map.py
36 lines (27 loc) · 1.35 KB
/
strava_map.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import strava_data as sd
import pandas as pd
import argparse
def parseCmdLineArgs():
parser = argparse.ArgumentParser(description='Draw Strava Coordinates on the Map.')
parser.add_argument('-i', '--input', default = 'output_points.csv', help='Path of CSV file to get points from')
parser.add_argument('-t', '--token', default="mapbox_token.txt", help='Location of Mapbox token, required for Default Layer')
parser.add_argument('-l', '--layer', default="", help="Mapbox layer to draw. If no token, use open-street-map")
parser.add_argument('-p', '--privacy', default="", help="Optional argument to plot Privacy Zone centers")
parser.add_argument('-c', '--clusters', default="", help="Optional argument to plot clusters")
return parser.parse_args()
def main():
args = parseCmdLineArgs()
starts = pd.read_csv(args.input)
privacy_zones = pd.DataFrame()
clusters = pd.DataFrame()
#LOAD PRIVACY ZONES
if args.privacy != "":
privacy_zones = pd.read_csv(args.privacy)
privacy_zones = sd.get_privacy_coords(privacy_zones)
privacy_zones = pd.DataFrame(privacy_zones)
#LOAD CLUSTERS
if args.clusters != "":
clusters = pd.read_csv(args.clusters)
sd.draw_map(starts, privacy_zones=privacy_zones, clusters=clusters)
if __name__ == "__main__":
main()