5

在服务器(MySQL 或 Oracle 或任何文件中)存储 GPS 坐标(轨迹)的最佳方式是什么?例如,它是如何在 GoogleMaps 中实现的?我想保存和比较相同部分的曲目。

PS我有所有必要的数据。

4

1 回答 1

9

如果我是你,我会使用 TRACK 和 POINT 表。

TRACK 表将为每个不同的轨道包含一行

  TRACK_ID      int not null  (PK)
  NAME          varchar(40)
  DESCRIPTION   varchar(255)
  other identifying information

POINT 表将包含每个轨道的多行,轨道中的每个点一个

  POINT_ID     int not null  (PK)
  TRACK_ID     int not null  (FK to TRACK)
  LAT          float  degrees  .. positive means north
  LONG         float  degrees  .. positive means east, negative means west
  ALT          float (elevation if you have it)
  TS           timestamp of point

关于这一点的几点说明。保持 POINT 表的行短;你会有很多,你希望能够快速地处理它们。另外,不要屈服于使用 double 而不是 float 的诱惑;浮点数据格式对于典型点具有足够的精度(除非您是土地测量员并且了解诸如通用横向墨卡托投影之类的东西)。

于 2012-11-16T14:30:58.643 回答