-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlocationParse.py
76 lines (51 loc) · 1.77 KB
/
locationParse.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
'''
Juno Mayer, Alex Marozick and Abduarraheem Elfandi
'''
import os
import utm
import requests
import sys
import gpxpy
import gpxpy.gpx
import json
from configparser import ConfigParser
from simplify import giveCueSheet
def main(file=''):
if file == '':
print("No file given")
return
gpx_file = open(file, 'r')
gpx = gpxpy.parse(gpx_file)
return giveCueSheet(gpx)
# class MyTrack:
# '''
# Each track will contain a name and a list of locations that are in that track segment.
# '''
# listLocation = []
# def __init__(self, trackName):
# self.trackName = trackName
# class Location:
# '''
# A location is a part of a track which contains a latitude,
# longitude, elevation, the time that location has been reached
# and the street name of where that location is at.
# Then a group of locations will all be put into a list of location for that specific track.
# '''
# def __init__(self, latitude: float, longitude: float, elevation: float, time: str, stName: str):
# self.latitude = latitude
# self.longitude = longitude
# self.elevation = elevation
# self.time = time
# self.stName = stName
# def getStName(lat: float, lng: float):
# '''
# Function that gets the street name given the latitude and longitude.
# '''
# payload = {"apiKey" : api_key, "version" : "4.10",
# "lat" : lat, "lon" : lng, "format" : "JSON"}
# r = requests.get("http://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/Rest/", params=payload)
# # print(r.text)
# result = json.loads(r.text)
# return result["StreetAddresses"][0]["StreetAddress"]
if __name__ == "__main__":
main()