python实现卫星定位_在Python中获取精确的Android GPS位置

在尝试使用Python(QPython3)获取Android手机的GPS位置时,发现只能获取到由网络混合定位的位置,不够精确。如何强制使用纯GPS定位以获取更准确的位置?在循环中加入`droid.eventClearBuffer()`可以解决重复读取位置数据的问题。
摘要由CSDN通过智能技术生成

I try to obtain the GPS-Location of my Android Phone in Python (using QPython3 app). This kind of works, but it seems there are several LocationProviders in Android:

gps: pure gps location, slow, energy consuming, but very accurate,

and exactly what I need.

network: mix of gps and wifi/cell locating, faster, but less accurate

passive: like above but completely without using gps

Problem:

When I run my script (below) I only get my location provided by "network"

wich is not accurate enough.

But I can't find a way to force a specific LocationProvider.

Code:

# import needed modules

import android

import time

import sys, select, os #for loop exit

#Initiate android-module

droid = android.Android()

#notify me

droid.makeToast("fetching GPS data&

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值