-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgeoloc.py
31 lines (24 loc) · 873 Bytes
/
geoloc.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
class Coordinates:
def __init__(self, latitude, longitude):
self.latitude = latitude
self.longitude = longitude
def __repr__(self):
return "%s;%s" % (self.latitude, self.longitude)
def __add__(self, other):
return Coordinates(self.latitude + other.latitude,
self.longitude + other.longitude)
class Area:
def __init__(self, coord1, coord2):
self.corner_1 = coord1
self.corner_2 = coord2
def __repr__(self):
return "%s TO %s" % (self.corner_1, self.corner_2)
# Size of area is one side times the other
def __size__(self):
return corner_1.latitude - corner_2.latitude * corner_1.longitude - corner_2.longitude
class Path(list):
def __init__(self):
return self.list()
def __repr__(self):
# Calculate scale for cli representation
pass