没有GPS模块获得GPS坐标
答
我不知道应用程序,但这足以让我吓坏了。
html5_geolocation_watchposition
点击按钮试试吧; 分享你的位置w3schools.com;修改网页另一个面板中的脚本以适应。
编辑:对不起,刚才注意到“在Python中”,但会留下它。
答
如果您连接了Wifi网络适配器,则可以使用访问点数据查询Google的地理编码API以获取位置。
下面的命令行将检索位置:
sudo iwlist wlan0 scan | sed -E '1s/.*/{"wifiAccessPoints":[/;s/^ *Cell.*: (.*)/{"macAddress":"\1",/;s/^ *Channel:(.*)/"channel":\1,/;s/^.*nal level=(-[0-9]+) .*/"signalStrength":\1},/;/^ /d;$d' | sed '$s/.$/]}/' | curl -d @- -H "Content-Type: application/json" "https://www.googleapis.com/geolocation/v1/geolocate?key=${APIKEY}"
你需要设置APIKEY
环境变量。您可以从https://developers.google.com/maps/documentation/geocoding/get-api-key获取API密钥。