Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owntracks/show_maps轨迹异常 #709

Closed
1 task
dhr2333 opened this issue Apr 5, 2024 · 0 comments
Closed
1 task

owntracks/show_maps轨迹异常 #709

dhr2333 opened this issue Apr 5, 2024 · 0 comments

Comments

@dhr2333
Copy link
Contributor

dhr2333 commented Apr 5, 2024

我确定我已经查看了 (标注[ ][x])


我要申请 (标注[ ][x])

  • BUG 反馈
  • [ x ] 添加新的特性或者功能
  • [ x ] 请求技术支持

2024-04-04_15-51

我访问 http://127.0.0.1:8000/owntracks/get_datas 得到的经纬度数据异常,导致 http://127.0.0.1:8000/owntracks/show_maps 中显示的轨迹也异常。

使用过数据库中录入的经纬度生成轨迹,发现数据正常。

排查发现owntracks/views.py文件中的get_datas(request)函数获取到的经纬度数据是经过convert_to_amap(locations)函数转换的得到,而convert_to_amap(locations)是将经纬度从GPS系统转换成高德地图系统的。

因为全球的地图系统有很多种,如GPS、高德、百度等,各有各的坐标系。同一地理位置在不同地图系统上表现的经纬度是不一样的。比如说,同一个地点在GPS系统里的经纬度和在高德或百度系统里的经纬度就是完全不同的。

所以我想直接从数据库读取数据,然后将经纬度数据存为字符串格式,添加到路径(path)里。这样返回的结果就是GPS经纬度数据,没有进行任何坐标系转换,也就不会出现轨迹异常的情况。

2024-04-05_14-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant