geoclue2:如何获取位置和配置

Tom*_*ale 5 geolocation geoclue

在命令行中,如何获取geoclue2要报告的当前位置?

bin/我的 Arch 包中没有手册页或可执行文件。

redshift(使用geoclue2)将我的位置报告为:

7.98 98.37

但谷歌地图给了我:

9.749160、99.975484

有什么方法可以配置源geoclue2使用什么来获得更好的准确性?

大多数谷歌geoclue2搜索都提出了redshift这不太有用:(

Ser*_*ndt 7

在 Ubuntu 20.04 LTS 及更高版本上

\n

安装:

\n
$ sudo apt install geoclue-2-demo\n
Run Code Online (Sandbox Code Playgroud)\n

执行:

\n
$ /usr/libexec/geoclue-2.0/demos/where-am-i\n
Run Code Online (Sandbox Code Playgroud)\n

\xe2\x80\xa6 并观看可怕的魔法展开。

\n

始终需要启动程序文件.desktop来了解允许哪些应用程序 ID。该where-am-i.desktop文件提供于/usr/share/applications/geoclue-where-am-i.desktop

\n

地理定位源和允许的应用程序在 中配置/etc/geoclue/geoclue.conf。提及的应用程序 ID 不带.desktop文件扩展名。

\n


Ash*_*Ash 3

为了真正回答这个问题,geoclue-2.0 Ubuntu 软件包提供了一个二进制文件/usr/lib/geoclue-2.0/demos/where-am-i,它将打印 GeoClue 报告的位置以及准确性:

\n
$ /usr/lib/geoclue-2.0/demos/where-am-i\nClient object: /org/freedesktop/GeoClue2/Client/12\n\nNew location:\nLatitude:    1.234000\xc2\xb0\nLongitude:   1.234000\xc2\xb0\nAccuracy:    25000.000000 meters\nTimestamp:   Sun 21 Jun 2020 17:54:37 BST (1592758477 seconds since the Epoch)\n
Run Code Online (Sandbox Code Playgroud)\n