我正在研究如何将以下文件 .gp 转换为 csv 格式,同时将坐标转换为 R 中的速度和时间

I am looking at how to convert the following file .gp to csv format while converting coordinates to the velocity and time in R

希望将 .gp 文件转换为 .csv。此数据是从不断跟踪其位置的 gps 设备中提取的。

此外,我想找出贯穿始终的时间和速度。

这是一个输出示例。

$GNRMC,020555.90,A,4828.05510,N,12318.87567,W,0.059,,170322,,,A*7E
$GNRMC,020556.00,A,4828.05509,N,12318.87569,W,0.030,,170322,,,A*7D
$GNRMC,020556.10,A,4828.05509,N,12318.87570,W,0.040,,170322,,,A*73
$GNRMC,020556.20,A,4828.05508,N,12318.87571,W,0.018,,170322,,,A*7D
$GNRMC,020556.30,A,4828.05508,N,12318.87572,W,0.043,,170322,,,A*71
$GNRMC,020556.40,A,4828.05508,N,12318.87573,W,0.058,,170322,,,A*7D
$GNRMC,020556.50,A,4828.05508,N,12318.87573,W,0.017,,170322,,,A*77
$GNRMC,020556.60,A,4828.05509,N,12318.87573,W,0.047,,170322,,,A*70
$GNRMC,020556.70,A,4828.05510,N,12318.87572,W,0.041,,170322,,,A*7E
$GNRMC,020556.80,A,4828.05510,N,12318.87573,W,0.075,,170322,,,A*77
$GNRMC,020556.90,A,4828.05511,N,12318.87572,W,0.066,,170322,,,A*74
dat <- read.csv(text=txt, head=FALSE)
dat
#--------------
       V1      V2 V3       V4 V5       V6 V7    V8 V9    V10 V11 V12  V13
1  $GNRMC 20555.9  A 4828.055  N 12318.88  W 0.059 NA 170322  NA  NA A*7E
2  $GNRMC 20556.0  A 4828.055  N 12318.88  W 0.030 NA 170322  NA  NA A*7D
3  $GNRMC 20556.1  A 4828.055  N 12318.88  W 0.040 NA 170322  NA  NA A*73
4  $GNRMC 20556.2  A 4828.055  N 12318.88  W 0.018 NA 170322  NA  NA A*7D
5  $GNRMC 20556.3  A 4828.055  N 12318.88  W 0.043 NA 170322  NA  NA A*71
6  $GNRMC 20556.4  A 4828.055  N 12318.88  W 0.058 NA 170322  NA  NA A*7D
7  $GNRMC 20556.5  A 4828.055  N 12318.88  W 0.017 NA 170322  NA  NA A*77
8  $GNRMC 20556.6  A 4828.055  N 12318.88  W 0.047 NA 170322  NA  NA A*70
9  $GNRMC 20556.7  A 4828.055  N 12318.88  W 0.041 NA 170322  NA  NA A*7E
10 $GNRMC 20556.8  A 4828.055  N 12318.88  W 0.075 NA 170322  NA  NA A*77
11 $GNRMC 20556.9  A 4828.055  N 12318.88  W 0.066 NA 170322  NA  NA A*74

我在 https://docs.novatel.com/OEM7/Content/Logs/GPRMC.htm

找到了文件格式的描述

所以时间是 V2,以节为单位的速度是 V8:

dat$V8
# [1] 0.059 0.030 0.040 0.018 0.043 0.058 0.017 0.047 0.041 0.075 0.066

附录:虽然我回答了有关时间和速度的具体问题,但我仍然对纬度和经度编码感到困惑。我认为它可能被编码为

12 月分钟数 3857.5634N09515.92890W ddmm.mmmmdddmm.mmmm

所以纬度应该是北纬 48 度 28.055 分,西经 123 度 18.88 分,所以这应该是在加拿大不列颠哥伦比亚省维多利亚市的世纪体育场附近。请参阅:https://www.earthpoint.us/convert.aspx 了解其他经纬度格式选项的示例。