请教OZI的轨迹文件PLT的数据记录格式

下面是OZI自动记录的轨迹,文件头且不说.....
数据文件基本都能看得出来意思,除了2个B)

OziExplorer Track Point File Version 2.0
WGS 84
Altitude is in Feet
Reserved 3
0,2,255,OziCE Track Log File,1
0

29.6422517, 106.5761067,0, 776.9,39084.4230903 ,020107,100915.000

29.6419300, 106.5755633,0, 780.5,39084.4231250 ,020107,100918.000

29.6415000, 106.5748483,0, 790.7,39084.4231713 ,020107,100922.000

29.6410833, 106.5741500,0, 801.5,39084.4232176 ,020107,100926.000

29.6406833, 106.5734700,0, 811.7,39084.4232639 ,020107,100930.000

29.6403017, 106.5728050,-------------经纬度
0,------------------------------------------------不知道

822.8,--------------------------------------海拔高度(英尺)
39084.4233102 ,---------------------------不知道(OZI读入此文件后,凭这个位置的数据,可以算出距离、速度、方向)
020107,----------------------------------------日期(格林威治,我们要加8小时)2007年1月2日
100934.000-----------------------------------时间(格林威治,我们要加8小时)10:09:34

有人知道答案吗?

已归档
点赞 4
11 评论
共 11 条评论
帖子已归档
Avatar
carabao 2007-06-26 08:34

Track File (.plt)

Line 1 : File type and version information
Line 2 : Geodetic Datum used for the Lat/Lon positions for each trackpoint
Line 3 : "Altitude is in feet" - just a reminder that the altitude is always stored in feet
Line 4 : Reserved for future use
Line 5 : multiple fields as below

    Field 1 : always zero (0)
    Field 2 : width of track plot line on screen - 1 or 2 are usually the best
    Field 3 : track color (RGB)
    Field 4 : track description (no commas allowed)
    Field 5 : track skip value - reduces number of track points plotted, usually set to 1
    Field 6 : track type - 0 = normal , 10 = closed polygon , 20 = Alarm Zone
    Field 7 : track fill style - 0 =bsSolid; 1 =bsClear; 2 =bsBdiagonal; 3 =bsFdiagonal; 4 =bsCross;
    5 =bsDiagCross; 6 =bsHorizontal; 7 =bsVertical;
    Field 8 : track fill color (RGB)

Line 6 : Number of track points in the track, not used, the number of points is determined when reading the points file

Trackpoint data

    * One line per trackpoint
    * each field separated by a comma
    * non essential fields need not be entered but comma separators must still be used (example ,,)
      defaults will be used for empty fields

Field 1 : Latitude - decimal degrees.
Field 2 : Longitude - decimal degrees.
Field 3 : Code - 0 if normal, 1 if break in track line
Field 4 : Altitude in feet (-777 if not valid)
Field 5 : Date - see Date Format below, if blank a preset date will be used
Field 6 : Date as a string
Field 7 : Time as a string

Note that OziExplorer reads the Date/Time from field 5, the date and time in fields 6 & 7 are ignored.

Example
-27.350436, 153.055540,1,-777,36169.6307194, 09-Jan-99, 3:08:14
-27.348610, 153.055867,0,-777,36169.6307194, 09-Jan-99, 3:08:14

Date Format

Delphi stores date and time values in the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

Following are some examples of TDateTime values and their corresponding dates and times:

0 - 12/30/1899 12:00 am
2.75 - 1/1/1900 6:00 pm
-1.25 - 12/29/1899 6:00 am
35065 - 1/1/1996 12:00 am

Avatar
眼-睛 OP 2007-06-27 00:55

水牛兄,多谢分享资料!

可是.......

我想知道的还是没有找到答案......:})
39084.4233102 ,---------------------------不知道(OZI读入此文件后,凭这个位置的数据,可以算出距离、速度、方向)
OZI是怎么凭着这个数算出速度、距离、前进方向的呢?
OZI又是怎样把GPS的数据浓缩成这样一个数的呢?

继续等待终极的答案:D

Avatar
carabao 2007-06-27 07:01

看贴不认真xx(

Trackpoint data

Field 5 : Date - see Date Format below, if blank a preset date will be used

Note that OziExplorer reads the Date/Time from field 5, the date and time in fields 6 & 7 are ignored.

Avatar
眼-睛 OP carabao 2007-06-27 07:24

Date Format

Delphi stores date and time values in the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

Following are some examples of TDateTime values and their corresponding dates and times:

0 - 12/30/1899 12:00 am
2.75 - 1/1/1900 6:00 pm
-1.25 - 12/29/1899 6:00 am
35065 - 1/1/1996 12:00 am
:I大学英语还是靠偷看才过关的.......:P
这是这么一来,就有点恐怖了,这个位置的数据岂不是就只是时间数据了!?:O)
难道,OZI里显示的速度、方位角、距离数据都是软件自己根据经纬度和时间间隔算出来的??
我试试看看........
再次谢谢水牛兄.......:D

查了下参考资料:
TDateTime类型
Delphi中最常用的表示日期时间的数据类型TDateTime类型,和普通的整形数一样,你可以给日期定义一个日期型变量以便在程序中进行操作。TdateTime类型实质上是一个Double型的数,在Delphi中是这样定义TdateTime类型: type TDateTime = type Double ,具体的算法是用Double数的整数部分表示日期,以1989年12月30日为基准点,以天为单位进行加减,如数字1表示1900年1月1日,数字-1表示1989年12月29日。而小数部分则用来表示时间,其值为欲表示的时间与一整天总时间的比值,如早上6点就是6/24=0.25,而早上6:15就是(6*60+15)/(24*60)=0.2604166666666666666666666666667,下面,给出几个例子说明TDateTime类型与Double类型的交互关系

0 12/30/1899 00:00:00

2.75 1/1/1900 18:00:00

-1.25 12/29/1899 6:00:00

35065 1/1/1996 00:00:00

相信大家一定能自己理解TdateTime与Double之间的转换方法,因此,从根本上对TDateTime的操作与Double完全一样。

Avatar
赛里木湖 carabao 2007-07-02 04:31

英盲?
呵呵

Avatar
眼-睛 OP 2007-06-27 07:54

在水牛兄的帮助下,基本搞清楚了......:D

从下面的试验可以看到,对比原始数据,将明码时间数据置空后(也就是Field 6 、Field 7)后,OZI的显示并无任何改变。但是再将delphi时间数据置空后,OZI就只能根据前后点的经纬度计算出距离和航向,但是因为缺乏时间数据,速度就无法计算了。时间显示页错了......

这么一来,就能想办法将GPS-LOGGER的csv文件转换成PLT文件了~~~~8D

1、使用原始数据时:
OziExplorer Track Point File Version 2.0
WGS 84
Altitude is in Feet
Reserved 3
0,2,255,OziCE Track Log File,1
0

29.6422517, 106.5761067,0, 776.9,39084.4230903 ,020107,100915.000

29.6419300, 106.5755633,0, 780.5,39084.4231250 ,020107,100918.000

29.6415000, 106.5748483,0, 790.7,39084.4231713 ,020107,100922.000

29.6410833, 106.5741500,0, 801.5,39084.4232176 ,020107,100926.000

29.6406833, 106.5734700,0, 811.7,39084.4232639 ,020107,100930.000

29.6403017, 106.5728050,0, 822.8,39084.4233102 ,020107,100934.000

29.6399417, 106.5721533,0, 833.7,39084.4233565 ,020107,100938.000

29.6395983, 106.5714983,0, 841.9,39084.4234028 ,020107,100942.000

29.6392650, 106.5708350,0, 845.8,39084.4234491 ,020107,100946.000

29.6389350, 106.5701383,0, 844.5,39084.4234954 ,020107,100950.000

29.6386000, 106.5694033,0, 843.8,39084.4235417 ,020107,100954.000

29.6382417, 106.5686450,0, 842.5,39084.4235880 ,020107,100958.000

29.6378833, 106.5678883,0, 836.6,39084.4236343 ,020107,101002.000

29.6375283, 106.5671367,0, 830.7,39084.4236806 ,020107,101006.000

29.6371683, 106.5663783,0, 826.8,39084.4237269 ,020107,101010.000

原始数据

2、删除部分明码时间数据后:
OziExplorer Track Point File Version 2.0
WGS 84
Altitude is in Feet
Reserved 3
0,2,255,OziCE Track Log File,1
0

29.6422517, 106.5761067,0, 776.9,39084.4230903

29.6419300, 106.5755633,0, 780.5,39084.4231250

29.6415000, 106.5748483,0, 790.7,39084.4231713

29.6410833, 106.5741500,0, 801.5,39084.4232176

29.6406833, 106.5734700,0, 811.7,39084.4232639

29.6403017, 106.5728050,0, 822.8,39084.4233102

29.6399417, 106.5721533,0, 833.7,39084.4233565

29.6395983, 106.5714983,0, 841.9,39084.4234028

29.6392650, 106.5708350,0, 845.8,39084.4234491

29.6389350, 106.5701383,0, 844.5,39084.4234954

29.6386000, 106.5694033,0, 843.8,39084.4235417 ,020107,100954.000

29.6382417, 106.5686450,0, 842.5,39084.4235880 ,020107,100958.000

29.6378833, 106.5678883,0, 836.6,39084.4236343 ,020107,101002.000

29.6375283, 106.5671367,0, 830.7,39084.4236806 ,020107,101006.000

删除明码时间数据后

3、删除部分delphi时间数据后:
OziExplorer Track Point File Version 2.0
WGS 84
Altitude is in Feet
Reserved 3
0,2,255,OziCE Track Log File,1
0

29.6422517, 106.5761067,0, 776.9,,020107,100915.000

29.6419300, 106.5755633,0, 780.5,,020107,100918.000

29.6415000, 106.5748483,0, 790.7,,020107,100922.000

29.6410833, 106.5741500,0, 801.5,,020107,100926.000

29.6406833, 106.5734700,0, 811.7,,020107,100930.000

29.6403017, 106.5728050,0, 822.8,,020107,100934.000

29.6399417, 106.5721533,0, 833.7,,020107,100938.000

29.6395983, 106.5714983,0, 841.9,,020107,100942.000

29.6392650, 106.5708350,0, 845.8,,020107,100946.000

29.6389350, 106.5701383,0, 844.5,,020107,100950.000

29.6386000, 106.5694033,0, 843.8,39084.4235417 ,020107,100954.000

29.6382417, 106.5686450,0, 842.5,39084.4235880 ,020107,100958.000

29.6378833, 106.5678883,0, 836.6,39084.4236343 ,020107,101002.000

29.6375283, 106.5671367,0, 830.7,39084.4236806 ,020107,101006.000

29.6371683, 106.5663783,0, 826.8,39084.4237269 ,020107,101010.000

29.6367033, 106.5653950,0, 820.9,39084.4237847 ,020107,101015.000

删除delphi时间数据后

Avatar
眼-睛 OP 2007-06-29 04:07

上面搞清楚了plt文件的数据结构以及定义,其中TDate数据比较麻烦,反正我的GPS-LOGGER是没有记存那样的数据的。下面是GPS-logger的csv数据:

原来的数据-------日期和时间数据格式都是常规的,不是OZI的plt格式

经过几次尝试,发现办法其实很简单!8D
只要设置单元格格式

设为文本格式

在设为文本格式后,excel自动将日期格式转为delphi的TDate格式:
转换完成后

同样的办法,可以将time数据也转成delphi的TDate格式
然后将日期和时间两个数据相加,就是ozi的plt文件里。时间的纪录格式。

剩下的工作,就是在excel里将数据按plt文件的数据顺序排好,将文件存为csv格式(数据间以逗号间隔),将csv文件改成plt后缀,并将文件头等加进去,一个完美的ozi的航迹文件搞定~~~~~8D

感谢赵烟侠及水牛的提醒与帮助,又明白一点东西:D

Avatar
马儿菲菲 2007-08-07 06:45

好贴!!

Avatar
happyer 2007-08-28 07:08

老贴也要回一个!!

Avatar
红尘之上 2007-08-28 13:27

呵呵,好帖。
眼睛很好学啊,还有什么心得可以分享一下么?

Avatar
嶺南人 2008-01-16 10:30

好好学习,天天向上!