問題描述
下面的代碼似乎工作正常:
<塊引用>//GPS 閱讀器//標準標準標準 = 新標準();//criteria.setAccuracy(Criteria.ACCURACY_COARSE);//當我們無法獲得 GPS 定位時使用標準.setAccuracy(標準.ACCURACY_FINE);//當我們可以獲得 GPS 定位時使用標準.setAltitudeRequired(false);標準.setBearingRequired(false);標準.setCostAllowed(true);標準.setPowerRequirement(Criteria.POWER_LOW);LocationListener locationListener = new MyLocationListener();LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);lm.requestLocationUpdates(lm.getBestProvider(criteria, true), 0, 0,位置監聽器);
但是,當我在 Google 地圖上繪制我收集的數據時,GPS 坐標在某些情況下非常分散,或者它會沿著我正在行走的路徑前進,然后突然跳轉到一個點一英里外然后回來.有沒有什么辦法解決這一問題?我猜是某種準確性檢查?
更新:
基本上我的問題看起來像這樣 - GPS抖動
更新 2:
我考慮過不要把它作為賞金,但我想我不妨完全了解這里發生的事情,看看我的方法是否過度殺戮.盡管我的精度為 3m 等,但我仍然遇到同樣的問題,即我的坐標中有抖動.現在這可能是可用的衛星等.我不知道,但基本上我想了解如何所有這些其他應用程序,尤其是運動應用程序,是否能夠在相同的情況下獲得如此流暢的讀數.
我在 Quora 上找到了這個 是否有任何正在運行的應用程序具有過濾 GPS 數據以獲得更準確跟蹤的功能? 不幸的是,它并沒有提供太多洞察力進入我的問題,除非您可以根據需要使用卡爾曼濾波器,但肯定必須有不太復雜的方法,因為我懷疑大多數應用程序都實現了這一點.
無論如何,如果有開發人員想分享他們正在做的一些偽代碼,我們將不勝感激.我的意思是,如果我堅持使用 Kalman,我會堅持下去,但我確信必須有更容易實現的算法,并且希望學習這些算法以及如何實現它們,這很合適.
上下文:這是一個移動行人應用程序.
我試圖從中收集信息的相關 SO 問題從一系列 GPS 坐標創建平滑曲線一個>平滑 gps 數據:這是一個好的開始,雖然我不確定我需要實現什么偽代碼正確地讓最小二乘擬合正常工作,這樣我就可以得到一個樣條 GPS 數據,然后我可以在谷歌地圖之類的東西上查看它,以確認我做得正確.我認為問題在于,如果這是我正在處理的一般 X 和 Y 數據,而不是 GEO 坐標,我可以在 matlab 中寫一些東西來測試它,然后繼續.
更新 3
我收到的混亂 GPS 數據的圖像https://www.dropbox.com/s/ilsf8snao2no65e/gpsdata2.png
代碼https://gist.github.com/4505688
您得到的是因為您的標準將最佳提供商標識為 NETWORK_PROVIDER
.它不會識別您的位置,而是為您提供覆蓋您設備的手機信號塔的位置.因此,當您在任何建筑物之外時,最好使用 GPS_PROVIDER
來獲得精確的地理位置.為什么你得到分散的坐標是因為你的設備進入了另一個蜂窩塔的范圍,因此發生了位置跳躍.直接使用 GPS_PROVIDER
是您將獲得的最佳解決方案.
I have the following code below which seems to be working fine:
// GPS Reader // Criteria Criteria criteria = new Criteria(); //criteria.setAccuracy(Criteria.ACCURACY_COARSE); // Used when we can't get a GPS Fix criteria.setAccuracy(Criteria.ACCURACY_FINE); // Used when we can get a GPS Fix criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); criteria.setPowerRequirement(Criteria.POWER_LOW); LocationListener locationListener = new MyLocationListener(); LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); lm.requestLocationUpdates(lm.getBestProvider(criteria, true), 0, 0, locationListener);
However, when I graph the data I have collected on Google maps, the GPS coordinates are very scattered in some instances, or it will be going along a path I am walking just find and then all of the sudden jump to a point a mile away and then back. Is there any way to fix this? Some sort of accuracy check I guess?
Update:
Basically my problem looks like this as an example - GPS Jitter
Update 2:
I considered not making this a bounty but I figured I might as well get a complete understanding of what is going on here, and see if maybe my approach is over kill. I still have the same problem that my coordinates have jitter in them despite the fact that I have accuracies of 3m, etc. Now this could be to available satellites, etc. I don't know, but basically I'm trying to understand how are all these other applications, especially the exercise apps, able to get such smooth readings under the same circumstances.
I was on Quora and was able to find this Does any running app have a feature of filtering GPS data to get more accurate tracking? Unfortunately it didn't give much insight into my problem, except you can use a Kalman filter if you want, but surely there has to be less complex means, since I doubt most apps out there are implementing this.
Anyways if a fellow developer would like to share what they are doing with some pseudocode that would be greatly appreciated. I mean if I'm stuck with Kalman I am, but I am sure there have to be easier to implement algorithms, and would hope to learn those and how to implement them, that are decent fits.
Context: This is a mobile pedestrian application.
Relevant SO Questions I have tried to glean information from Create a smooth curve from a series of GPS coordinates Smooth gps data : This was a good start, though I am not sure what pseudocode I would need to implement to properly get the Least Squares Fit to work appropriately so that I will have a splines GPS data which I can then view on something like google maps to confirm I did it correctly. I think the issue is if this was general X and Y data I was dealing with, and not GEO coordinates, I could write something up in matlab test it, and go on.
Update 3
An image of the messed up GPS data I am recieving https://www.dropbox.com/s/ilsf8snao2no65e/gpsdata2.png
Code https://gist.github.com/4505688
What you are getting is because your criteria identifies best provider as NETWORK_PROVIDER
.
Which does not identify your location but instead gives you the location of the cell tower whose range covers your device.So when you are outside of any building it is better to use GPS_PROVIDER
to get fine accuracy of Geo locations.Why you get scattered co-ordinate is because your device comes to range of another cell tower hence location jump happens. Directly use GPS_PROVIDER
is the best solution you will ever get.
這篇關于Android GPS 坐標分散的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!