由 mygod200 » 周三 4月 29, 2026 12:05 pm
我从amap6.6升级过来,发现查询原来历史轨迹的坐标变成了一条直线,打开数据库发现,traccar6.11.1增加了latitudewgs84和longitudewgs84两列。
经测试发现,把原latitude列的数据复制到latitudewgs84列,在traccar6.11.1查询历史轨迹正常。
请坛主看下是不是traccar6.11.1版修改有误?
版本如下:
代码: 全选
root@mike-docker-ubuntu24:/project/cvs/loc_init# docker ps -a |grep traccar_cn_t
33e937b34590 bg6rsh/traccar-amap:ubuntu "java -Xms128m -Xmx1?" 41 hours ago Up 14 hours 0.0.0.0:60008->8082/tcp, [::]:60008->8082/tcp traccar_cn_t
root@mike-docker-ubuntu24:/project/cvs/loc_init# docker images |grep traccar
bg6rsh/traccar-amap ubuntu d389fd96cd9c 4 months ago 520MB
新结构多了两列:
代码: 全选
MariaDB [traccar_amap610t_sync]> DESCRIBE tc_positions;
+----------------+---------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| protocol | varchar(128) | YES | | NULL | |
| deviceid | int(11) | NO | MUL | NULL | |
| servertime | timestamp | NO | | current_timestamp() | |
| devicetime | timestamp | NO | | NULL | |
| fixtime | timestamp | NO | | NULL | |
| valid | bit(1) | NO | | NULL | |
| latitude | double | NO | | NULL | |
| longitude | double | NO | | NULL | |
| altitude | float | NO | | NULL | |
| speed | float | NO | | NULL | |
| course | float | NO | | NULL | |
| address | varchar(512) | YES | | NULL | |
| attributes | varchar(4000) | YES | | NULL | |
| accuracy | double | NO | | 0 | |
| network | varchar(4000) | YES | | NULL | |
| geofenceids | varchar(128) | YES | | NULL | |
| latitudewgs84 | double | YES | | NULL | |
| longitudewgs84 | double | YES | | NULL | |
+----------------+---------------+------+-----+---------------------+----------------+
将latitude 赋值给latitudewgs84 可正常显示的
正确的结果:
代码: 全选
MariaDB [traccar_amap610t_sync]> SELECT * FROM tc_positions ORDER BY id DESC LIMIT 2;
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| id | protocol | deviceid | servertime | devicetime | fixtime | valid | latitude | longitude | altitude | speed | course | address | attributes | accuracy | network | geofenceids | latitudewgs84 | longitudewgs84 |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| 942993 | huabao | 7 | 2026-04-27 10:41:11 | 2026-04-27 10:41:09 | 2026-04-27 10:41:09 | | 30.25623116321045 | 120.12434323011745 | 11 | 15.2808 | 174 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323300,"rssi":31,"sat":35,"iccid":"898608340124c0428927","distance":108.6679047877219,"totalDistance":3797403.5884900284,"motion":true,"hours":1318318000} | 0 | null | null | 30.25623116321045 | NULL |
| 942989 | huabao | 7 | 2026-04-27 10:40:50 | 2026-04-27 10:40:49 | 2026-04-27 10:40:49 | | 30.257207232490412 | 120.12436028143401 | 8 | 9.44925 | 188 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323200,"rssi":5,"sat":34,"iccid":"898608340124c0428927","distance":121.00132321316921,"totalDistance":3797294.9205852407,"motion":true,"hours":1318298000} | 0 | null | null | 30.257207232490412 | NULL |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
2 rows in set (0.002 sec)
如果没有将latitude 赋值给latitudewgs84 ,直接使用amap6.6的数据库就会
出错,只显示一条竖线:
代码: 全选
MariaDB [traccar_amap610t_sync]> SELECT * FROM tc_positions ORDER BY id DESC LIMIT 2;
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| id | protocol | deviceid | servertime | devicetime | fixtime | valid | latitude | longitude | altitude | speed | course | address | attributes | accuracy | network | geofenceids | latitudewgs84 | longitudewgs84 |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| 942993 | huabao | 7 | 2026-04-27 10:41:11 | 2026-04-27 10:41:09 | 2026-04-27 10:41:09 | | 30.25623116321045 | 120.12434323011745 | 11 | 15.2808 | 174 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323300,"rssi":31,"sat":35,"iccid":"898608340124c0428927","distance":108.6679047877219,"totalDistance":3797403.5884900284,"motion":true,"hours":1318318000} | 0 | null | null | NULL | NULL |
| 942989 | huabao | 7 | 2026-04-27 10:40:50 | 2026-04-27 10:40:49 | 2026-04-27 10:40:49 | | 30.257207232490412 | 120.12436028143401 | 8 | 9.44925 | 188 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323200,"rssi":5,"sat":34,"iccid":"898608340124c0428927","distance":121.00132321316921,"totalDistance":3797294.9205852407,"motion":true,"hours":1318298000} | 0 | null | null | NULL | NULL |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
2 rows in set (0.002 sec)
建议坛主是不是保留原
latitude/longitude为wgs84原版本数据,增加atitude
gcj/longitude
gcj两列结构,这样即能兼容原版traccar结构,也有国内坐标的支持?
我目前正常使用的还停留原amap6.6, 待老大更新后再来升级~~~
我从amap6.6升级过来,发现查询原来历史轨迹的坐标变成了一条直线,打开数据库发现,traccar6.11.1增加了latitudewgs84和longitudewgs84两列。
经测试发现,把原latitude列的数据复制到latitudewgs84列,在traccar6.11.1查询历史轨迹正常。
请坛主看下是不是traccar6.11.1版修改有误?
版本如下:
[code]
root@mike-docker-ubuntu24:/project/cvs/loc_init# docker ps -a |grep traccar_cn_t
33e937b34590 bg6rsh/traccar-amap:ubuntu "java -Xms128m -Xmx1?" 41 hours ago Up 14 hours 0.0.0.0:60008->8082/tcp, [::]:60008->8082/tcp traccar_cn_t
root@mike-docker-ubuntu24:/project/cvs/loc_init# docker images |grep traccar
bg6rsh/traccar-amap ubuntu d389fd96cd9c 4 months ago 520MB
[/code]
新结构多了两列:
[code]MariaDB [traccar_amap610t_sync]> DESCRIBE tc_positions;
+----------------+---------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| protocol | varchar(128) | YES | | NULL | |
| deviceid | int(11) | NO | MUL | NULL | |
| servertime | timestamp | NO | | current_timestamp() | |
| devicetime | timestamp | NO | | NULL | |
| fixtime | timestamp | NO | | NULL | |
| valid | bit(1) | NO | | NULL | |
| latitude | double | NO | | NULL | |
| longitude | double | NO | | NULL | |
| altitude | float | NO | | NULL | |
| speed | float | NO | | NULL | |
| course | float | NO | | NULL | |
| address | varchar(512) | YES | | NULL | |
| attributes | varchar(4000) | YES | | NULL | |
| accuracy | double | NO | | 0 | |
| network | varchar(4000) | YES | | NULL | |
| geofenceids | varchar(128) | YES | | NULL | |
| latitudewgs84 | double | YES | | NULL | |
| longitudewgs84 | double | YES | | NULL | |
+----------------+---------------+------+-----+---------------------+----------------+[/code]
将latitude 赋值给latitudewgs84 可正常显示的[color=#FF0000]正确[/color]的结果:[code]
MariaDB [traccar_amap610t_sync]> SELECT * FROM tc_positions ORDER BY id DESC LIMIT 2;
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| id | protocol | deviceid | servertime | devicetime | fixtime | valid | latitude | longitude | altitude | speed | course | address | attributes | accuracy | network | geofenceids | latitudewgs84 | longitudewgs84 |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| 942993 | huabao | 7 | 2026-04-27 10:41:11 | 2026-04-27 10:41:09 | 2026-04-27 10:41:09 | | 30.25623116321045 | 120.12434323011745 | 11 | 15.2808 | 174 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323300,"rssi":31,"sat":35,"iccid":"898608340124c0428927","distance":108.6679047877219,"totalDistance":3797403.5884900284,"motion":true,"hours":1318318000} | 0 | null | null | 30.25623116321045 | NULL |
| 942989 | huabao | 7 | 2026-04-27 10:40:50 | 2026-04-27 10:40:49 | 2026-04-27 10:40:49 | | 30.257207232490412 | 120.12436028143401 | 8 | 9.44925 | 188 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323200,"rssi":5,"sat":34,"iccid":"898608340124c0428927","distance":121.00132321316921,"totalDistance":3797294.9205852407,"motion":true,"hours":1318298000} | 0 | null | null | 30.257207232490412 | NULL |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
2 rows in set (0.002 sec)
[/code]
如果没有将latitude 赋值给latitudewgs84 ,直接使用amap6.6的数据库就会[color=#FF0000]出错[/color],只显示一条竖线:[code]
MariaDB [traccar_amap610t_sync]> SELECT * FROM tc_positions ORDER BY id DESC LIMIT 2;
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| id | protocol | deviceid | servertime | devicetime | fixtime | valid | latitude | longitude | altitude | speed | course | address | attributes | accuracy | network | geofenceids | latitudewgs84 | longitudewgs84 |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
| 942993 | huabao | 7 | 2026-04-27 10:41:11 | 2026-04-27 10:41:09 | 2026-04-27 10:41:09 | | 30.25623116321045 | 120.12434323011745 | 11 | 15.2808 | 174 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323300,"rssi":31,"sat":35,"iccid":"898608340124c0428927","distance":108.6679047877219,"totalDistance":3797403.5884900284,"motion":true,"hours":1318318000} | 0 | null | null | NULL | NULL |
| 942989 | huabao | 7 | 2026-04-27 10:40:50 | 2026-04-27 10:40:49 | 2026-04-27 10:40:49 | | 30.257207232490412 | 120.12436028143401 | 8 | 9.44925 | 188 | NULL | {"ignition":true,"blocked":false,"charge":false,"odometer":4323200,"rssi":5,"sat":34,"iccid":"898608340124c0428927","distance":121.00132321316921,"totalDistance":3797294.9205852407,"motion":true,"hours":1318298000} | 0 | null | null | NULL | NULL |
+--------+----------+----------+---------------------+---------------------+---------------------+-------+--------------------+--------------------+----------+---------+--------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+-------------+--------------------+----------------+
2 rows in set (0.002 sec)
[/code]
建议坛主是不是保留原[color=#FF0000]latitude/longitude为wgs84原版本数据[/color],增加atitude[color=#FF0000]gcj[/color]/longitude[color=#FF0000]gcj[/color]两列结构,这样即能兼容原版traccar结构,也有国内坐标的支持?
我目前正常使用的还停留原amap6.6, 待老大更新后再来升级~~~