仿真器将纬度和经度四舍五入到小数点后4位

时间:2018-04-25 05:36:39

标签: android google-maps

模拟器中报告的纬度和经度与我发送的值的精度不匹配。

当我使用的特定lat / lng显示海洋时,我注意到了这一点。

如何获得更好的精确度?

Latitude and Longitude rounded off to 4 decimal places

1 个答案:

答案 0 :(得分:0)

我发现即使“当前报告的位置”中显示的值四舍五入到4位小数 - 接收的实际位置值(使用带有仿真器的融合提供程序)至少输入到小数点后第6位:< / p>

enter image description here

并记录位置:

onLocationChanged: Location[fused 37.422435,-122.084330 hAcc=23 et=+6d18h26m58s725ms alt=0.0 vAcc=47 sAcc=??? bAcc=??? {Bundle[mParcelledData.dataSize=52]}]

也许收集更多数据和发帖有助于找到问题所在。

此外,即使四舍五入至小数点后第四位也会出现最差11米的错误。

有趣的是,在6位小数的精度下,在用模拟器发送一个位置更新后锁定值可能需要一分钟 - 这里前一个位置纬度为37.422730,并且在模拟器中有一个位置纬度为37.422234已发送:

  04-26 01:48:32.761 3232-3232/ onLocationChanged: Location[fused 37.422730,-122.084330 hAcc=15 et=+6d18h39m43s985ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:48:34.814 3232-3232/ onLocationChanged: Location[fused 37.422568,-122.084330 hAcc=13 et=+6d18h39m48s986ms alt=0.0 vAcc=27 sAcc=??? 
  04-26 01:48:42.846 3232-3232/ onLocationChanged: Location[fused 37.422422,-122.084330 hAcc=14 et=+6d18h39m54s56ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:48:44.890 3232-3232/ onLocationChanged: Location[fused 37.422322,-122.084330 hAcc=13 et=+6d18h39m59s71ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:48:52.849 3232-3232/ onLocationChanged: Location[fused 37.422305,-122.084330 hAcc=14 et=+6d18h40m4s89ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:48:54.921 3232-3232/ onLocationChanged: Location[fused 37.422267,-122.084330 hAcc=13 et=+6d18h40m9s116ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:02.908 3232-3232/ onLocationChanged: Location[fused 37.422261,-122.084330 hAcc=14 et=+6d18h40m14s143ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:05.006 3232-3232/ onLocationChanged: Location[fused 37.422246,-122.084330 hAcc=13 et=+6d18h40m19s177ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:12.982 3232-3232/ onLocationChanged: Location[fused 37.422244,-122.084330 hAcc=14 et=+6d18h40m24s193ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:15.010 3232-3232/ onLocationChanged: Location[fused 37.422238,-122.084330 hAcc=13 et=+6d18h40m29s230ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:23.037 3232-3232/ onLocationChanged: Location[fused 37.422237,-122.084330 hAcc=14 et=+6d18h40m34s259ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:25.072 3232-3232/ onLocationChanged: Location[fused 37.422235,-122.084330 hAcc=13 et=+6d18h40m39s275ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:33.079 3232-3232/ onLocationChanged: Location[fused 37.422235,-122.084330 hAcc=14 et=+6d18h40m44s302ms vAcc=??? sAcc=??? bAcc=???]
  04-26 01:49:35.135 3232-3232/ onLocationChanged: Location[fused 37.422234,-122.084330 hAcc=13 et=+6d18h40m49s319ms vAcc=??? sAcc=??? bAcc=???]

这显然是融合提供商进行一些平滑或平均的功能。

在Nexus 5和Pixel 2仿真器上尝试使用相同的结果。