Name

Example Data

Description

Sentence Identifier $GPGGA Global Positioning System Fix Data
UTC Time 095031.254 09:50:31
Latitude 2501.9891,N 北緯
Longitude 12133.8101,E 東經

Fix Quality:
- 0 = Invalid
- 1 = GPS fix
- 2 = DGPS fix

1 Data is from a GPS fix
Number of Satellites 07 7 Satellites are in view
Horizontal Dilution of Precision (HDOP) 7.0 Relative accuracy of horizontal position
Altitude 123.9,M 123.9 meters above mean sea level
Height of geoid above WGS84 ellipsoid 15.0,M 15.0,M
Time since last DGPS update 0.0 因為採GPS修正,不是DGPS,所以沒有資料
DGPS reference station id 0000  
Checksum *74 Used by program to check for transmission errors

瞭解了從衛星收到這字串的意義後,接下來就是怎麼去轉換經緯度的部份了,經度跟緯度的轉換方式都一樣,所以就拿其中一個來說明.

1. 2501.9891 /100 = 25.019891

2. 把小數點後的值從0.019891直接轉為19891

3. 再取小數點部份的值(19891/ 60)*10000=3315166

4. 由於第二步移了一個0,所以3315166轉小數時,要加一個0進去,所以=0.03315166

5. 所以緯度= 25+0.03315166=25.03315166

同樣的方式,算出經度=121.5635

*註此定出來的點是台北101

 

程式可以參考

http://www.dotblogs.com.tw/jeff-yeh/archive/2008/06/11/4266.aspx?pg=3

arrow
arrow
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()