問題描述
是否需要同時打開 Internet
和 GPS
才能在我的應用中讀取我的當前位置(國家、城市、地區等)?如果是,那么是否有任何替代方法可以僅從 GPS 獲取位置?由于互聯網可用性是一個問題.
Is it necessary to turn both Internet
and GPS
on before I can read my current location(country, city, locality etc) in my app? If they are, then any alternative way to get the location only from GPS? Since the internet availability is an issue.
推薦答案
正如其他人所說,GPS 不需要互聯網.
As others have said, you do not need internet for GPS.
GPS 基本上是一種基于衛星的定位系統,旨在根據從 GPS 星座中的多個衛星接收到的時間信息計算地理坐標.GPS 的首次定位時間 (TTFF) 相對較慢,并且從冷啟動(意味著沒有最后一個已知位置)開始,可能需要長達 15 分鐘才能從衛星下載所需的數據以計算位置.蜂窩網絡使用的 A-GPS 通過使用蜂窩網絡縮短了這個時間網絡將衛星數據傳送到手機.
GPS is basically a satellite based positioning system that is designed to calculate geographic coordinates based on timing information received from multiple satellites in the GPS constellation. GPS has a relatively slow time to first fix (TTFF), and from a cold start (meaning without a last known position), it can take up to 15 minutes to download the data it needs from the satellites to calculate a position. A-GPS used by cellular networks shortens this time by using the cellular network to deliver the satellite data to the phone.
但無論是 A-GPS 還是 GPS 位置,派生的只是地理坐標(緯度/經度).僅從 GPS 獲取更多信息是不可能的.
But regardless of whether it is an A-GPS or GPS location, all that is derived is Geographic Coordinates (latitude/longitude). It is impossible to obtain more from GPS only.
為了能夠返回坐標以外的任何內容(例如地址),您需要一些機制來執行 反向地理編碼.通常這是通過查詢服務器或網絡服務來完成的(例如使用 Google 地圖或 Bing 地圖,但還有其他).某些服務將允許您在本地緩存數據,但仍需要一段時間的互聯網連接才能下載周邊地區的地圖信息.
To be able to return anything other than coordinates (such as an address), you need some mechanism to do Reverse Geocoding. Typically this is done by querying a server or a web service (like using Google Maps or Bing Maps, but there are others). Some of the services will allow you to cache data locally, but it would still require an internet connection for periods of time to download the map information in the surrounding area.
雖然這需要大量的工作,但您可以編寫自己的工具來進行反向地理編碼,但您仍然需要能夠將數據存放在某個地方,因為執行此操作所需的數據量遠遠超出您的能力存儲在手機上,這意味著您仍然需要互聯網連接才能做到這一點.如果您想到 Garmin GPS 導航裝置之類的工具,它們確實會在本地存儲數據,所以這是可能的,但您需要對其進行優化以獲得最大的存儲空間,并且可能需要比手機中通常可用的更多.
While it requires a significant amount of effort, you can write your own tool to do the reverse geocoding, but you still need to be able to house the data somewhere as the amount of data required to do this is far more you can store on a phone, which means you still need an internet connection to do it. If you think of tools like Garmin GPS Navigation units, they do store the data locally, so it is possible, but you will need to optimize it for maximum storage and would probably need more than is generally available in a phone.
對您的問題的簡短回答是,不,您不需要有效的互聯網連接來獲取坐標,但除非您正在構建專用設備或擁有無限存儲空間,否則您將需要互聯網連接將這些坐標變成其他任何東西.
The short answer to your question is, no you do not need an active internet connection to get coordinates, but unless you are building a specialized device or have unlimited storage, you will need an internet connection to turn those coordinates into anything else.
這篇關于GPS需要互聯網嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!