-
Notifications
You must be signed in to change notification settings - Fork 0
/
getgps.py
31 lines (24 loc) · 950 Bytes
/
getgps.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
import location
class getgps_text :
def newgps(self, view) :
# GPSデータを取得
location.start_updates()
gps = location.get_location()
location.stop_updates()
# visualize all GPSdata
#gps_text = ''
#for g in gps :
# gps_text = gps_text + str(g) + ':' + str(gps[g]) + '\n'
#label.text = gps_text
# senderを使う場合
#sender.superview['alti_text'].text = str(gps['altitude']) # 高度
#sender.superview['longi_text'].text = str(gps['longitude']) # 経度
#sender.superview['lati_text'].text = str(gps['latitude']) # 緯度
view['alti_text'].text = str(gps['altitude']) # 高度
view['longi_text'].text = str(gps['longitude']) # 経度
view['lati_text'].text = str(gps['latitude']) # 緯度
# csv用の辞書作成
gps_dict = {'altitude':gps['altitude'],'longitude':gps['longitude'],'latitude':gps['latitude']}
return gps_dict
# 全てのデータが欲しい場合
# gps_dict = gps